Skip to content

Commit

Permalink
whoops, fix dropping on ref instead of alt... also handle ref more el…
Browse files Browse the repository at this point in the history
…egantly
  • Loading branch information
lrauschning committed May 31, 2024
1 parent a72ed69 commit d6457b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion msyd/pyxfiles/coords.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,15 @@ class Pansyn:
Returns a new `Pansyn` object with `start`/`end` positions from the start/end of this pansyntenic region removed counting on `org`, respecting cigar alignments if not `None`.
If this `Pansyn` has no cigar object, it will be identical to a drop on the reference (as the genomes are assumed to align perfectly).
"""
# in case its called with the ref org already, directly drop
# this fn shouldn't usually be called like this, but handle anyway
if org == self.ref.org:
return self.drop(start, end)

assert(org in self.ranges_dict)
# get no of bases corresponding to this drop on the reference
if self.cigars_dict:
start, end = self.cigars_dict[org].trim(start, end, only_pos=True)
start, end = self.cigars_dict[org].trim(start, end, only_pos=True, ref=False)

return self.drop(start, end)

Expand Down

0 comments on commit d6457b8

Please sign in to comment.