From 56e577730fea4cf0636cfa842bd60302953d5798 Mon Sep 17 00:00:00 2001
From: Tobias Marschall <tobias.marschall@0ohm.net>
Date: Fri, 12 Oct 2018 14:16:42 +0200
Subject: [PATCH] Update summary_statistics to use --merged-file option

---
 Snakefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Snakefile b/Snakefile
index 325e316..8b6e3d6 100644
--- a/Snakefile
+++ b/Snakefile
@@ -1046,12 +1046,13 @@ rule summary_statistics:
     input:
         segmentation = 'segmentation2/{sample}/{windows}.{bpdens}.txt',
         strandstates = 'strand_states/{sample}/{windows}.{bpdens}/intitial_strand_state',
-        sv_calls = 'sv_calls/{sample}/{windows}.{bpdens}/{method}.txt',
-        complex = "sv_calls/{sample}/{windows}.{bpdens}/{method}.complex.tsv",
+        sv_calls = 'sv_calls/{sample}/{windows}.{bpdens}/{method}_filter{filter}.txt',
+        complex = "sv_calls/{sample}/{windows}.{bpdens}/{method}_filter{filter}.complex.tsv",
+        merged = "postprocessing/merge/{sample}/{windows}.{bpdens}/{method}.txt",
     output:
-        tsv = 'stats/{sample}/{windows}.{bpdens,selected_j[0-9\\.]+_s[0-9\\.]+_scedist[0-9\\.]+}/{method}.tsv',
+        tsv = 'stats/{sample}/{windows}.{bpdens,selected_j[0-9\\.]+_s[0-9\\.]+_scedist[0-9\\.]+}/{method}_filter{filter,(TRUE|FALSE)}.tsv',
     log:
-        'log/summary_statistics/{sample}/{windows}.{bpdens}/{method}.log'
+        'log/summary_statistics/{sample}/{windows}.{bpdens}/{method}_filter{filter}.log'
     run:
         p = []
         try:
@@ -1068,6 +1069,9 @@ rule summary_statistics:
                 p.append(f)
         except KeyError:
             pass
+        if wildcards.filter == 'TRUE':
+            p.append('--merged-file')
+            p.append(input.merged)
         additional_params = ' '.join(p)
         shell('utils/callset_summary_stats.py --segmentation {input.segmentation} --strandstates {input.strandstates} --complex-regions {input.complex} {additional_params} {input.sv_calls}  > {output.tsv} 2> {log}')
 
-- 
GitLab