Skip to content

Commit

Permalink
doc: update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
msto committed Jan 31, 2024
1 parent e64409f commit f172954
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,16 @@ def parse_sa_tag(tag: str) -> List["SupplementaryAlignment"]:

@classmethod
def from_read(cls, read: pysam.AlignedSegment) -> List["SupplementaryAlignment"]:
"""Returns a list of SupplementaryAlignments for a given pysam.AlignedSegment."""
"""
Construct a list of SupplementaryAlignments from the SA tag in a pysam.AlignedSegment.
Args:
read: An alignment. The presence of the "SA" tag is not required.
Returns:
A list of all SupplementaryAlignments present in the SA tag.
If the SA tag is not present, or it is empty, an empty list will be returned.
"""
if read.has_tag("SA"):
sa_tag: str = cast(str, read.get_tag("SA"))
return cls.parse_sa_tag(sa_tag)
Expand Down

0 comments on commit f172954

Please sign in to comment.