Skip to content
Snippets Groups Projects
Commit 50f66f88 authored by Tobias Marschall's avatar Tobias Marschall
Browse files

Attempt fixing heatmap script, but does not yet work

parent abd33fad
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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()
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