From 34b3732319f7d74c72f93ff1bcb05ccc675585f8 Mon Sep 17 00:00:00 2001
From: imoustakas <i.moustakas@lumc.nl>
Date: Wed, 25 Jan 2023 16:47:10 +0100
Subject: [PATCH] Add a number of macs2 flags so we can adhere to Encode

---
 macs2.wdl | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/macs2.wdl b/macs2.wdl
index e6a011a..53be0ab 100644
--- a/macs2.wdl
+++ b/macs2.wdl
@@ -30,8 +30,15 @@ task PeakCalling {
         String sampleName
         String format = "AUTO"
         Boolean nomodel = false
+        String gensz = "hs"
+        Int extsize
+        Int shiftsize = -1*round(extsize/2)
+        Float pval_thres = 0.01
+        Boolean bdg = true
+        String keepdup = "auto"
+        String callsummits = true
         Int timeMinutes = 600  # Default to 10 hours
-        String memory = "8GiB"
+        String memory = "8G"
         String dockerImage = "quay.io/biocontainers/macs2:2.1.2--py27r351_0"
     }
 
@@ -43,7 +50,14 @@ task PeakCalling {
         --outdir ~{outDir} \
         --name ~{sampleName} \
         -f ~{format} \
-        ~{true='--nomodel' false='' nomodel}
+        -g ~{gensz} \
+        -p ~{pval_thres} \
+        --shift ~{shiftsize} \
+        --extsize ~{extsize} \
+        ~{true='--nomodel' false='' nomodel} \
+        ~{true='-B' false='' bdg} \
+        --keep-dup ~{keepdup} \
+        ~{true='--call-summits' false='' callsummits}
     }
 
     output {
@@ -64,6 +78,13 @@ task PeakCalling {
         sampleName: {description: "Name of the sample to be analysed", category: "required"}
         outDir: {description: "All output files will be written in this directory.", category: "advanced"}
         nomodel: {description: "Whether or not to build the shifting model.", category: "advanced"}
+        gensz: {description: "macs2 argument for setting the mappable genome size or effective genome size which is defined as the genome size which can be sequenced."}
+        pval_thres: {description: "macs2 argument for setting the p-value cutoff. If -p is specified, MACS2 will use p-value instead of q-value."}
+        shiftsize: {description: "macs2 argument to set an arbitrary shift in bp. Can be negative to indicate direction"}
+        extsize: {description: "macs2 argument to extend reads in 5'->3' direction to fix-sized fragments."}
+        bdg: {description: "macs2 argument that ebanbles the storage of the fragment pileup, control lambda in bedGraph files."}
+        keepdup: {description: "macs2 argument that controls the behavior towards duplicate tags at the exact same location."}
+        callsummits: {description: "macs2 argument to reanalyze the shape of signal profile to deconvolve subpeaks within each peak called from the general procedure."}
         memory: {description: "The amount of memory this job will use.", category: "advanced"}
         timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
         dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
-- 
GitLab