-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Came across this comparing pyft (v0.2.6) on a CRAM file annotated with fibertools-rs v0.6.2 to our own independent processing of same bam file, in which we found discrepant nucleosomes or MSP positions on the genome with our interpretation.
If a nucleosome or MSP end on read coincides with the end of an align block then the length of that feature in reference coordinates may be shifted to the start of the next align block making the MSP/nucleosome artificially large. Illustration:
0 1 2
01234567890123456789012
Read MSP: | MSP |
Read ===========-------=====
Genome =======================
Genome MSP: | MSP |
| marks start and end in 0-based exclusive coordinates
= aligned base
- deletion in read
In the above the read MSP is [4, 11) length 7 but the genome MSP becomes [4, 18) length 12. The issue is that although position 11 is not in the MSP, it maps in the subsequent alignblock. If you calculate the MSP in 1-based inclusive coords the MSP is [5, 11] on read and [5, 11] on genome both length 7.
Attached is a sam record read in which this occurs (mapped to hg19). The nucleosome at forward pos 3525, reverse pos 169, and length 103, is mapped to [3367501, 3367606) by fibertools, but I believe it should be [3367501, 3367604).
Title says possible bug as I can imagine there is some subjectivity on how these align blocks are handled. But in the above motivating example, I think the length of the deletion following a msp/nucleosome should not influence the length of that feature on the genome.