Skip to content

Commit

Permalink
Merge pull request #373 from genomic-medicine-sweden/Smeds-patch-5
Browse files Browse the repository at this point in the history
fix: support header with fusions filtering
  • Loading branch information
jonca79 authored Nov 24, 2023
2 parents 4b2718c + 3efdb15 commit f940638
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions workflow/scripts/report_fusions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@
housekeeping_genes = {}
artefact_gene_dict = {}
if fp_fusions_filename != "":
fp_fusions = open(fp_fusions_filename)
for line in fp_fusions:
columns = line.strip().split("\t")
gene1 = columns[0]
gene2 = columns[1]
read_limit_SF = int(columns[2])
read_limit_FC = int(columns[3])
if gene2 == "housekeeping":
housekeeping_genes[gene1] = [read_limit_SF, read_limit_FC]
if gene1 not in artefact_gene_dict:
artefact_gene_dict[gene1] = {}
artefact_gene_dict[gene1][gene2] = [read_limit_SF, read_limit_FC]
with open(fp_fusions_filename) as fp_fusions:
for line in fp_fusions:
if line.startswith("#"):
continue
columns = line.strip().split("\t")
gene1 = columns[0]
gene2 = columns[1]
read_limit_SF = int(columns[2])
read_limit_FC = int(columns[3])
if gene2 == "housekeeping":
housekeeping_genes[gene1] = [read_limit_SF, read_limit_FC]
if gene1 not in artefact_gene_dict:
artefact_gene_dict[gene1] = {}
artefact_gene_dict[gene1][gene2] = [read_limit_SF, read_limit_FC]

output_fusions.write("caller\tgene1\tgene2\texon1\texon2\tconfidence\tFC-callers\tpredicted_effect\tbreakpoint1\tbreakpoint2\t")
output_fusions.write("coverage1\tcoverage2\tsplit_reads\tspanning_pairs\ttotal_supporting_reads\n")
Expand Down

0 comments on commit f940638

Please sign in to comment.