Questions tagged [bam]

The "Binary Alignment Map" (BAM) format is one of the common binary formats used to store sequence alignment information. Questions should include this tag if they directly pertain to the format itself, details of BAM file usage, or errors relating to likely malformed BAM files.

Filter by
Sorted by
Tagged with
0
votes
1answer
25 views

How to anonymise a bam file

I have a bam file of, for instance, RNA-Seq, which contains patient-identifiable data in the form of Single Nucleotide Polymorphisms (SNPs) throughout. I would like a technique to take this aligned ...
0
votes
1answer
34 views

How to convert BAM file to bigWig in Python?

I am manipulating some BAM files using pysam package which seems to be very fast and handy. However, I ran into problem when I am trying to generate bigWig files ...
2
votes
1answer
64 views

Is there a tool that can perform a read-group-aware mpileup from a single file?

I would like to perform a samtools mpileup from a single file that contains thousands of read groups with different SM tags. I could split the bam by read group ...
2
votes
1answer
20 views

Phasing problem using “samtools phase”

so I'm having a problem using samtools phase. I'm trying to phase my .bam archives that where generated by aligning my samples with my reference genome. Following the documentation I tried the command:...
3
votes
1answer
24 views

Chromosomal order of supplementary alignment in BAM file “SA” tag

I have several long-read sequences, which when aligned to a human reference genome, aligns to multiple chromosomal fragment as a result of chromothripsis shattering the linear DNA and randomly piecing ...
0
votes
2answers
82 views

Accessing .bam/.cram files from AWS S3?

What's the best/easiest way for accessing .bam/.cram files from S3? I have .bam/.bai .cram/.crai and .bed + .gff files that I want to make available easily to others so they can browse in IGV and ...
3
votes
2answers
99 views

Is there a command line tool to split a SAM/BAM file by CB (cell barcode) tag?

I have a BAM file from a single cell sequencing experiment. Each read has had the cell barcode annotated in the CB tag. Some reads do not have a ...
1
vote
1answer
43 views

plot correlation between several bam files

I have several mab files from medip-seq. they supposed to be replicates and I have to draw their correlation. First I used multiBamSummary from deeptools to merge all the bam files based on bi/bed. ...
1
vote
2answers
49 views

Marking optical or PCR duplicates with picard vs. samtools flagstat

I am trying to identify the best library prep method for noninvasive prenatal test samples, to be sequenced with Illumina Novaseq. One metric that I am evaluating is the number/ percentage of PCR or ...
0
votes
1answer
30 views

HTSeq-count is returning 0 for every gene, instead of expression value

(Ported from stack overflow) I'm trying to summarize gene count using htseq-count; and it's returning 0 counts at every gene. I'm not sure what I'm doing wrong; I think it has to do with the gene ...
1
vote
1answer
36 views

How to filter a SAM file by a bed file?

I have a large BAM file and I want to filter it by just what's defined in a bed file, and write it to a new file. Is it possible to do this with samtools, and if so, how? Is there a better tool I ...
1
vote
1answer
84 views

Index a BAM file using pysam

(How) can you index a BAM file using pysam? When I tried the intuitive pysam.index I got: ...
2
votes
3answers
79 views

Make a fasta out of mapped reads without taking into account the reference

I've aligned reads onto an haploid reference genome. I'd like to have a consensus sequence of all my aligned reads that doesn't take into account the reference genome I used (i.e. I just want the ...
0
votes
0answers
250 views

Using BaseRecalibrator in GATK4

GATK4's BaseRecalibrator uses a list of known variants to adjust the base quality scores in a BAM file. I would like to visualize the pre and post recalibration ...
1
vote
1answer
38 views

samtools / bamUtil | Meaning of <*> as Reference Name

I have been working with several tools on bam files recently and I am not sure how I should interpret some of the outputs. samtools idxstats mapped.sorted.bam <...
1
vote
1answer
87 views

How to obtain file offsets corresponding to range query in block-gzipped file

