Skip to content

Commit

Permalink
Ignore genes with no transcript models
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Shirley committed Oct 20, 2023
1 parent abafc37 commit 4cd66d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pisces/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ def features_to_string(features, fasta_in, masked=True, strand=True):
logging.info("No gene name tag found for %s", gene['gene_id'][0])
gene_name = 'NA'

transcripts = db.children(gene, featuretype='transcript', order_by='start')
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
for transcript in transcripts:
# Write entry in the transcripts to genes table
gene2tx.write("{txp}\t{gene}\n".format(
Expand Down Expand Up @@ -371,10 +373,6 @@ def features_to_string(features, fasta_in, masked=True, strand=True):
length=sum(len(exon) for exon in merged_exons),
frac_masked=str(frac_masked)))

transcripts = db.children(
gene,
featuretype='transcript',
order_by='start')
pbar.update(1)

if options["intergenes"]:
Expand Down

0 comments on commit 4cd66d6

Please sign in to comment.