How to identify the chromosome where the reads has the secondary (alternative alignments), after running bwa mem?
2
1
Entering edit mode
8.4 years ago
kirannbishwa01 ★ 1.6k

I have a bam file generated using BWA mem. Previously there used to be XA tag to find the chromosome where the read had a secondary/alternative alignment. The recent bam filed don't have that. On the web I am not able to find the equivalent tag to hunt down the chromosome (alternative one) that read might have aligned to.

Also, is it possible to identify if it is the second best or the 3rd best hit based on any of the tags?

Additionally, I have been looking around and not able to find what does UQ tag stand for?

Here is some lines from my sam file:

HWI-ST588:83:D0D0MACXX:5:1308:6105:105495 163 scaffold_1109 180 37 32M69S = 180 32 CATAGGGACTTCGTCTTCACTTACAAAACTTGGGGATGCCATAATAAGCTTGTGTAGGGTATTTGGAGTCCAATATTACAAGATTGGTGTGTATGACTAAG B@@FF+=AFHGHHGIJJJIJJJJJJJIIJJJJJJJH):BGHIIJJIIJJJIHFHBGGII=CAGIIJJJHHHHHFFFFFFFEECEDEDCBDDDFEEDDDDDD MC:Z:69S32M MD:Z:34T1A39G24 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:0 MQ:i:37 UQ:i:0 AS:i:86 XS:i:83 HWI-ST588:83:D0D0MACXX:5:1308:6105:105495 83 scaffold_1109 180 37 69S32M = 180 -32 AGTATAAGAAAGTGAAATGCAACCCGTATCCTAGCTGCTAAAGTAGAGTAGATATAAAACAAAAAAACTCATAGGGACTTCGTCTTCACTTACAAAACTTG EDDDDDDDDDDDEEDDDDDBD@DDCEEEFFFFFHHHHHHJJJJIJJJJJJJJJJJJJJIJJJJJJIGGIJJGGJIHIJJGJJJJJIGGGHFHHFFFDFCC@ MC:Z:32M69S MD:Z:101 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:0 MQ:i:37 UQ:i:0 AS:i:101 XS:i:96 HWI-ST588:83:D0D0MACXX:5:2101:13117:9321 147 scaffold_1109 181 0 24S77M = 182 -76 GTTGATATAAAACAAAAAAAACTCATAGGGACTTCGTCTTCAGTTACAAAACTTGGGGAAGCCATAATAACCTTGTGTAGGGTATTTGGAGTCCAATATGA ?>>@>4:3DCA<9BB@AC>;;@DEDFEFHC;GIGGIGGIIHHCGIGHIHFBEFFJJJIJJJJJJJJJJIIIIGGJIJJJJJJJJJIJJHHHHHEDFFFCCC MC:Z:86M15S MD:Z:2A38C14T12G30 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:3 MQ:i:0 UQ:i:114 AS:i:75 XS:i:78 HWI-ST588:83:D0D0MACXX:5:2101:13117:9321 99 scaffold_1109 182 0 86M15S = 181 76 TAGGGACTTCGTCTTCACTTACAAAACTTGGGGAAGCCATAATAAGCTTGTGTAGGGTATTTGGAGTCCAATATTACAAGATTGGTGTGTACGACTTAGTA @CCFFFFFHHGFHIJJJJJIIJIIJJJJJJJJJIJIJIJIIJJIJIIJJIIHFHGGICGHDIJIIJHHHHHHHEFCDDFFEEEEE;?ABBDEDDD6<@CA@ MC:Z:24S77M MD:Z:32T41G16 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:2 MQ:i:0 UQ:i:78 AS:i:81 XS:i:81 HWI-ST588:83:D0D0MACXX:5:2203:20321:132667 83 scaffold_1109 183 10 100M = 175 -108 AGGGACTTCGTCTTCACTTACAAAACTTGGGGAAGCCATAATAAGCTTGTGTAGGGTATTTGGAGTCCAATATTACAAGATTGGTGTGTATGACTAAGTA @CC@8BBBBECCEEC@BC?B@CHHHEEHHDG@IHEFEF@IIJIIIGHFGDHEGJIIGIIGIIIGH@>EJIHHEEDIGHEIGIIIGGIHBBDFFFFFF@@C MC:Z:101M MD:Z:31T41G24C1 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:3 MQ:i:10 UQ:i:98 AS:i:88 XS:i:85 HWI-ST588:83:D0D0MACXX:5:1107:7931:7922 99 scaffold_1109 185 14 95M6S = 185 95 GGACTTCGTCTTCACTTACAAAACTTTGGGAAGCCATAATAAGCTTGTGTAGGGTATTTGGAGTNCAATATTACAAGATTGGTGTGTATGACTAAAGATCG CCCFFFFFHHHHHJJIJHIJJJJJJJJJJJIIHGHIJJJJJJJJIJJJJFHHIJEGGIJJIJJF#-;DHEHHHHFFFFFFEEACDDBEFEDDDDDDDDDDD MC:Z:6S95M MD:Z:26G2T34C6G23 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:4 MQ:i:14 UQ:i:123 AS:i:78 XS:i:76 HWI-ST588:83:D0D0MACXX:5:1107:7931:7922 147 scaffold_1109 185 14 6S95M = 185 -95 CGATCTGGACTTCGTCTTCACTTACAAAACTTTGGGAAGCCATAATAAGCTTGTGTAGGGTATTTGGAGTCCAATATTACCAGATTGGTGTGTATGACTAA ADDDCCDC=@BBDDCEFFECEFEAEHHE@IIGIJIGJJJJIIJJJJJJJIIJJJJJJJJIEJJJJJJJJJJJJJJJHHC<,JJJJJJJHHHHHFFFDFCCC MC:Z:95M6S MD:Z:26G2T41G2A20 PG:Z:MarkDuplicates RG:Z:Sp21_D0D0MACXX_5 NM:i:4 MQ:i:14 UQ:i:128 AS:i:75 XS:i:73

