Skip to content

Commit

Permalink
docs: swap some stale secondasry -> aux references
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval committed Jan 7, 2025
1 parent ac49ba6 commit fb6825e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ def many_from_primary(cls, primary: AlignedSegment) -> list[Self]:
"""
if primary.is_secondary or primary.is_supplementary:
raise ValueError(

Check warning on line 1271 in fgpyo/sam/__init__.py

View check run for this annotation

Codecov / codecov/patch

fgpyo/sam/__init__.py#L1271

Added line #L1271 was not covered by tests
"Cannot derive auxiliary alignments from a non-primary record!"
"Cannot build auxiliary alignments from a non-primary record!"
f" Found: {primary.query_name}"
)
aux_alignments: list[Self] = []
Expand Down Expand Up @@ -1350,7 +1350,7 @@ def many_sam_from_primary(cls, primary: AlignedSegment) -> Iterator[AlignedSegme
aux.is_read1 = primary.is_read1
aux.is_read2 = primary.is_read2

# Set some optional, but highly recommended, SAM tags on the secondary alignment.
# Set some optional, but highly recommended, SAM tags on the auxiliary alignment.
aux.set_tag("AS", hit.alignment_score)
aux.set_tag("NM", hit.edit_distance)
aux.set_tag("RG", primary.get_tag("RG") if primary.has_tag("RG") else None)
Expand Down Expand Up @@ -1393,9 +1393,9 @@ def after_sam_from_primary(
@classmethod
def add_to_template(cls, template: Template) -> Template:
"""Rebuild a template by adding auxiliary alignments from the primary alignment tags."""
r1_secondaries = iter([]) if template.r1 is None else cls.many_sam_from_primary(template.r1)
r2_secondaries = iter([]) if template.r2 is None else cls.many_sam_from_primary(template.r2)
return Template.build(chain(template.all_recs(), r1_secondaries, r2_secondaries))
r1_aux = iter([]) if template.r1 is None else cls.many_sam_from_primary(template.r1)
r2_aux = iter([]) if template.r2 is None else cls.many_sam_from_primary(template.r2)
return Template.build(chain(template.all_recs(), r1_aux, r2_aux))


@dataclass(frozen=True)
Expand Down

0 comments on commit fb6825e

Please sign in to comment.