Skip to content
Snippets Groups Projects
Commit 818dbe3b authored by Sascha Meiers's avatar Sascha Meiers
Browse files

Quick changes to allow plotting of SV calls - new rule for simulated variants

parent 5cd840f2
No related branches found
No related tags found
No related merge requests found
......@@ -168,17 +168,35 @@ rule plot_mosaic_counts:
{params.plot_command} {input.counts} {input.info} {output} > {log} 2>&1
"""
ruleorder: plot_SV_calls_simulated > plot_SV_calls
rule plot_SV_calls:
input:
counts = "counts/{sample}/{windows}.txt.gz",
calls = "sv_calls/{sample}/{windows}.{bpdens}/{method}.txt"
calls = "sv_calls/{sample}/{windows}.{bpdens}/{method}.txt",
segments = "segmentation2/{sample}/{windows}.{bpdens}.txt"
output:
"sv_calls/{sample}/{windows}.{bpdens}/{method}.{chrom}.pdf"
shell:
"""
Rscript utils/chrom.R calls={input.calls} {input.counts} {wildcards.chrom} {output}
Rscript utils/chrom.R segments={input.segments} calls={input.calls} {input.counts} {wildcards.chrom} {output}
"""
rule plot_SV_calls_simulated:
input:
counts = "counts/simulation{seed}-{window}/{window}_fixed.txt.gz",
calls = "sv_calls/simulation{seed}-{window}/{window}_fixed.{bpdens}/{method}.txt",
segments = "segmentation2/simulation{seed}-{window}/{window}_fixed.{bpdens}.txt",
truth = "simulation/variants/genome{seed}-{window}.txt"
output:
"sv_calls/simulation{seed}-{window}/{window}_fixed.{bpdens}/{method}.{chrom}.pdf"
shell:
"""
Rscript utils/chrom.R segments={input.segments} truth={input.truth} calls={input.calls} {input.counts} {wildcards.chrom} {output}
"""
################################################################################
# Read counting #
......
......@@ -43,6 +43,7 @@ manual_colors = c(
simul_inv_dup = "darkgoldenrod2",
idup_h1 = muted("darkgoldenrod2", 80, 70),
idup_h2 = muted("darkgoldenrod2", 80, 70),
complex = "grey",
# background
bg1 = "#ffffff",
bg2 = "khaki2")
......@@ -157,7 +158,10 @@ if (!is.null(f_calls)) {
"end" %in% colnames(svs),
"sample" %in% colnames(svs),
"cell" %in% colnames(svs),
"SV_class" %in% colnames(svs)) %>% invisible
("SV_class" %in% colnames(svs) | "sv_call_name" %in% colnames(svs) )) %>% invisible
if(!("SV_class" %in% colnames(svs))) {
svs[, SV_class := sv_call_name]
}
assert_that(all(svs$SV_class %in% names(manual_colors))) %>% invisible
svs[, sample_cell := paste(sample, "-", cell)]
assert_that(all(unique(svs$sample_cell) %in% unique(counts$sample_cell))) %>% invisible
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment