Question: Bwa Mem -M Option
9
gravatar for Varun Gupta
5.7 years ago by
Varun Gupta1.1k
United States
Varun Gupta1.1k wrote:

Hello

I want to align my reads to the reference genome and then use GATK for downstream analysis. I am using bwa mem protocol.

As I was going through the options, I came across bwa mem -M option which is compatible with picard and GATK

-M         mark shorter split hits as secondary (for Picard/GATK compatibility)

Can someone explain me what does this option do.

Also can bwa mem accept compressed .bz2 fastq files as input??

Hope to hear soon

Regards

Varun

• 17k views
ADD COMMENTlink modified 23 months ago by fancity xia0 • written 5.7 years ago by Varun Gupta1.1k

hello ,-M means only one alignment displayed in sam file?

ADD REPLYlink modified 23 months ago • written 23 months ago by fancity xia0
13
gravatar for Pierre Lindenbaum
5.7 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum124k wrote:

without -M, a split read is flagged as 2048 (supplementary alignment) see http://picard.sourceforge.net/explain-flags.html. This flag is a recent addition to the SAM spec.

$ ./bwa mem  ex1.fa <(echo -e "@R1\nATTGCAAGACAGACTTCATCAAGATATGTAGTCATCAGACTATCTAAAGTCAACATGAAGGATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTC\n+\nIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII") 2> /dev/null 
@SQ    SN:seq1    LN:1575
@SQ    SN:seq2    LN:1584
R1    0    seq2    361    60    62M46S    *    0    0    ATTGCAAGACAGACTTCATCAAGATATGTAGTCATCAGACTATCTAAAGTCAACATGAAGGATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTC    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII    NM:i:0    AS:i:62    XS:i:0    SA:Z:seq1,1273,+,60S48M,60,0;
R1    2048    seq1    1273    60    60H48M    *    0    0    GATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTC    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII    NM:i:0    AS:i:48    XS:i:0    SA:Z:seq2,361,+,62M46S,60,0;

with option -M it is flagged as a duplicate flag=256 (not primary alignment): will be ignored by most 'old' tools.

$ ./bwa mem -M    ex1.fa <(echo -e "@R1\nATTGCAAGACAGACTTCATCAAGATATGTAGTCATCAGACTATCTAAAGTCAACATGAAGGATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTC\n+\nIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII") 2> /dev/null 
@SQ    SN:seq1    LN:1575
@SQ    SN:seq2    LN:1584
R1    0    seq2    361    60    62M46S    *    0    0    ATTGCAAGACAGACTTCATCAAGATATGTAGTCATCAGACTATCTAAAGTCAACATGAAGGATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTC    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII    NM:i:0    AS:i:62    XS:i:0    SA:Z:seq1,1273,+,60S48M,60,0;
R1    256    seq1    1273    60    60H48M    *    0    0    GATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTC    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII    NM:i:0    AS:i:48    XS:i:0    SA:Z:seq2,361,+,62M46S,60,0;
ADD COMMENTlink modified 9 weeks ago by RamRS25k • written 5.7 years ago by Pierre Lindenbaum124k

Thanks Pierre

What does split read means here in context with -M option? So using option -M it says the read to be secondary alignment(not primary alignment) whereas without -M option it gives as supplementary alignment(2048).

What is the difference between "not a primary alignment " and supplementary alignment.

ADD REPLYlink written 5.7 years ago by Varun Gupta1.1k
1

See the sam spec: http://samtools.github.io/hts-specs/SAMv1.pdf

An alignment of a read that cannot be represented as a linear alignment. A chimeric alignment is represented as a set of linear alignments that do not have large overlaps. Typically, one of the linear alignments in a chimeric alignment is considered the "representative" alignment, and the others are called "supplementary" and are distinguished by the supplementary alignment ag. A

ADD REPLYlink modified 9 weeks ago by RamRS25k • written 5.7 years ago by Pierre Lindenbaum124k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 915 users visited in the last hour