Skip to content

Commit

Permalink
Skip transcripts with missing transcript_id tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 authored Nov 2, 2023
1 parent 4cd66d6 commit d21e63f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pisces/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d21e63f

Please sign in to comment.