Skip to content

Commit

Permalink
Move transcript_id check to inner loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 authored Nov 2, 2023
1 parent d21e63f commit b353a93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pisces/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit b353a93

Please sign in to comment.