From da497e7ae86fa8bcdb2fe30d2021c6569ed49f7e Mon Sep 17 00:00:00 2001 From: clintval Date: Fri, 10 Jan 2025 16:27:22 -0500 Subject: [PATCH] chore: tiny logical improvement --- fgpyo/sam/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fgpyo/sam/__init__.py b/fgpyo/sam/__init__.py index 6df78d4..9948da6 100644 --- a/fgpyo/sam/__init__.py +++ b/fgpyo/sam/__init__.py @@ -1467,10 +1467,10 @@ def many_pysam_from_rec(cls, rec: AlignedSegment) -> Iterator[AlignedSegment]: for hit in cls.many_from_rec(rec): # TODO: When the original record has hard clips we must set the bases and quals to "*". # It would be smarter to pad/clip the sequence to be compatible with new cigar... - if "H" in rec.cigarstring: + if "H" in rec.cigarstring or rec.query_sequence == NO_QUERY_BASES: query_sequence = NO_QUERY_BASES query_qualities = None - elif rec.query_sequence != NO_QUERY_BASES and rec.is_forward and not hit.is_forward: + elif rec.is_forward and not hit.is_forward: query_sequence = reverse_complement(rec.query_sequence) query_qualities = rec.query_qualities[::-1] else: