Hot answers tagged

14 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 ...
user avatar
  • 5,645
13 votes
Accepted

Obtaining uniquely mapped reads from BWA mem alignment

To exclude all possible multi-mapped reads from a BWA-mapped BAM file, it looks like you need to use grep on the uncompressed SAM fields: ...
user avatar
  • 11.5k
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 ...
user avatar
11 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 ...
user avatar
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 ...
user avatar
  • 5,645
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 ...
user avatar
8 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 ...
user avatar
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 (...
user avatar
  • 19.3k
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 ...
user avatar
  • 11.5k
6 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 ...
user avatar
  • 19.3k
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 ...
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 ...
user avatar
  • 1,029
5 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 ...
user avatar
  • 11.5k
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.
user avatar
  • 2,566
5 votes
Accepted

How to extract unmatched reads using bwa and samtools?

Yes, correct but overly many steps. There is no need to convert between bam and sam. samtools can read from stdin and handles ...
user avatar
  • 2,706
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 ...
user avatar
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 ...
user avatar
  • 11.5k
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 ...
user avatar
  • 19.3k
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 ...
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 ...
user avatar
  • 3,521
4 votes

Obtaining uniquely mapped reads from BWA mem alignment

For much faster and stable$ implementation, sambamba can handle this using following one-liner: ...
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 ...
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 ...
user avatar
  • 5,645
4 votes

Determining Read Groups

Usually it doesn't actually matter, but if you want it to be very correct: ...
user avatar
  • 19.3k
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 ...
user avatar
  • 5,287
3 votes
Accepted

How to read .bwt file .sa file?

In the bwa source code, file bwt.{c,h} implement basic operations on .bwt and .sa files. They depend on utils.{c,h}, but you can create a fake utils.h to cut this dependency as is shown below. Then ...
user avatar
  • 5,645
3 votes
Accepted

Interpreting 0x200 flag in bwa-mem alignments

bwa mem is using exactly the same meaning of the 0x200 flag as every other program, including picard. Don't blindly assume that that entry in the header file ...
user avatar
  • 19.3k
3 votes

How to map reads shorter than 32bp with minimap2?

Minimap2 doesn't work well with 32bp reads by design. Older mappers like bowtie1 and bwa-aln will be better.
user avatar
  • 5,645
3 votes

samtools view: writing to standard output failed: Broken pipe

[W::sam_read1] Parse error at line 1 samtools sort: truncated file. Aborting SAMtools sort has been unable to parse its input, which it thought was SAM (mostly ...
user avatar
3 votes
Accepted

Error with BWA Mem input having multiple fastq files using cat and process substitution

You are correct that the concatenation of input read files will confuse BWA. BWA depends on the input reads being in the same order in R1 and R2 files for paired-end alignment. From bwa docs: ...
user avatar

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