Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
I noticed that PileupRead.query_position differs from PileupColumn.get_query_positions() :
ThePileupRead.query_position returns None if the PileupRead has set is_del or is_refskip. However, the PileupColumn.get_query_positions() for is_refskipcase apparently returns the next matched position.
I find this difference kinda unexpected , resp. it's the behavior of get_query_positions() that is highly unintuitive for me. I believe that the get_query_positions() behaves the same way as the underlying htslib library, and returning None in PileupRead.query_position is feature added by pysam? Would it maybe be useful to more explicitly describe the behavior of get_query_positions() in the documentation? (I somehow assumed that the positions are the same as if I would be calling PileupRead.query_position on every PileupRead in PileupColumn.pileups, which is not the case.)
I noticed that
PileupRead.query_position
differs fromPileupColumn.get_query_positions()
: ThePileupRead.query_position
returnsNone
if thePileupRead
has setis_del
oris_refskip
. However, thePileupColumn.get_query_positions()
foris_refskip
case apparently returns the next matched position.I find this difference kinda unexpected , resp. it's the behavior of
get_query_positions()
that is highly unintuitive for me. I believe that theget_query_positions()
behaves the same way as the underlying htslib library, and returning None inPileupRead.query_position
is feature added by pysam? Would it maybe be useful to more explicitly describe the behavior ofget_query_positions()
in the documentation? (I somehow assumed that the positions are the same as if I would be callingPileupRead.query_position
on everyPileupRead
inPileupColumn.pileups
, which is not the case.)