From 891b78fc1465a6ec3d4a26d125d91b02484e2dcb Mon Sep 17 00:00:00 2001 From: clintval Date: Tue, 24 Dec 2024 14:19:48 -0500 Subject: [PATCH] feat: add SAM helpers for isize, set_mate_info, properly_paired --- fgpyo/sam/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fgpyo/sam/__init__.py b/fgpyo/sam/__init__.py index e271924..f741804 100644 --- a/fgpyo/sam/__init__.py +++ b/fgpyo/sam/__init__.py @@ -177,6 +177,7 @@ from pysam import AlignedSegment from pysam import AlignmentFile as SamFile from pysam import AlignmentHeader as SamHeader +from typing_extensions import Self from typing_extensions import deprecated import fgpyo.io @@ -622,7 +623,7 @@ class PairOrientation(enum.Enum): """A pair orientation for tandem (forward-forward or reverse-reverse) pairs.""" @classmethod - def build(cls, r1: AlignedSegment, r2: AlignedSegment) -> Self | None: + def build(cls, r1: AlignedSegment, r2: AlignedSegment) -> Optional[Self]: """Returns the orientation of the read pair if both reads are mapped.""" if r1.is_unmapped or r2.is_unmapped: return None