From 759a77c9cc1155d40bcfff89cd508f171944ea7e Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 7 Oct 2021 15:04:48 +0200
Subject: [PATCH] bioconvert: add main.nf

---
 src/nf_modules/bioconvert/main.nf | 46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 src/nf_modules/bioconvert/main.nf

diff --git a/src/nf_modules/bioconvert/main.nf b/src/nf_modules/bioconvert/main.nf
new file mode 100644
index 00000000..92925351
--- /dev/null
+++ b/src/nf_modules/bioconvert/main.nf
@@ -0,0 +1,46 @@
+version = "0.4.3"
+container_url = "lbmc/bioconvert:${version}"
+params.bigwig_to_wig = ""
+params.bigwig_to_wig_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(bw)
+
+  output:
+  tuple val(file_id), path("*.wig"), emit: wig
+
+  script:
+"""
+bioconvert bigwig2wiggle ${bw} ${bw.simpleName}.wig
+"""
+}
+
+params.bigwig2_to_wig2 = ""
+params.bigwig2_to_wig2_out = ""
+process bigwig2_to_wig2 {
+  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(bw_a), path(bw_b)
+
+  output:
+  tuple val(file_id), path("${bw_a.simpleName}.wig"), path("${bw_b.simpleName}.wig"), emit: wig
+
+  script:
+"""
+bioconvert bigwig2wiggle ${bw_a} ${bw_a.simpleName}.wig
+bioconvert bigwig2wiggle ${bw_b} ${bw_b.simpleName}.wig
+"""
+}
\ No newline at end of file
-- 
GitLab