Skip to content

Commit

Permalink
fix the bug of wrong gene/transcript picking
Browse files Browse the repository at this point in the history
  • Loading branch information
ZKai0801 authored Jun 28, 2020
1 parent ce63cee commit ac29e35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/make_fusion_genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def make_fusion_gene(gene, fw, refflat):
transcripts = {}
with open(refflat, "r") as fh:
for line in fh:
if gene[0] not in line:
cur_gene, transcript, chrom, strand, start, end, _, _, _, exonstart, exonend = line.rstrip("\n").split("\t")
if gene[0] != cur_gene:
continue
_, transcript, chrom, strand, start, end, _, _, _, exonstart, exonend = line.rstrip("\n").split("\t")
transcripts[transcript] = (chrom, start, end, exonstart, exonend)
transcript = get_longest_transcript(transcripts.keys(), refflat)
chrom, start, end, exonstart, exonend = transcripts[transcript]
Expand All @@ -39,9 +39,9 @@ def make_fusion_gene(gene, fw, refflat):
elif len(gene) == 2:
with open(refflat, "r") as fh:
for line in fh:
if gene[1] not in line:
continue
_, transcript, chrom, strand, start, end, _, _, _, exonstart, exonend = line.rstrip("\n").split("\t")
if gene[1] != transcript:
continue
break

# write to a file
Expand Down

0 comments on commit ac29e35

Please sign in to comment.