From 9ec0803c801a76e766d5020e74f9c0caec548482 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 18 Feb 2021 13:38:45 +0100
Subject: [PATCH] bedtools: add merge_bed process

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

diff --git a/src/nf_modules/bedtools/main.nf b/src/nf_modules/bedtools/main.nf
index 616435bc..50a848e7 100644
--- a/src/nf_modules/bedtools/main.nf
+++ b/src/nf_modules/bedtools/main.nf
@@ -20,6 +20,23 @@ bedtools getfasta -name \
 """
 }
 
+process merge_bed {
+  container = "${container_url}"
+  label "big_mem_mono_cpus"
+  tag "${bed.baseName}"
+
+  input:
+  path bed
+
+  output:
+  tuple val(bed[0].simpleName), path("*_merged.fasta"), emit: bed
+
+  script:
+"""
+bedtools merge -i ${bed} > ${bed[0].simpleName}_merged.bed
+"""
+}
+
 process bam_to_fastq_singleend {
   container = "${container_url}"
   label "big_mem_mono_cpus"
-- 
GitLab