From f36902b9afc01ccfaed50acdc37e74d3da1e1206 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Sat, 11 Jul 2020 17:09:06 +0200 Subject: [PATCH] Cutadapt - merge tests into one --- software/cutadapt/main.nf | 8 ++----- software/cutadapt/test/main.nf | 21 +++++++++++++++++++ .../{test_single => test}/nextflow.config | 6 +++--- software/cutadapt/test_paired/main.nf | 14 ------------- software/cutadapt/test_paired/nextflow.config | 9 -------- software/cutadapt/test_single/main.nf | 21 ------------------- 6 files changed, 26 insertions(+), 53 deletions(-) create mode 100644 software/cutadapt/test/main.nf rename software/cutadapt/{test_single => test}/nextflow.config (64%) delete mode 100644 software/cutadapt/test_paired/main.nf delete mode 100644 software/cutadapt/test_paired/nextflow.config delete mode 100644 software/cutadapt/test_single/main.nf diff --git a/software/cutadapt/main.nf b/software/cutadapt/main.nf index 734b30b1..52dc2a3a 100644 --- a/software/cutadapt/main.nf +++ b/software/cutadapt/main.nf @@ -14,7 +14,7 @@ process cutadapt { reverse_fq = "trimmed_2.fastq" - if (params.singleEnd) { + if (params.single_end) { processing = """ cutadapt \ -j ${task.cpus} \ @@ -32,14 +32,10 @@ process cutadapt { --pair-filter=any \ --output ${forward_fq} \ --paired-output ${reverse_fq} ${reads} - - """ } - version = """ - cutadapt --version &> v_cutadapt.txt - """ + version = "cutadapt --version &> v_cutadapt.txt" return processing + version } diff --git a/software/cutadapt/test/main.nf b/software/cutadapt/test/main.nf new file mode 100644 index 00000000..2ab4529b --- /dev/null +++ b/software/cutadapt/test/main.nf @@ -0,0 +1,21 @@ +#!/usr/bin/env nextflow +nextflow.preview.dsl = 2 +include '../main.nf' params(params) + +// Define input channels +paired_end_input = Channel.fromFilePairs('../../../test-datasets/tools/cutadapt/input/*_{1,2}.fastq' ) + +// TODO: params.single_end is set to false in nextflow config +// But most of this module is not functional currently anyway.... +single_end_input = Channel.from([ + ['SRR4238351', '../../../test-datasets/tools/cutadapt/input/SRR4238351_subsamp.fastq.gz'], + ['SRR4238355', '../../../test-datasets/tools/cutadapt/input/SRR4238355_subsamp.fastq.gz'], + ['SRR4238359', '../../../test-datasets/tools/cutadapt/input/SRR4238359_subsamp.fastq.gz'], + ['SRR4238379', '../../../test-datasets/tools/cutadapt/input/SRR4238379_subsamp.fastq.gz'] + ]).map { row -> [ row[0], [ file(row[1]) ] ] } + +// Run the workflow +workflow { + cutadapt(paired_end_input) + cutadapt(single_end_input) +} diff --git a/software/cutadapt/test_single/nextflow.config b/software/cutadapt/test/nextflow.config similarity index 64% rename from software/cutadapt/test_single/nextflow.config rename to software/cutadapt/test/nextflow.config index 4b805ff3..888e1ec8 100644 --- a/software/cutadapt/test_single/nextflow.config +++ b/software/cutadapt/test/nextflow.config @@ -1,9 +1,9 @@ docker.enabled = true params.outdir = './results' -params{ - //preprocessing options +params{ + // Preprocessing options cutadapt_min_length = 40 cutadapt_min_quality = 25 - singleEnd = true + single_end = false } diff --git a/software/cutadapt/test_paired/main.nf b/software/cutadapt/test_paired/main.nf deleted file mode 100644 index 46d0fdc6..00000000 --- a/software/cutadapt/test_paired/main.nf +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env nextflow -nextflow.preview.dsl = 2 -include '../main.nf' params(params) - -// Define input channels - -Channel - .fromFilePairs('../../../test-datasets/tools/cutadapt/input/*_{1,2}.fastq' ) - .set { ch_read_files } - -// Run the workflow -workflow { - cutadapt(ch_read_files) -} diff --git a/software/cutadapt/test_paired/nextflow.config b/software/cutadapt/test_paired/nextflow.config deleted file mode 100644 index 08e52203..00000000 --- a/software/cutadapt/test_paired/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -docker.enabled = true -params.outdir = './results' - -params{ - //preprocessing options - cutadapt_min_length = 40 - cutadapt_min_quality = 25 - singleEnd = false -} diff --git a/software/cutadapt/test_single/main.nf b/software/cutadapt/test_single/main.nf deleted file mode 100644 index 657e2428..00000000 --- a/software/cutadapt/test_single/main.nf +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env nextflow -nextflow.preview.dsl = 2 -include '../main.nf' params(params) - -// Define input channels - -readPaths = [ - ['SRR4238351', '../../../test-datasets/tools/cutadapt/input/SRR4238351_subsamp.fastq.gz'], - ['SRR4238355', '../../../test-datasets/tools/cutadapt/input/SRR4238355_subsamp.fastq.gz'], - ['SRR4238359', '../../../test-datasets/tools/cutadapt/input/SRR4238359_subsamp.fastq.gz'], - ['SRR4238379', '../../../test-datasets/tools/cutadapt/input/SRR4238379_subsamp.fastq.gz'] -] -Channel - .from(readPaths) - .map { row -> [ row[0], [ file(row[1]) ] ] } - .set { ch_read_files } - -// Run the workflow -workflow { - cutadapt(ch_read_files) -}