This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How Do I Interpret The Pos In The Alternative Hits Format?

How do I interpret the pos in the alternative hits format of a SAM file, "XA (chr,pos,CIGAR,NM;)*" ? Does pos < 0 mean reverse strand and pos > 0 mean forward strand?

sam

1 answer

Yes, I checked in the source of bwa 0.6.2 and you're right. For completeness, an example XA tag would look like:

XA:Z:chr12,+469236,36M,0;chr12,+486120,36M,0;chr12,-472888,36M,0;

And the code snippet writing the chromosome, strand, and position in bwase.c is:

err_printf("%s,%c%d,", bns->anns[seqid].name, q->strand? '-' : '+', (int)(q->pos - bns->anns[seqid].offset + 1));

Log in to answer this question.