diff --git a/fgpyo/sam/__init__.py b/fgpyo/sam/__init__.py index 73a946c7..218f9f13 100644 --- a/fgpyo/sam/__init__.py +++ b/fgpyo/sam/__init__.py @@ -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. diff --git a/tests/fgpyo/sam/test_cigar.py b/tests/fgpyo/sam/test_cigar.py index 2515b5c6..9c08bbed 100644 --- a/tests/fgpyo/sam/test_cigar.py +++ b/tests/fgpyo/sam/test_cigar.py @@ -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( @@ -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