How can we retrieve the file offsets of the zipped-chunks in a block-gzipped file that contain records for a region/window of interest (e.g. Chr01:100-Chr02:145)? It seems like the CLI of ...
3
votes
1answer
89 views

How to generate two fasta files from samtools phase output?

samtools phase is an easy-to-use tool to phase variants from a bam file and a reference. For a sequence that has two haplotypes, like this: ...
3
votes
1answer
38 views

Tool for calibrating base quality scores?

A given sequencing machine assigns a 'certainty' to each base call in the form of a per-base quality score (FASTQ format). I have reads from several machines aligned to the corresponding reference (...
3
votes
1answer
96 views

pysam or piping samtools view to a python script

Is it faster to use the PySam package to run a python script on a bam for read in samfile.fetch('chr1', 100, 120): print read compared to using a pipe and ...
3
votes
1answer
100 views

How can I export a full alignment from IGV as an image?

The IGV browser lets you export an alignment as an image (File => Save Image). However, this image only contains those reads that fit in the viewing window: As you can see in the image above by ...
0
votes
0answers
24 views

How to visualise /add Arabidopsis T-DNA Lines As Tracks On IGV

We have done some RNA-Seq on Arabidopsis T-DNA lines and mapped the reads on to Arabidopsis genome. Now we wanted to confirm the T-DNA deletion of those lines by loading them on IGV. As a control we ...
2
votes
0answers
125 views

What pitfalls exist with running FastQC on a bam file?

When trying to figure out what was going on with a bad sequencing run of some RNA data, among other usages of FastQC on earlier files in the analysis, I ran it using RNA-STAR-aligned bam files (human ...
1
vote
2answers
141 views

Extract reads from bam files by their @RG

How could I extract reads from bam files by their read groups @RG ?, I've got one file containing all reads for 5 samples, the SM is appears NONE, So, I want to extract each sample reads by the @RG ...
0
votes
0answers
44 views

How to obtain the extended unaligned bases of the read in reference based genome assembly?

I did illumina read mapping based on a particular gene sequence (reference sequence) using the following command, ...
0
votes
0answers
89 views

multiBamCov for counting reads overlapping a bin interval

I am using multiBamCov from bedtools to count reads in my bed file. I want to count the reads in the specified bins in my bed file such that if the read in the bam file overlap the interval more than ...
0
votes
2answers
50 views

Chromosome information for miRNA

Apologies if this question is previously asked. I have a BAM file alignment to hg19 and miRNA gff3 file from ...
1
vote
2answers
81 views

Hard-clip primers in a bam file

I am working on a sample which was sequenced using an amplicon kit and I would like to ensure that no variants are called in the PCR primer sequences. I know that the primer sequences are part of the ...
2
votes
4answers
448 views

Hosting IGV web on a server

I have my analysis on a cloud server. The data is quite large, so copying it locally is not really an option. I want to be able to host IGV as a server on that server, so that it can access those ...
3
votes
3answers
94 views

Compare multiple alignment results' aligned bases

I have aligned a nanopore data set to a reference genome with graphmap, minimap2 and BLASR. The alignment results are stored in BAM files. I would like to do some concordance assessment, looking at ...
2
votes
1answer
154 views

How to get a MSA fasta from BAM/SAM?

I am working with paired end NGS miseq data from a viral genome with multiple timepoints. I have filtered and trimmed this data for quality and adapter sequences. I have then merged the filtered ...
2
votes
2answers
118 views

How can I transform a mapped BAM file into an unmapped BAM file?

In order to use MergeBamAlignment (Picard), I need an unmapped BAM file and a mapped BAM file. I have two mapped BAM files: one with reads mapped to the reference I want but without metadata such as ...
6
votes
1answer
673 views

Convert BAM to properly paired FASTQ files

I thought I had figured this one out. But apparently not. I need to convert a BAM file of paired-end alignments to two FASTQ files of paired reads to realign them, with a twist: I only want reads ...
2
votes
2answers
986 views

Error while calling bcftools mpileup - Failed to open -: unknown file type

I have sequenced a bacterial genome with a GridIon from ONT. Basically what I want to check is whether or not trimming 50 bps at the beginning of the reads will improve alignment against the reference ...
3
votes
2answers
88 views

Produce a single sequential FASTA sequence out of BAM

I'm having problems properly looking for a solution because I'm a layman in Bioinformatics not familiar with the terminology. I'm hoping you can nudge me in the right direction, please! Thank you very ...
2
votes
2answers
79 views

Error: sort order of reads in BAMs must be the same

I am a novice to bioinformatics trying to run a cuffdiff job in cufflinks and keep getting this error message: Error: sort order of reads in BAMs must be the same ...
1
vote
1answer
323 views

How do you normalise read coverage in a BAM file?

This is a question from the Oxford Nanopore community, from user Michael Radzieta: I have sequenced some plasmids using the rapid barcoding kit, I have attempted to assemble the data using several ...
4
votes
3answers
490 views

How can I calculate coverage at single bases using a bam file?

I'm looking for a way to input a vcf or bed file (with specific base positions) and a bam file, and get the coverage at each base position (ie single base bins) using the bam file. I also want the ...
2
votes
1answer
802 views

How do I find split reads?

How can I detect a split read in a BAM file? Is there any sign in the CIGAR string that describes split read?
2
votes
1answer
214 views

Consensus sequence from SAM or BAM file?

I am trying to perform reference-based assembly. Most of the tutorials teach how to create a bam file and view alignemnts in IGV or Tablet. But, I want a assembled genome sequence in fasta format. How ...
5
votes
2answers
405 views

What does “fetching by region is not available for SAM files” mean?

I am used to gzip/biopython solutions when dealing with sequencing data, but now I wish to switch to more elegant ...
2
votes
2answers
328 views

Access base aligned to particular reference position

The short version: If I have a SAM record, is there any simple way to retrieve the base aligned to a particular reference position without computing a pileup? The long version: I'm using pysam to ...
2
votes
2answers
140 views

Variant calling without matched normal sample

I have WGS .bam files for 3 patients (tumour and its matched derived model namely organoid) but I don't matched normal sample. If I call variants of each patients (tumour and its matched organoid), ...
3
votes
1answer
711 views

Running htseq-count over BAM files

I am trying to derive an expression matrix from BAM files using htseq-count on the server. These are bulk RNASeq BAM's by the way. I have read the ...
0
votes
1answer
134 views

Picard validation error regarding bin field of BAM file

I am sure I set the path right but whatever I am trying the command not working Any help please? ...
2
votes
3answers
287 views

I have 23andme text files and would like to convert to SAM/BAM format

I would like to convert 23andme text file to NextGen to BAM file for Yfull.com to read. It is difficult to get answers on how to convert to SAM/BAM file for the 23andme text file to be converted to ...
3
votes
1answer
592 views

BAM to gene expression matrix (UMI counts per gene per cell),10X

I am trying to reproduce some results of a scRNASeq experiment. However I am new to the server-side aspect of such analyses and am very confused at the moment. The data provided by the authors of the ...
3
votes
1answer
66 views

Determining Read Groups

Which Read Groups are correct: ...
1
vote
2answers
398 views

Chunk alignment in a name sorted bam for parallel processing

I have a bam file with 1 billion alignment reads of which there are 700 million unique reads. I want to split the alignments into chunks for parallel-processing. Multi-alignments of the same read ...
3
votes
0answers
93 views

convert supplementary reads to primary in sam or bam

I have a problem with a tool, that possibly ignores supplementary reads. I want to find out a bit how this tool works by converting all supplementary reads to primary reads, and then change the names ...
9
votes
1answer
582 views

Why does this human bam file only have one copy of each chromosome?

As we know that in human DNA sequence, one copy of chromosome comes from mother's DNA and another copy comes from father's DNA so as to form two copies of each chromosome in human DNA. So, if we ...