From 42e06407ef76155cf51d1dadac96f8e375a8e274 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Mon, 18 Oct 2021 16:07:55 +0200
Subject: [PATCH] ucsc: add wig2bedgraph process

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

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