Skip to main content
16 votes
Accepted

Meaning of BWA-MEM MAPQ scores

First of all, if you want to understand mapping quality (mapQ), ignore RNA-seq mappers. They often produce misleading mapQ because mapQ is not important to RNA-seq anyway. Strictly speaking, you have ...
user172818's user avatar
  • 6,575
14 votes
Accepted

Obtaining uniquely mapped reads from BWA mem alignment

Update - as of January 2021, samtools can now do filtering based on an expression that includes tag variables. In this case, this expression can be used to exclude any reads that have either an XA or ...
gringer's user avatar
  • 14.9k
12 votes
Accepted

Library for computing BWT-based alignments

First, let us remark that there exist several hundred read mappers, most of which have been even published (see, e.g., pages 25-29 of this thesis). Developing a new mapper probably makes sense only as ...
Karel Břinda's user avatar
12 votes

Difference between BWA-backtrack and BWA-MEM

TL;DR: BWA-backtrack is based on backtracking. This approach is appropriate only when the dissimilarity between the reads and the reference is low, or when you want to find all best hits or enumerate ...
Karel Břinda's user avatar
10 votes
Accepted

Why most aligners do not output the "X" CIGAR operation?

The SAM format originally had only M, I, D, N, S, H, and P CIGAR operators. See the original SAM specification (if you can view Apple Pages documents) and Table 1 in The Sequence Alignment/Map format ...
John Marshall's user avatar
9 votes

Difference between BWA-backtrack and BWA-MEM

To quote the Introduction to BWA on sourceforge: BWA is a software package for mapping low-divergent sequences against a large reference genome, such as the ...
Michael Hall's user avatar
9 votes
Accepted

What are all the reference files produced by bwa index, and are these dependent upon whether the reference is zipped?

You'll get the exact same index (the amb, ann, bwt, pac ...
Devon Ryan's user avatar
  • 19.8k
9 votes

Library for computing BWT-based alignments

BWA-MEM can be used as a library. File bwa/example.c shows the basic functionality for single-end mapping. It should give identical mapping to the bwa-mem command line. Header bwa/bwamem.h contains ...
user172818's user avatar
  • 6,575
7 votes
Accepted

Is there a more elegant solution to the bwa-mem: paired reads have different names error?

Assuming the read name lines only contain things like @JQ714243-920-1 and nothing else, then sed -i '1~4 s/-[12]$//' file.fastq (...
Devon Ryan's user avatar
  • 19.8k
7 votes

Meaning of BWA-MEM MAPQ scores

Those numbers are not arbitrarily picked (well... maybe 255/60/40 is arbitrarily picked). To convert from log10 Q values like these (also used for error rates in FASTQ files) to probabilities, divide ...
gringer's user avatar
  • 14.9k
7 votes
Accepted

Why is bwa-mem the standard algorithm when using bwa?

bwa mem is newer, faster, and [should be] more accurate, particularly for longer reads. From the bwa man page (presumably in ...
gringer's user avatar
  • 14.9k
6 votes
Accepted

What is mate rescue in bwa mem?

Using -SP is equivalent to running bwa mem on each of the two mates as if they are single-end reads, but it formats the output ...
Soo Lee's user avatar
  • 76
5 votes
Accepted

Do you use SNAP for short-read mapping?

GATK best practices are explicably meant to consume BWA MEM generated BAM. Whilst SNAP may be faster, the Broad will not have tested it for compatibility with GATK as such you can't guaranty using it ...
Matt Bashton's user avatar
  • 1,069
5 votes

How to output all sequences with bwa mem, not `*`?

I don't believe that is an option. Internally we created a patch and submitted it to BWA however that was 4 years ago and it has not been accepted.
Bioathlete's user avatar
  • 2,584
5 votes
Accepted

Samtools Index: Chromosome Blocks not Continuous

samtools sort blasted_SRR6649368.bam -o sorted_SRR6649368.bam -n These error messages indicate that the reads are not sorted by coordinate — in particular, that ...
John Marshall's user avatar
5 votes
Accepted

Trying to create a .bam file without the need for a .sam file

This is an error from bwa saying that it can't find your input files: Here's a checklist: Check that you have no whitespace after your ...
Bastian Schiffthaler's user avatar
5 votes

How fo force nextflow to repeat a process until all values in a particular channels are used up BUT a single value from another channel is needed

I discovered a solution using a combination of .collect() and each. If one collects from a path the result is a value channel of ...
jh_'s user avatar
  • 101
4 votes
Accepted

How BWA generate index files?

Papers The space-efficient BWT construction algorithm is in bwt_gen.c. One of the first things you see there is the copyright line: Copyright (C) 2004, Wong Chi Kwong. With that name, you can ...
Jouni Sirén's user avatar
4 votes
Accepted

Generating burrows-wheeler-transform and a suffix array of a DNA sequence with less memory

No, there is no way to decompress .bwt or .sa files, because they are not compressed. After indexing you'll get these files, which some programs (bwa) use. They should be in the same folder as your ...
benn's user avatar
  • 3,591
4 votes
Accepted

Estimating BAM file from compressed fastq file size

A BAM file should have a roughly similar size to a compressed FASTQ file, because they're both compressed files that contain similar information. BAM will be slightly larger, because it contains ...
gringer's user avatar
  • 14.9k
4 votes

How to read .bwt file .sa file?

You need to include bwa.o in your call to clang, since it holds the definitions of those functions. This will cause a good ...
Devon Ryan's user avatar
  • 19.8k
4 votes

Obtaining uniquely mapped reads from BWA mem alignment

For much faster and stable$ implementation, sambamba can handle this using following one-liner: ...
Samir's user avatar
  • 151
4 votes

Library for computing BWT-based alignments

SeqAn supports BWT tables for use with their parametrisable alignment algorithms. To use it, follow the general outline for building a SeqAn short-read aligner, and use the ...
Konrad Rudolph's user avatar
4 votes
Accepted

What is the correct way to map Hi-C data with bwa mem?

See here, in particular slide #10 from the tutorial: bwa mem -5SPM ref.fa read1.fq read2.fq > out.sam Here, -SP disables ...
user172818's user avatar
  • 6,575
4 votes

Determining Read Groups

Usually it doesn't actually matter, but if you want it to be very correct: ...
Devon Ryan's user avatar
  • 19.8k
4 votes

How does split reads look like in sam files?

I'm assuming you mean supplementary/chimeric alignment? The SAM Format Specification has a really detailed explanation as well as its Optional Fields Specification. In general though, you will have an ...
helrick's user avatar
  • 94
4 votes

BWA-mem and sambamba read group line error

Read groups must start with RG, that is a hardcoded requirement of the SAM format, nothing you can do about that. See https://samtools.github.io/hts-specs/SAMv1.pdf
Clarus Salvus's user avatar
3 votes

How does the BWA-MEM algorithm assign its mapping qualities?

Yes, there bwa-mem was published as a preprint BWA-MEM’s seed extension differs from the standard seed extension in two aspects. Firstly, suppose at a certain extension step we come to reference ...
Kamil S Jaron's user avatar
3 votes

How BWA generate index files?

The following is only a comment to @JouniS' answer, but it is too long to fit in 512 characters. The algorithm @JouniS was describing has been rediscovered multiple times. The C program below ...
user172818's user avatar
  • 6,575

Only top scored, non community-wiki answers of a minimum length are eligible