Question: Why does BWA sometimes omit X0 and X1 tags?
0
gravatar for b10hazard
10 months ago by
b10hazard30
United States
b10hazard30 wrote:

Hi there,

I'm using BWA Version: 0.7.17 (which I cannot change) and I don't understand why BWA will sometimes not give me X0 and X1 tags and instead it will give me an XA tag. For example, this read lacks an X0 and X1 tag, but I do get an XA tag...

Reference span = chr17:16,068,356-16,068,404 (+) = 49bp
Cigar = 49M
Clipping = None
----------------------
Mate is mapped = yes
Mate start = chr17:16068427 (-)
Insert size = 121
Second in pair
Pair orientation = F2R1
----------------------
XA = chr7,-57669687,49M,3;chr20,-25733270,49M,3;
XG = 0
AM = 29
NM = 4
SM = 29
XM = 4
XO = 0
XT = M

However, sometimes I will get and X0, X1 AND an XA tag. Like with this read...

Reference span = chr17:16,068,394-16,068,442 (-) = 49bp
Cigar = 49M
Clipping = None
----------------------
Mate is mapped = yes
Mate start = chr17:16068300 (+)
Insert size = -142
Second in pair
Pair orientation = F1R2
----------------------
X0 = 2
X1 = 1
XA = chr17,+21544447,49M,2;chr7,+57669649,49M,3;
XG = 0
AM = 0
NM = 2
SM = 0
XM = 2
XO = 0
XT = R

Does anyone know why BWA does this?

ADD COMMENTlink modified 10 months ago by h.mon31k • written 10 months ago by b10hazard30

XA is the old version of the 'SA' tag (supplementary alignments); but what are X0 and X1 ?

ADD REPLYlink written 10 months ago by Pierre Lindenbaum130k
1

X0 and X1 are the number of hits and suboptimal hits respectively.

ADD REPLYlink written 10 months ago by b10hazard30

Could you show the whole bwa command? Are you using bwa mem or other algorithm? I suspect it is bwa aln, as I believe X0 / X1 tags were dropped for bwa mem.

Are you sure the first read lacks the X0 / X1 tags? This output seems a copy / paste from IGV mouse head-over, so there may be a bug there.

ADD REPLYlink written 10 months ago by h.mon31k

Yes, it is bwa-aln. I am forced to use this build/version of BWA. Yes this is a copy/paste from IGV but I am 100% positive reads have no X0 or X1 tag, I have verified this using samtools view and pysam. For example this command

$ samtools view /path/to/bam "chr17:16068386-16068406" | wc -l
998
$ samtools view /path/to/bam "chr17:16068386-16068406" | grep -v X1 | wc -l
67
$ samtools view /path/to/bam "chr17:16068386-16068406" | grep X1 | wc -l
931

Using X0 gives the same result, about 5% of the reads in this region have no X0 or X1 tags.

ADD REPLYlink modified 10 months ago • written 10 months ago by b10hazard30
3
gravatar for h.mon
10 months ago by
h.mon31k
Brazil
h.mon31k wrote:

By the end of the thread [Bio-bwa-help] Meaning of the XT tag?, there is a short answer from Heng Li that explains why your first read doesn't have X0 and X1 tags:

N if there is at least one ambiguous reference base in the alignment. R if X0 is not 1. X0/X1 is calculated based on single-end alignment. XT:M reads, which are mapped Smith-Waterman, do not have these tags.

However, this answer alone doesn't fully explain what is happening. What I suspect is XT:R reads have multiple paired mapping locations, but XT:M reads have only one paired mapping location, so its "true" mapping location is rescued and X0 / X1 are deemed unnecessary.

ADD COMMENTlink modified 10 months ago • written 10 months ago by h.mon31k

Ooooo! I think you are correct. I grepped for XT:M reads and none of them had X0 or X1 tags! You said that this answer doesn't fully explain what is happening though. Do you mean there might be some other error mode that results in no X0/X1 tags?

ADD REPLYlink written 10 months ago by b10hazard30

Do you mean there might be some other error mode that results in no X0/X1 tags?

No, I mean now the issue is why some reads are tagged as XT:M, and others, as XT:R.

ADD REPLYlink modified 10 months ago • written 10 months ago by h.mon31k

I think I may have stumbled onto another explaination. In this thread Heng says...

> Let say if I have X0:i:<n> and X1:i:<m> then:
> 
> * if <n> = 1 and <m> = 0 => unique read
> * if <n> + <m> >1 => multi hits
> * if there is no X0/X1 tag as well as XA tag => unique read again?

The third case: it is anchored by its mate. Bwa cannot align it as a single-end read. It unable to find alternative hits for this read.

So maybe the X0/X1 tags will be omitted if it cannot find alternative hits. So if there is no X0/X1 tags and there is an XA tag I would probably want to avoid the read.

ADD REPLYlink modified 10 months ago • written 10 months ago by b10hazard30
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: 2046 users visited in the last hour