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;
hello ,-M means only one alignment displayed in sam file?