From b353a935c5fff7d3b9b8f1e1e70460d14e9f2c54 Mon Sep 17 00:00:00 2001 From: Matt Shirley Date: Thu, 2 Nov 2023 13:26:22 -0400 Subject: [PATCH] Move transcript_id check to inner loop --- pisces/index.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pisces/index.py b/pisces/index.py index 71c0ce2..fb0346b 100755 --- a/pisces/index.py +++ b/pisces/index.py @@ -339,11 +339,11 @@ def features_to_string(features, fasta_in, masked=True, strand=True): transcripts = tuple(db.children(gene, featuretype='transcript', order_by='start')) if len(transcripts) == 0: # gene that has no transcripts continue # gene will have no transcript sequence or exons - try: - transcript['transcript_id'] - except KeyError: - continue # transcript id is missing (ex TRNAV-CAC gene in RefSeq) for transcript in transcripts: + try: + transcript['transcript_id'] + except KeyError: + continue # transcript id is missing (ex TRNAV-CAC gene in RefSeq) # Write entry in the transcripts to genes table gene2tx.write("{txp}\t{gene}\n".format( gene=gene['gene_id'][0],