Skip to content

Commit

Permalink
docs: add arg to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval committed Jan 8, 2025
1 parent fb6825e commit 5277047
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ class AuxAlignment(ABC, DataclassInstance):
Args:
reference_name: The reference sequence name.
reference_start: The 0-based start position of the alignment.
is_forward: If the alignment is in the forward orientation or not.
cigar: The Cigar sequence representing the alignment.
mapq: The aligner-reported probability of an incorrect mapping, if available.
edit_distance: The number of mismatches between the query and the target, if available.
Expand Down Expand Up @@ -1369,13 +1370,15 @@ def many_sam_from_primary(cls, primary: AlignedSegment) -> Iterator[AlignedSegme
# Finally, set a tag that marks this alignment as a reconstituted auxiliary alignment.
aux.set_tag("rh", True)

yield hit.after_sam_from_primary(aux=aux, primary=primary)
yield hit._after_sam_from_primary(aux=aux, primary=primary)

def after_sam_from_primary(
def _after_sam_from_primary(
self, aux: AlignedSegment, primary: AlignedSegment
) -> AlignedSegment:
"""Post-processes the reconstituted auxiliary alignment specific to this implementation.
Override this function to provide implementation-specific behavior.
Args:
aux: The reconstituted auxiliary alignment.
primary: The primary alignment that reconstituted the auxiliary alignment.
Expand Down Expand Up @@ -1429,6 +1432,7 @@ class SecondaryAlignment(AuxAlignment):
Args:
reference_name: The reference sequence name.
reference_start: The 0-based start position of the alignment.
is_forward: If the alignment is in the forward orientation or not.
cigar: The Cigar sequence representing the alignment.
mapq: The aligner-reported probability of an incorrect mapping, if available.
edit_distance: The number of mismatches between the query and the target, if available.
Expand Down Expand Up @@ -1487,7 +1491,7 @@ def from_tag_item(cls, item: str) -> Self:
)

@override
def after_sam_from_primary(
def _after_sam_from_primary(
self, aux: AlignedSegment, primary: AlignedSegment
) -> AlignedSegment:
"""Post-processes the reconstituted auxiliary alignment as a secondary alignment.
Expand All @@ -1499,7 +1503,7 @@ def after_sam_from_primary(
Raises:
ValueError: If the primary record is a secondary or supplementary alignment.
"""
aux = super().after_sam_from_primary(aux=aux, primary=primary)
aux = super()._after_sam_from_primary(aux=aux, primary=primary)
aux.is_secondary = True
aux.is_supplementary = False
aux.is_proper_pair = False
Expand All @@ -1525,6 +1529,7 @@ class SupplementaryAlignment(AuxAlignment):
Args:
reference_name: The reference sequence name.
reference_start: The 0-based start position of the alignment.
is_forward: If the alignment is in the forward orientation or not.
cigar: The Cigar sequence representing the alignment.
mapq: The aligner-reported probability of an incorrect mapping, if available.
edit_distance: The number of mismatches between the query and the target, if available.
Expand Down Expand Up @@ -1571,7 +1576,7 @@ def from_tag_item(cls, item: str) -> Self:
)

@override
def after_sam_from_primary(
def _after_sam_from_primary(
self, aux: AlignedSegment, primary: AlignedSegment
) -> AlignedSegment:
"""Post-processes the reconstituted auxiliary alignment as a supplementary alignment.
Expand All @@ -1583,7 +1588,7 @@ def after_sam_from_primary(
Raises:
ValueError: If the primary record is a secondary or supplementary alignment.
"""
aux = super().after_sam_from_primary(aux=aux, primary=primary)
aux = super()._after_sam_from_primary(aux=aux, primary=primary)
aux.is_secondary = False
aux.is_supplementary = True
aux.is_proper_pair = primary.is_proper_pair
Expand Down

0 comments on commit 5277047

Please sign in to comment.