-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing API incomplete functionality for read side detection #251
Conversation
… side shall be determined through flag and not through sam entry attributes)
Another issue with readID transformation pointed out by #247 (comment) : readID transformation was applied to the readID only upon reading the first alignment. |
…t R2 in single-end mode that was emerging together with --expand.
Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, good to merge!
"read" - 5'-end of alignments relative to R1 or R2 read coordinate system (as in traditional Hi-C), | ||
"walk" - 5'-end of alignments relative to the whole walk coordinate system, | ||
"outer" - outer ends of sequential alignments in each pair. """, | ||
"outer" - outer ends of sequential alignments in each pair (parse2 default). """, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, why do we use "outer" as the default? Wouldn't junction make more sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, "outer" makes the output interpretation similar to traditional Hi-C (as if there pairs were sequences by paired-end seq)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge it for now (current version keeps the default that we have had already; I've just expanded the docs). Feel free to update anytime if you think it's critical, though!
What was wrong?
Technical description of the issue:
push_pysam
togroup_alignments_by_side
, which relied onsam.is_read1
attribute of pysam entry. It simply does not always work as intended in pysam, and detection of the read side shall be done bysam.flag
instead, like was done inpairtools/pairtools/lib/parse.py
Lines 220 to 227 in 6303de6
Solution:
group_alignments_by_side
was refactored and fully merged with the oldpush_pysam
function.I did not design any specific test, as existing tests cover parse and parse2 read side detection; they just cannot cover all possible aligners that can report read side differently.