Question: Bwa Mem -M Option
7
gravatar for Varun Gupta
3.5 years ago by
Varun Gupta900
United States
Varun Gupta900 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

• 12k views
ADD COMMENTlink modified 3.5 years ago by Pierre Lindenbaum99k • written 3.5 years ago by Varun Gupta900
10
gravatar for Pierre Lindenbaum
3.5 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum99k 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 written 3.5 years ago by Pierre Lindenbaum99k

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 3.5 years ago by Varun Gupta900
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 supplemen- tary alignment ag. A"

ADD REPLYlink modified 3.5 years ago • written 3.5 years ago by Pierre Lindenbaum99k
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: 952 users visited in the last hour