diff --git a/Snakefile b/Snakefile index 99484d73afb747222de82ad557cd8ebaaf198c1c..d41cfeb8c69c5db5b75d6db7674241d318145c63 100644 --- a/Snakefile +++ b/Snakefile @@ -48,7 +48,7 @@ rule simul: sample = ["simulation7","simulation8","simulation9"], window = [50000, 100000]), expand("evaluation/simulation{seed}_{window}.{segments}.pdf", - seed = [7,8,9], + seed = list(range(5)), window = [50000, 100000], segments = ["few","medium","many"]) @@ -376,14 +376,14 @@ rule run_sv_classification: utils/R-packages2/ > {log} 2>&1 """ -rule convert_SVprob_output: +rule plot_heatmap: input: haplotypeProbs = "sv_probabilities/{sample}/{windows}.{bpdens}/allSegCellProbs.table", genotypeProbs = "sv_probabilities/{sample}/{windows}.{bpdens}/allSegCellGTprobs.table", info = "counts/{sample}/{windows}.info", bamNames = "sv_probabilities/{sample}/{windows}.{bpdens}/bamNames.txt" output: - "sv_probabilities/{sample}/{windows}.{bpdens}/final_plots/" + "sv_probabilities/{sample}/{windows}.{bpdens}/final_plots/heatmapPlots.pdf" log: "log/{sample}/final.plots.{windows}.{bpdens}.txt" script: diff --git a/utils/plot_heatmap.R b/utils/plot_heatmap.R index a967a3096acd365ef0b63ad3446672edddfdd974..e923d4b4cf7beab723913fdc702d445ecb78ca07 100644 --- a/utils/plot_heatmap.R +++ b/utils/plot_heatmap.R @@ -163,13 +163,12 @@ plotHeatmapSegment <- function(dataFrame, plot.log=FALSE, file=NULL, aggProbs=F, GTprobsFile = snakemake@input[["genotypeProbs"]] -directory = snakemake@input[[1]] GTprobs <- read.table(GTprobsFile, stringsAsFactors = F, header = T ) ID <- apply(GTprobs[,c('chr','start','end')], 1, function(x) paste(x, collapse = "_")) GTprobs.l <- split(GTprobs, paste(GTprobs$chr, GTprobs$start, GTprobs$end)) -pdf(paste0(directory, "heatmapPlots.pdf")) +pdf(snakemake@output[[1]]) lapply(GTprobs.l, plot) dev.off()