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

Fix for prev. commit

parent 75da0fbe
No related branches found
No related tags found
No related merge requests found
......@@ -178,10 +178,14 @@ rule convert_strandphaser_input:
"utils/helper.convert_strandphaser_input.R"
# Dummy rule - this will be replaced by strand-phaser
### Dummy rule - this will be replaced by strand-phaser
rule run_strandphaser:
input:
"phased_haps.txt"
output:
"strand_states/" + config["sample"] + ".strandphaser_output.txt"
shell:
"cp {input} {output}"
rule convert_strandphaser_output:
input:
......
library(data.table);
library(assertthat)
d = fread(snakemake@input[["phased_states"]])
e = fread(snakemake@input[["info"]])
g = fread(snakemake@intput[["initial_states"]])
e = fread(snakemake@input[["phased_states"]])
d = fread(snakemake@input[["info"]])
g = fread(snakemake@input[["initial_states"]])
d$bam = basename(d$bam);
......@@ -14,10 +14,11 @@ f = merge(d, e, by = "bam")[, .(chrom,start,end,sample,cell,class)]
# Note that there is still a bug in Venla's strand state detection.
g = merge(g,f, by = c("chrom","start","end","sample","cell"), all.x = T)
# Overwrite with David's phased strand state if available!
g = g[, class := ifelse(!is.na(class.y), class.y, class.x)][]
g$class.x = NULL
g$class.y = NULL
g = g[, .(chrom, start, end, sample, cell, class)]
write.table(g, file=snakemake@output[[1]], quote=F, row.names=F, col.names=F, sep="\t")
\ No newline at end of file
write.table(g, file=snakemake@output[[1]], quote=F, row.names=F, col.names=T, sep="\t")
\ No newline at end of file
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