diff --git a/test-datasets b/test-datasets index e5fef889..be215c08 160000 --- a/test-datasets +++ b/test-datasets @@ -1 +1 @@ -Subproject commit e5fef88994b8d34c7bf4b07116e5f7a330d2ee3b +Subproject commit be215c0874e2485f0d8e12a6f0addf08f2cd08df diff --git a/tools/cutadapt/main.nf b/tools/cutadapt/main.nf index c647140b..432eccb4 100644 --- a/tools/cutadapt/main.nf +++ b/tools/cutadapt/main.nf @@ -7,9 +7,12 @@ process cutadapt { tuple sample_id, file(input_forward_fq), file(input_reverse_fq) output: - tuple sample_id, file(output_forward_fq), file(output_reverse_fq) + tuple sample_id, file(forward_fq), file(reverse_fq) script: + forward_fq = "trimmed_forward.fastq" + reverse_fq = "trimmed_reverse.fastq" + """ cutadapt \ -j ${task.cpus} \ @@ -17,7 +20,7 @@ process cutadapt { --minimum-length $params.cutadapt_min_length \ --pair-filter=any \ --output ${forward_fq} \ - --paired-output ${reverse_fq} '$input_forward_fq' '$input_reverse_fq' + --paired-output ${reverse_fq} '${input_forward_fq}' '${input_reverse_fq}' cutadapt --version &> v_cutadapt.txt """ diff --git a/tools/cutadapt/test/main.nf b/tools/cutadapt/test/main.nf new file mode 100644 index 00000000..69c1eef8 --- /dev/null +++ b/tools/cutadapt/test/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow +nextflow.preview.dsl = 2 +include '../../../nf-core/module_testing/check_process_outputs.nf' params(params) +include '../main.nf' params(params) + +// Define input channels +readPaths = [ + [ sample: 'SRR4238351', + R1: '../../../test-datasets/tools/cutadapt/input/SRR396636.sra_1.fastq', + R2: '../../../test-datasets/tools/cutadapt/input/SRR396636.sra_2.fastq' + ] +] +Channel + .from(readPaths) + .map { row -> tuple( row.sample_name, file(row.R1.trim()), file(row.R2.trim()) ) } + .set { ch_read_files } + +// Run the workflow +workflow { + cutadapt(ch_read_files) + // .check_output() +} diff --git a/tools/cutadapt/test/nextflow.config b/tools/cutadapt/test/nextflow.config new file mode 100644 index 00000000..b1c505a7 --- /dev/null +++ b/tools/cutadapt/test/nextflow.config @@ -0,0 +1,8 @@ +docker.enabled = true +params.outdir = './results' + +params{ + //preprocessing options + cutadapt_min_length = 40 + cutadapt_min_quality = 25 +}