From 8b508da10ab0ed02a6dc9b6f46ffd6a3ed181768 Mon Sep 17 00:00:00 2001
From: Tobias Marschall <tobias.marschall@0ohm.net>
Date: Fri, 5 Oct 2018 08:29:28 +0200
Subject: [PATCH] Additionally run postprocessing separately (creating a
 directory "postprocessing")

---
 Snakefile | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Snakefile b/Snakefile
index 0f8089b..8fb7465 100644
--- a/Snakefile
+++ b/Snakefile
@@ -105,6 +105,11 @@ rule all:
                window = [100000],
                suffix = ["fixed", "fixed_norm"]),
         expand("stats-merged/{sample}/stats.tsv", sample = SAMPLES),
+        expand("postprocessing/merge/{sample}/{window}_fixed_norm.{bpdens}/{method}.txt",
+               sample = SAMPLES,
+               window = [100000],
+               bpdens = BPDENS,
+               method = list(set(m.replace('_filterTRUE','').replace('_filterFALSE','') for m in METHODS))),
 
 
 ################################################################################
@@ -628,6 +633,23 @@ rule call_complex_regions:
         "utils/call-complex-regions.py --merge_distance 5000000 --ignore_haplotypes --min_cell_count 2 {input.calls} > {output.complex} 2>{log}"
 
 
+rule postprocessing_filter:
+    input: 
+        calls = "sv_calls/{sample}/{window}_fixed_norm.{bpdens}/simpleCalls_llr{llr}_poppriors{pop_priors}_haplotags{use_haplotags}_gtcutoff{gtcutoff}_regfactor{regfactor}_filterFALSE.txt"
+    output: 
+        calls = "postprocessing/filter/{sample}/{window}_fixed_norm.{bpdens,selected_j[0-9\\.]+_s[0-9\\.]+}/simpleCalls_llr{llr}_poppriors{pop_priors,(TRUE|FALSE)}_haplotags{use_haplotags,(TRUE|FALSE)}_gtcutoff{gtcutoff,[0-9\\.]+}_regfactor{regfactor,[0-9]+}.txt"
+    shell:
+        'utils/filter_MosaiCatcher_calls.pl {input.calls}  > {output.calls}'
+
+rule postprocessing_merge:
+    input: 
+        calls = "postprocessing/filter/{sample}/{window}_fixed_norm.{bpdens,selected_j[0-9\\.]+_s[0-9\\.]+}/simpleCalls_llr{llr}_poppriors{pop_priors,(TRUE|FALSE)}_haplotags{use_haplotags,(TRUE|FALSE)}_gtcutoff{gtcutoff,[0-9\\.]+}_regfactor{regfactor,[0-9]+}.txt"
+    output: 
+        calls = "postprocessing/merge/{sample}/{window}_fixed_norm.{bpdens,selected_j[0-9\\.]+_s[0-9\\.]+}/simpleCalls_llr{llr}_poppriors{pop_priors,(TRUE|FALSE)}_haplotags{use_haplotags,(TRUE|FALSE)}_gtcutoff{gtcutoff,[0-9\\.]+}_regfactor{regfactor,[0-9]+}.txt"
+    shell:
+        'utils/group_nearby_calls_of_same_AF.pl {input.calls}  > {output.calls}'
+
+
 ################################################################################
 # Strand states & phasing                                                      #
 ################################################################################
-- 
GitLab