From 708cee9caed2542e7178653844ca18a24ec53f43 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 14 Jul 2020 16:17:23 +0200 Subject: [PATCH] Module bedtools-intersectbed added --- software/bedtools/intersectbed/Dockerfile | 7 +++++ .../bedtools/intersectbed/environment.yml | 9 ++++++ software/bedtools/intersectbed/main.nf | 19 ++++++++++++ software/bedtools/intersectbed/meta.yml | 30 +++++++++++++++++++ .../intersectbed/test/input_data/A.bed | 5 ++++ .../intersectbed/test/input_data/B.bed | 1 + software/bedtools/intersectbed/test/main.nf | 18 +++++++++++ .../intersectbed/test/nextflow.config | 2 ++ 8 files changed, 91 insertions(+) create mode 100644 software/bedtools/intersectbed/Dockerfile create mode 100644 software/bedtools/intersectbed/environment.yml create mode 100644 software/bedtools/intersectbed/main.nf create mode 100644 software/bedtools/intersectbed/meta.yml create mode 100644 software/bedtools/intersectbed/test/input_data/A.bed create mode 100644 software/bedtools/intersectbed/test/input_data/B.bed create mode 100644 software/bedtools/intersectbed/test/main.nf create mode 100644 software/bedtools/intersectbed/test/nextflow.config diff --git a/software/bedtools/intersectbed/Dockerfile b/software/bedtools/intersectbed/Dockerfile new file mode 100644 index 00000000..94ce0c08 --- /dev/null +++ b/software/bedtools/intersectbed/Dockerfile @@ -0,0 +1,7 @@ +FROM nfcore/base +LABEL authors="Jose Espinosa-Carrasco" \ + description="Docker image containing all requirements for nf-core/modules/bedtools/intersect" + +COPY environment.yml / +RUN conda env create -f /environment.yml && conda clean -a +ENV PATH /opt/conda/envs/nf-core-bedtools-intersectbed/bin:$PATH diff --git a/software/bedtools/intersectbed/environment.yml b/software/bedtools/intersectbed/environment.yml new file mode 100644 index 00000000..eb0a4040 --- /dev/null +++ b/software/bedtools/intersectbed/environment.yml @@ -0,0 +1,9 @@ +# You can use this file to create a conda environment for this pipeline: +# conda env create -f environment.yml +name: nf-core-bedtools-intersectbed +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bedtools=2.29.2 diff --git a/software/bedtools/intersectbed/main.nf b/software/bedtools/intersectbed/main.nf new file mode 100644 index 00000000..a5d3a944 --- /dev/null +++ b/software/bedtools/intersectbed/main.nf @@ -0,0 +1,19 @@ +process INTERSECT_BED { + tag "$input_file_1-$input_file_2" + + container 'quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0' + + input: + path (input_file_1) + path (input_file_2) + val (intersectbed_args) + + output: + stdout() + + script: + """ + bedtools intersect -a ${input_file_1} -b ${input_file_2} ${intersectbed_args} + """ +} + diff --git a/software/bedtools/intersectbed/meta.yml b/software/bedtools/intersectbed/meta.yml new file mode 100644 index 00000000..374fd3e7 --- /dev/null +++ b/software/bedtools/intersectbed/meta.yml @@ -0,0 +1,30 @@ +name: bedtools intersect +description: Returns the overlapping features between two sets of genomics features +keywords: + - intersect,bed,bedtools +tools: + - bedtools: + description: | + Bedtools is a software package that provides with a toolset to perform genome arithmetic operations. + homepage: https://bedtools.readthedocs.io/en/latest/index.html + documentation: https://bedtools.readthedocs.io/en/latest/index.html + doi: 10.093/bioinformatics/btq033 +input: + - + - input_file_1: + type: file + description: Input genomic coordinates file + pattern: "*.{bam,bed,BED,gff,vcf}" + - input_file_2: + type: file + description: Input genomic coordinates file + pattern: "*.{bam,bed,BED,gff,vcf}" + +output: + - + - index: + type: stdout,file + description: + pattern: "stdout,*.{bed,BED}" +authors: + - "@JoseEspinosa" diff --git a/software/bedtools/intersectbed/test/input_data/A.bed b/software/bedtools/intersectbed/test/input_data/A.bed new file mode 100644 index 00000000..dc9a4f0c --- /dev/null +++ b/software/bedtools/intersectbed/test/input_data/A.bed @@ -0,0 +1,5 @@ +chr1 951 1061 +chr1 1300 1420 +chr1 1400 1500 + + diff --git a/software/bedtools/intersectbed/test/input_data/B.bed b/software/bedtools/intersectbed/test/input_data/B.bed new file mode 100644 index 00000000..74e0ef4e --- /dev/null +++ b/software/bedtools/intersectbed/test/input_data/B.bed @@ -0,0 +1 @@ +chr1 999 1010 diff --git a/software/bedtools/intersectbed/test/main.nf b/software/bedtools/intersectbed/test/main.nf new file mode 100644 index 00000000..e966ea7a --- /dev/null +++ b/software/bedtools/intersectbed/test/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.preview.dsl = 2 + +params.intersect_args = '' //'-bed -c -f 0.20' + +include check_output from '../../../../tests/functions/check_process_outputs.nf' // params(params) +include INTERSECT_BED from '../main.nf' params(params) + +// Define input channels +ch_input_1 = Channel.fromPath('./input_data/A.bed') +ch_input_2 = Channel.fromPath('./input_data/B.bed') + +// Run the workflow +workflow { + INTERSECT_BED(ch_input_1, ch_input_2, params.intersect_args) + // .check_output() +} diff --git a/software/bedtools/intersectbed/test/nextflow.config b/software/bedtools/intersectbed/test/nextflow.config new file mode 100644 index 00000000..c137a138 --- /dev/null +++ b/software/bedtools/intersectbed/test/nextflow.config @@ -0,0 +1,2 @@ +docker.enabled = true +params.outdir = './results'