Skip to content

Commit

Permalink
fixing that no overlap is searched if seq & strand are empty for stri…
Browse files Browse the repository at this point in the history
…ngtie
  • Loading branch information
KatharinaHoff committed Oct 2, 2023
1 parent 88d15f5 commit 8904c4a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/stringtie2utr.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,12 @@ def find_overlapping_transcripts(gene_tree, transcript_tree):
for strand, gene_tree in strand_data.items():
# loop over the genes in the gene_tree:
for gene_interval in gene_tree:
overlapping_transcripts = transcript_tree[seq_name][strand].overlap(gene_interval.begin, gene_interval.end)
if overlapping_transcripts:
gene_id = gene_interval.data
gene_to_transcripts[gene_id] = [tx.data for tx in overlapping_transcripts]
if seq_name in transcript_tree:
if strand in transcript_tree[seq_name]:
overlapping_transcripts = transcript_tree[seq_name][strand].overlap(gene_interval.begin, gene_interval.end)
if overlapping_transcripts:
gene_id = gene_interval.data
gene_to_transcripts[gene_id] = [tx.data for tx in overlapping_transcripts]

return gene_to_transcripts

Expand Down

0 comments on commit 8904c4a

Please sign in to comment.