Repository navigation
Make setReadString("*") go through setReadBases so BAMRecord sees it - #1951
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Walkthrough
Merge Risk:
|
setReadString assigned NULL_SEQUENCE to mReadBases directly for "*", bypassing BAMRecord's setReadBases override, which marks the stored binary data stale and the cached read length invalid. A record read from BAM then reported its old read length and, when written back to BAM, wrote its original bases. Changing the qualities too hid the bug, since setBaseQualities marks the data stale.
69ca376 to
def7a37
Compare
setReadString("*")on a record read from BAM was ignored when the record was written back to BAM; it now takes effect.SAMRecord.setReadStringassignedmReadBasesdirectly for"*"rather than callingsetReadBases, soBAMRecord's override, which marks the stored bytes stale and the cached read length invalid, never ran. The record reported its old read length andBAMRecordCodecwrote its original bases.setReadBases(NULL_SEQUENCE).setBaseQualityString("*")too, as is usual, was never affected.Found while reading broadinstitute/picard#2063.
Fixes #1947
Summary by CodeRabbit
*now clears its reported read length and is preserved when the record is written and read back.