From 1aeb887aaa1f1250149ed7c16bf91c453a16ed0c Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Tue, 19 Oct 2021 09:50:03 +0200
Subject: [PATCH] ucsc: add wig2_to_bedgraph2

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

diff --git a/src/nf_modules/ucsc/main.nf b/src/nf_modules/ucsc/main.nf
index 6ce54f0d..c3b5ee05 100644
--- a/src/nf_modules/ucsc/main.nf
+++ b/src/nf_modules/ucsc/main.nf
@@ -57,6 +57,29 @@ wigToBedGraph ${wig} ${wig.simpleName}.bg
 """
 }
 
+params.wig2_to_bedgraph2 = ""
+params.wig2_to_bedgraph2_out = ""
+process wig2_to_bedgraph2 {
+  container = "${container_url}"
+  label "big_mem_mono_cpus"
+  tag "${file_id}"
+  if (params.wig2_to_bedgraph2_out != "") {
+    publishDir "results/${params.wig2_to_bedgraph2_out}", mode: 'copy'
+  }
+
+  input:
+  tuple val(file_id), path(wig_a), path(wig_b)
+
+  output:
+  tuple val(file_id), path("${wig_a.simpleName}.wig"), path("${wig_b.simpleName}.wig"), emit: wig
+
+  script:
+"""
+wigToBedGraph ${wig_a} ${wig_a.simpleName}.bg
+wigToBedGraph ${wig_b} ${wig_b.simpleName}.bg
+"""
+}
+
 params.bigwig_to_wig = ""
 params.bigwig_to_wig_out = ""
 process bigwig_to_wig {
-- 
GitLab