From 9aa94d395a1b975c8dc139280925b921154479a1 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 14 Oct 2021 16:28:22 +0200
Subject: [PATCH] ucsc: add wig_to_bedgraph

---
 src/nf_modules/ucsc/main.nf | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/nf_modules/ucsc/main.nf b/src/nf_modules/ucsc/main.nf
index fbb166ef..6465cffc 100644
--- a/src/nf_modules/ucsc/main.nf
+++ b/src/nf_modules/ucsc/main.nf
@@ -35,6 +35,27 @@ sort -T ./ -k1,1 -k2,2n ${bg} > \
 """
 }
 
+params.wig_to_bedgraph = ""
+params.wig_to_bedgraph_out = ""
+process bigwig_to_wig {
+  container = "${container_url}"
+  label "big_mem_mono_cpus"
+  tag "${file_id}"
+  if (params.bigwig_to_wig_out != "") {
+    publishDir "results/${params.bigwig_to_wig_out}", mode: 'copy'
+  }
+
+  input:
+  tuple val(file_id) path(wig)
+
+  output:
+  tuple val(file_id), path("*.bg"), emit: wig
+
+  script:
+"""
+wigToBedGraph ${wig} ${wig.simpleName}.bg
+"""
+}
 
 params.bigwig_to_wig = ""
 params.bigwig_to_wig_out = ""
-- 
GitLab