oicr-gsi/debarcer

Inconsistent used of 1-based and 0-based coordinates

rjovelin opened this issue · 2 comments

Here region_start is adjusted to pass 0-based half-open coordinates to pysam.
This is inconsistent with functions in umi_error_correct.py and get_consensus_seq.py which take 1-based inclusive start and end positions. This results in mixed coordinates used in generate_consensus.py.

ref_seq = reader.fetch(contig, region_start-1, region_end).upper()

pysam uses 0-based half opened coordinates so any functions that calls methods fetch and pileup should pass 0-based start and end positions and need to be adjusted accordingly.

region coordinates passed to functions in debarcer.py are 1-based inclusive and are converted to 0-based half opened coordinates to be passed to functions in other modules that use pysam