From 9b51362a532a14665f513cf987531f9ea5046b74 Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 24 Jun 2022 10:01:14 +0200 Subject: [PATCH] Proposal: Rename output from fastp module (#1802) * Rename output from fastp module * UPdate tests * fix alignment * prettier * Update modules/fastp/main.nf Co-authored-by: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> * apply review suggestion -sf * typo * update md5 * update md5 * try with human data * revert, human data also doesn't work * use contains instead Co-authored-by: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> --- modules/fastp/main.nf | 14 +++++----- modules/fastp/meta.yml | 2 +- tests/modules/fastp/test.yml | 52 ++++++++++++++++++------------------ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/modules/fastp/main.nf b/modules/fastp/main.nf index 5c9e3b83..120392c5 100644 --- a/modules/fastp/main.nf +++ b/modules/fastp/main.nf @@ -13,7 +13,7 @@ process FASTP { val save_merged output: - tuple val(meta), path('*.trim.fastq.gz') , optional:true, emit: reads + tuple val(meta), path('*.fastp.fastq.gz') , optional:true, emit: reads tuple val(meta), path('*.json') , emit: json tuple val(meta), path('*.html') , emit: html tuple val(meta), path('*.log') , emit: log @@ -31,10 +31,10 @@ process FASTP { if (meta.single_end) { def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' """ - [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz + [ ! -f ${prefix}.fastq.gz ] && ln -sf $reads ${prefix}.fastq.gz fastp \\ --in1 ${prefix}.fastq.gz \\ - --out1 ${prefix}.trim.fastq.gz \\ + --out1 ${prefix}.fastp.fastq.gz \\ --thread $task.cpus \\ --json ${prefix}.fastp.json \\ --html ${prefix}.fastp.html \\ @@ -50,13 +50,13 @@ process FASTP { def fail_fastq = save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' def merge_fastq = save_merged ? "-m --merged_out ${prefix}.merged.fastq.gz" : '' """ - [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz - [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz + [ ! -f ${prefix}_1.fastq.gz ] && ln -sf ${reads[0]} ${prefix}_1.fastq.gz + [ ! -f ${prefix}_2.fastq.gz ] && ln -sf ${reads[1]} ${prefix}_2.fastq.gz fastp \\ --in1 ${prefix}_1.fastq.gz \\ --in2 ${prefix}_2.fastq.gz \\ - --out1 ${prefix}_1.trim.fastq.gz \\ - --out2 ${prefix}_2.trim.fastq.gz \\ + --out1 ${prefix}_1.fastp.fastq.gz \\ + --out2 ${prefix}_2.fastp.fastq.gz \\ --json ${prefix}.fastp.json \\ --html ${prefix}.fastp.html \\ $fail_fastq \\ diff --git a/modules/fastp/meta.yml b/modules/fastp/meta.yml index 3274e41b..2bd2b1a9 100644 --- a/modules/fastp/meta.yml +++ b/modules/fastp/meta.yml @@ -38,7 +38,7 @@ output: - reads: type: file description: The trimmed/modified/unmerged fastq reads - pattern: "*trim.fastq.gz" + pattern: "*fastp.fastq.gz" - json: type: file description: Results in JSON format diff --git a/tests/modules/fastp/test.yml b/tests/modules/fastp/test.yml index 0863259b..dd1f62f4 100644 --- a/tests/modules/fastp/test.yml +++ b/tests/modules/fastp/test.yml @@ -1,23 +1,23 @@ - name: fastp test_fastp_single_end - command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: + - path: output/fastp/test.fastp.fastq.gz + md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - path: output/fastp/test.fastp.html contains: - "Q20 bases:12.922000 K (92.984097%)" - "single end (151 cycles)" + - path: output/fastp/test.fastp.json + md5sum: 7ee735cefb67f549dc857eefb9e7f123 - path: output/fastp/test.fastp.log contains: - "Q20 bases: 12922(92.9841%)" - "reads passed filter: 99" - - path: output/fastp/test.trim.fastq.gz - md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - - path: output/fastp/test.fastp.json - md5sum: a517ba37b17a342b5428f2c1f8fe3dd7 - name: fastp test_fastp_paired_end - command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: @@ -25,40 +25,40 @@ contains: - "Q20 bases:25.719000 K (93.033098%)" - "The input has little adapter percentage (~0.000000%), probably it's trimmed before." + - path: output/fastp/test.fastp.json + contains: + - '"passed_filter_reads": 198' - path: output/fastp/test.fastp.log contains: - "No adapter detected for read1" - "Q30 bases: 12281(88.3716%)" - - path: output/fastp/test.fastp.json - contains: - - '"passed_filter_reads": 198' - - path: output/fastp/test_1.trim.fastq.gz + - path: output/fastp/test_1.fastp.fastq.gz md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - - path: output/fastp/test_2.trim.fastq.gz + - path: output/fastp/test_2.fastp.fastq.gz md5sum: 532b190fb4dc7b2277ee5cf1464e598c - name: fastp test_fastp_single_end_trim_fail - command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: + - path: output/fastp/test.fail.fastq.gz + md5sum: b57f2026eb259a0b0c0b3960c270258d + - path: output/fastp/test.fastp.fastq.gz + md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - path: output/fastp/test.fastp.html contains: - "Q20 bases:12.922000 K (92.984097%)" - "single end (151 cycles)" + - path: output/fastp/test.fastp.json + md5sum: feafc4181a2a61b4b52d9c2b59b419ad - path: output/fastp/test.fastp.log contains: - "Q20 bases: 12922(92.9841%)" - "reads passed filter: 99" - - path: output/fastp/test.trim.fastq.gz - md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - - path: output/fastp/test.fastp.json - md5sum: 4be682c727942a45fc4c8600c28694a8 - - path: output/fastp/test.fail.fastq.gz - md5sum: b57f2026eb259a0b0c0b3960c270258d - name: fastp test_fastp_paired_end_trim_fail - command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: @@ -73,17 +73,17 @@ - path: output/fastp/test.fastp.json contains: - '"passed_filter_reads": 198' - - path: output/fastp/test_1.trim.fastq.gz - md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - - path: output/fastp/test_2.trim.fastq.gz - md5sum: 532b190fb4dc7b2277ee5cf1464e598c - path: output/fastp/test_1.fail.fastq.gz md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/fastp/test_1.fastp.fastq.gz + md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4 - path: output/fastp/test_2.fail.fastq.gz md5sum: 72d0002841967676ac936d08746a9128 + - path: output/fastp/test_2.fastp.fastq.gz + md5sum: 532b190fb4dc7b2277ee5cf1464e598c - name: fastp test_fastp_paired_end_merged - command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_merged -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_merged -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: @@ -102,7 +102,7 @@ - "total bases: 13683" - path: output/fastp/test.merged.fastq.gz md5sum: 4955ca2c899729b17bd526d2626a8d73 - - path: output/fastp/test_1.trim.fastq.gz + - path: output/fastp/test_1.fastp.fastq.gz md5sum: 4a03721ee252b7c6e81e007550e6ab63 - - path: output/fastp/test_2.trim.fastq.gz + - path: output/fastp/test_2.fastp.fastq.gz md5sum: 7a4ddf8485c147cd7aaf0d4f6cd57ace