Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
yfarjoun committed Sep 19, 2024
1 parent b07c3e4 commit c334b43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def length_on_target(self) -> int:
"""Returns the length of the alignment on the target sequence."""
return sum([elem.length_on_target for elem in self.elements])

def get_query_alignment_offsets(self, reverse: bool = False) -> Optional[range]:
def query_alignment_offsets(self, reverse: bool = False) -> Optional[range]:
"""Gets the 0-based, end-exclusive positions of the first and last aligned base in the query.
The resulting range will contain the range of positions in the SEQ string for the bases
that are aligned. If no bases are aligned, the return value will be None.
Expand Down
4 changes: 2 additions & 2 deletions tests/fgpyo/sam/test_cigar.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_bad_index_raises_type_error(index: int) -> None:
)
def test_get_alignments(cigar_string: str, maybe_range: Optional[range]) -> None:
cig = Cigar.from_cigarstring(cigar_string)
assert Cigar.get_query_alignment_offsets(cig, reverse=False) == maybe_range
assert Cigar.query_alignment_offsets(cig, reverse=False) == maybe_range


@pytest.mark.parametrize(
Expand All @@ -84,4 +84,4 @@ def test_get_alignments(cigar_string: str, maybe_range: Optional[range]) -> None
)
def test_get_alignments_reversed(cigar_string: str, maybe_range: Optional[range]) -> None:
cig = Cigar.from_cigarstring(cigar_string)
assert Cigar.get_query_alignment_offsets(cig, reverse=True) == maybe_range
assert Cigar.query_alignment_offsets(cig, reverse=True) == maybe_range

0 comments on commit c334b43

Please sign in to comment.