Skip to content

Commit

Permalink
Add q_en and r_en to CigarHit
Browse files Browse the repository at this point in the history
This will make it more compatible with `mappy`'s `Alignment` class
  • Loading branch information
Donaim committed Oct 21, 2024
1 parent 848086f commit ae050e9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/aligntools/cigar_hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,21 @@ def __post_init__(self):
f" query positions,"
f" but CIGAR hit range is {self.query_length}.")

@property
def r_en(self):
return self.r_ei + 1

@property
def q_en(self):
return self.q_ei + 1

@property
def ref_length(self):
return self.r_ei + 1 - self.r_st
return self.r_en - self.r_st

@property
def query_length(self):
return self.q_ei + 1 - self.q_st
return self.q_en - self.q_st

@staticmethod
def from_default_alignment(r_st: int, r_ei: int, q_st: int, q_ei: int) \
Expand Down

0 comments on commit ae050e9

Please sign in to comment.