Thanks,

bwa mem sam bam alignment • 3.4k views
ADD COMMENT
2
Entering edit mode
8.4 years ago

bwa mem (my version: 0.7.10-r789) can add the XA tag with the -h option:

-h INT if there are <INT hits with score >80% of the max score, output all in XA [5]

Also, is it possible to identify if it is the second best or the 3rd best hit based on any of the tags?

Probably yes with some further steps down the line, but I doubt it's going to be much useful in typical cases.

The UQ tag is descibed in the sam spec:

UQ i Phred likelihood of the segment, conditional on the mapping being correct

ADD COMMENT
0
Entering edit mode

About the hlep from bwa mem: -h INT[,INT] if there are <int hits="" with="" score="" &gt;80%="" of="" the="" max="" score,="" output="" all="" in="" xa="" [5,200].="" how="" do="" you="" translate="" it="" into="" english.="" say="" -h="" 10,="" does="" it="" mean="" only="" last="" 10="" of="" the="" top="" 80%="" max="" scores?="" say="" the="" max="" aligned="" score="" is="" 100,="" then="" any="" alignment="" &gt;80="" will="" be="" listed="" in="" xa="" tag?="" does="" the="" -h="" 10="" limit="" the="" total="" to="" 10?="" how="" about="" the="" actual="" alignments,="" are="" they="" also="" in="" the="" result="" file?="" i="" am="" a="" new="" user="" and="" trying="" to="" fully="" understand="" the="" documentation="" for="" bwa.="" <="" p="">

ADD REPLY
1
Entering edit mode
8.4 years ago

XA is not a standard tag. If your pipeline relied on it, I suggest you revert to whatever software version that provided that tag. But it's safer to rely on standard fields and ignore nonstandard ones.

ADD COMMENT

Login before adding your answer.

Traffic: 1579 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6