From d21e63f59e3c8055b1f6e89df07cd7ac4cf73f74 Mon Sep 17 00:00:00 2001 From: Matt Shirley Date: Thu, 2 Nov 2023 13:21:32 -0400 Subject: [PATCH] Skip transcripts with missing transcript_id tags --- pisces/index.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pisces/index.py b/pisces/index.py index 69a5cf3..71c0ce2 100755 --- a/pisces/index.py +++ b/pisces/index.py @@ -339,6 +339,10 @@ 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: # Write entry in the transcripts to genes table gene2tx.write("{txp}\t{gene}\n".format(