walaj / SeqLib

C++ htslib/bwa-mem/fermi interface for interrogating sequence data
http://bioinformatics.oxfordjournals.org/content/early/2016/12/21/bioinformatics.btw741.full.pdf+html
Other
133 stars 36 forks source link

Add LastFlag() to BamRecord #65

Closed nathanweeks closed 1 year ago

nathanweeks commented 3 years ago

Currently, BamRecord objects have a FirstRead() method that returns true if the 0x40 bit of the FLAG field is set. This PR proposes adding a corresponding LastRead() method that returns true if the 0x80 bit is set.

Per the SAM spec:

Bits 0x40 and 0x80 reflect the read ordering within each template inherent in the sequencing technology used.13 If 0x40 and 0x80 are both set, the read is part of a linear template, but it is neither the first nor the last read. If both 0x40 and 0x80 are unset, the index of the read in the template is unknown. This may happen for a non-linear template or when this information is lost during data processing.