Commit 914ac322 authored by Beatrice Tan's avatar Beatrice Tan
Browse files

Comparison bed files.

parent e56d6386
......@@ -2,6 +2,7 @@ from Reports import ReportTools
import os.path
import datetime
rule report_tools:
"""Report the differences in calls between GISTIC2 and RUBIC."""
input:
......@@ -40,3 +41,23 @@ rule bed_intersect:
workflow.basedir + "/envs/bedtools.yaml"
shell:
"bedtools intersect -a {input.gistic} -b {input.rubic} -wo > {output}"
def get_regions(bed_file):
plot_names = []
with open(bed_file, 'r') as bed:
bed.readline()
for line in bed:
chrom, start = line.split("\t")[0:2]
plot_names.append(chrom + "." + start)
return plot_names
rule compare_regions:
"""Compare locations of known genes, recurrent regions from RUBIC and recurrent regions from GISTIC2."""
input:
overlap="Reports/Overlap_regions.bed"
params:
known=os.path.join(workflow.basedir, config["prev_found_genes"]) if config["prev_found_genes"].startswith("input_files") else config["prev_found_genes"]
output:
plots=expand("Reports/Overlap_plots/{region}.png", region=get_regions(input.overlap))
shell:
"R {workflow.basedir}/scripts/karyoploteR"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment