From 2cbc988d5f7d8b0fc37a7b8a3a49f795396f982a Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 15 Jul 2020 18:15:16 +0200 Subject: [PATCH] Bedtools complement adapted to the current module standard --- software/bedtools/complement/Dockerfile | 4 ++-- software/bedtools/complement/main.nf | 19 +++++++++++++++++-- .../bedtools/complement/test/input_data/A.bed | 6 +----- .../complement/test/input_data/genome.sizes | 2 +- software/bedtools/complement/test/main.nf | 5 +++-- .../bedtools/complement/test/nextflow.config | 2 -- 6 files changed, 24 insertions(+), 14 deletions(-) mode change 100644 => 120000 software/bedtools/complement/test/input_data/A.bed mode change 100644 => 120000 software/bedtools/complement/test/input_data/genome.sizes delete mode 100644 software/bedtools/complement/test/nextflow.config diff --git a/software/bedtools/complement/Dockerfile b/software/bedtools/complement/Dockerfile index 7eaea60c..1d9dbb95 100644 --- a/software/bedtools/complement/Dockerfile +++ b/software/bedtools/complement/Dockerfile @@ -1,7 +1,7 @@ FROM nfcore/base LABEL authors="Jose Espinosa-Carrasco" \ - description="Docker image containing all requirements for nf-core/modules/bedtools/complementbed" + description="Docker image containing all requirements for nf-core/modules/bedtools/complement" COPY environment.yml / RUN conda env create -f /environment.yml && conda clean -a -ENV PATH /opt/conda/envs/nf-core-bedtools-complementbed/bin:$PATH +ENV PATH /opt/conda/envs/nf-core-bedtools-complement/bin:$PATH diff --git a/software/bedtools/complement/main.nf b/software/bedtools/complement/main.nf index 7c34ba8f..8e99e58b 100644 --- a/software/bedtools/complement/main.nf +++ b/software/bedtools/complement/main.nf @@ -1,18 +1,33 @@ +def MODULE = "bedtools_complement" +params.publish_dir = MODULE +params.publish_results = "default" + process BEDTOOLS_COMPLEMENT { tag {input_file} + publishDir "${params.out_dir}/${params.publish_dir}", + mode: params.publish_dir_mode, + saveAs: { filename -> + if (params.publish_results == "none") null + else filename } + + //container "docker.pkg.github.com/nf-core/$MODULE" container 'quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0' + conda "${moduleDir}/environment.yml" + input: path (input_file) path (fasta_sizes) val (bedtools_complement_args) output: - stdout() + path "${input_file}.bed", emit: complement + path "*.version.txt", emit: version script: """ - bedtools complement -i ${input_file} -g ${fasta_sizes} ${bedtools_complement_args} + bedtools complement -i ${input_file} -g ${fasta_sizes} ${bedtools_complement_args} > ${input_file}.bed + bedtools --version | sed -n "s/.*\\(v.*\$\\)/\\1/p" > bedtools.version.txt """ } diff --git a/software/bedtools/complement/test/input_data/A.bed b/software/bedtools/complement/test/input_data/A.bed deleted file mode 100644 index dc9a4f0c..00000000 --- a/software/bedtools/complement/test/input_data/A.bed +++ /dev/null @@ -1,5 +0,0 @@ -chr1 951 1061 -chr1 1300 1420 -chr1 1400 1500 - - diff --git a/software/bedtools/complement/test/input_data/A.bed b/software/bedtools/complement/test/input_data/A.bed new file mode 120000 index 00000000..4698611f --- /dev/null +++ b/software/bedtools/complement/test/input_data/A.bed @@ -0,0 +1 @@ +../../../../../tests/data/bed/A.bed \ No newline at end of file diff --git a/software/bedtools/complement/test/input_data/genome.sizes b/software/bedtools/complement/test/input_data/genome.sizes deleted file mode 100644 index 8cc54558..00000000 --- a/software/bedtools/complement/test/input_data/genome.sizes +++ /dev/null @@ -1 +0,0 @@ -chr1 1780869 diff --git a/software/bedtools/complement/test/input_data/genome.sizes b/software/bedtools/complement/test/input_data/genome.sizes new file mode 120000 index 00000000..3457e6c9 --- /dev/null +++ b/software/bedtools/complement/test/input_data/genome.sizes @@ -0,0 +1 @@ +../../../../../tests/data/bed/genome.sizes \ No newline at end of file diff --git a/software/bedtools/complement/test/main.nf b/software/bedtools/complement/test/main.nf index e5722133..dfa024cc 100644 --- a/software/bedtools/complement/test/main.nf +++ b/software/bedtools/complement/test/main.nf @@ -2,9 +2,11 @@ nextflow.preview.dsl = 2 +params.out_dir = "test_output" +params.fastqc_args = '' +params.publish_dir_mode = "copy" params.bedtools_complement_args = '' -include check_output from '../../../../tests/functions/check_process_outputs.nf' // params(params) include BEDTOOLS_COMPLEMENT from '../main.nf' params(params) // Define input channels @@ -14,5 +16,4 @@ chrom_sizes = Channel.fromPath('./input_data/genome.sizes') // Run the workflow workflow { BEDTOOLS_COMPLEMENT(ch_input, chrom_sizes, params.bedtools_complement_args) - // .check_output() } diff --git a/software/bedtools/complement/test/nextflow.config b/software/bedtools/complement/test/nextflow.config deleted file mode 100644 index c137a138..00000000 --- a/software/bedtools/complement/test/nextflow.config +++ /dev/null @@ -1,2 +0,0 @@ -docker.enabled = true -params.outdir = './results'