Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Strand Determined Consistently Relative to Reference Genome (see the FLAG rather than XS tag) #485
When viewing a BAM file of stranded RNA-seq data with JBrowse, the color of reads spanning an intron were shown with different color than other reads. Further looking the description, the strand are shown inconsistently, the read on an intron the strand is maked as relative to the transcript rather than the reference genome.
The cause of such behavior is that it looks on the XS tag if present, while in absence of XS tag it looks the FLAG. This makes inconsistent view. The patch attached does not check the XS tag and consistently follow the FLAG and therefore the strand is relative to genome.
Looking XS tag in itself could be a good thing. However, in that case, unknown should be treated as unknown. Having a switch to change the view between relative to transcript and relative to genome could worth to implement. But, that is beyond the scope of this pull request. Thank you.
referenced this pull request
Jun 2, 2014
Thank you to let me know about #207 and #433. The color is simply according to the direction of read 1 of the pair. In TruSeq Stranded RNA seq kit, the read 1 will be the complementary strand. Thus, flipped relative to the transcript.
#207 primary request was showing a pair as connected. This is not achieved by this patch. In the comments you mentioned on the color. This is related and perhaps fulfilled the request.
#433 The idea looks similar. The major difference is when we flip the color. At the data store, the strand() function is just as close as the data is, and the color scheme is changed at the level of View, which was suggested by rbuels in the last comment.
Handling more than two reads per fragment or having two reads at the same direction is not well considered. All reads other than the first is flipped in this code. While SAM spec allows multi segment data, I don't see the SAM specify the direction relationships expected by sequencing method.
This proposal (#485) is to ignore the XS tag at all (commit: e84ffe8), while #473 is to follow the XS tag. To get both to work, IMHO, a dispatch based on some configuration at a higher level should be implemented. I just could not figure out how to write that toplevel switch, and I do not need locally both...