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
1
vote
1answer
14 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
45 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
72 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
37 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
33 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 <...
0
votes
1answer
52 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
34 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
27 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
60 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
58 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
19 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
60 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
1answer
41 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
41 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
58 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
37 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
53 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
3answers
194 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
85 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
0answers
98 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
70 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
403 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
517 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
78 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
58 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
192 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
253 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
514 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
168 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
352 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
195 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
134 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
449 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
0answers
100 views

Permanent error with picard

I am sure I set the path right but whatever I am trying the command not working Any help please? ...
2
votes
3answers
228 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
422 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
51 views

Determining Read Groups

Which Read Groups are correct: ...
1
vote
2answers
310 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
83 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
559 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 ...
2
votes
2answers
689 views

How to count the number of mapped read in 100-bp window from a BAM/SAM file

Although I know how to get total number of mapped read using samtools flagstat (samtools flagstat file_sorted.bam) but I want to count total number of mapped read ...
2
votes
1answer
2k views

Extracting all reads from bam file which match read IDs in another file

I have a long list of read IDs of interest to me in a file called read_names.txt. it is simply in the format: ...
1
vote
0answers
145 views

bedtools single-nucleotide coverage in BED-specified regions for multiple BAMs

I have a BED6 (BED + name, score, strand info) file that defines some regions of interest. I also have a set of BAMs corresponding to different samples. I would like to obtain output similar to <...
1
vote
3answers
192 views

Is there a read mapper that allows input in SAM format instead of FASTA/FASTQ?

When we get raw sequenced reads in FASTQ format, we usually need to do some pre-processing (QC, demultiplexing, etc.) prior to sequence alignment. The only way to register the results of this ...
4
votes
1answer
57 views

What is “block-compressed” file in samtools?

SAMtools returned an error message for my gzipped genome FASTA: Indexed block-compressed FASTA file cannot be handled The source code for the message is here. ...
3
votes
0answers
239 views

Fastest way to demultiplex bam file based on field

I have a bam file with aligned reads from multiple plates. For each plate I have a portion of the sequence identifier, e.g. HWI-D00310:448:CCG0KANXX:7:1101:2570:1976...
6
votes
3answers
403 views

Total reads aligning to each reference within a bam file

I have two PCR amplicons that have been multiplexed and sequenced using the nanopore minion. I have aligned the fastq reads using minimap2 with a reference file containing both amplicon sequences and ...
0
votes
0answers
29 views

Python module bamtags

Does anyone know this python module, bamtags? I'm using a pipeline (Dovetail Genomics, HiRise) that imports it, but it seems it doesn't exist. It's impossible to install it and there is no ...
1
vote
1answer
54 views

featureCounts segmentation fault on Arch Linux

I am encountering a segmentation fault when attempting to run featureCounts from subread-1.6.3 on even small test data. I installed featureCounts from SourceForge ...
3
votes
1answer
391 views

How do I rewrite a read group using pysam?

I am trying to rewrite a SAM/BAM file with altered read group entries using pysam. In this simplified version, I want to take a BAM, and rewrite the SM tags in all read groups to the same string and ...