From 0251f79408cde16d3e3eb666fda837249c8d54d4 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:43:14 +0000 Subject: [PATCH 1/5] add test to skip fastp --- conf/test_skipfastp.config | 35 +++++++++++++++++++++++++++++++++++ nextflow.config | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 conf/test_skipfastp.config diff --git a/conf/test_skipfastp.config b/conf/test_skipfastp.config new file mode 100644 index 00000000..f5e75fff --- /dev/null +++ b/conf/test_skipfastp.config @@ -0,0 +1,35 @@ +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Nextflow config file for running minimal tests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Defines input files and everything required to run a fast and simple pipeline test. + + Use as follows: + nextflow run nf-core/smrnaseq -profile test_skipfastp, --outdir + +---------------------------------------------------------------------------------------- +*/ + +params { + config_profile_name = 'Test profile' + config_profile_description = 'Minimal test dataset to check pipeline function skipping trimming' + + // Limit resources so that this can run on GitHub Actions + max_cpus = 2 + max_memory = '6.GB' + max_time = '6.h' + + // Input data + + input = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/samplesheet/v2.0/samplesheet_skipfastp.csv' + + mirtrace_species = 'hsa' + skip_mirdeep = true + skip_fastp = true + save_merged = false + save_aligned_mirna_quant = false + + cleanup = true //Otherwise tests dont run through properly. +} + +// Do not include any additional config so it defaults to protocol custom diff --git a/nextflow.config b/nextflow.config index 75745f17..d879697b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -246,7 +246,7 @@ profiles { test_index { includeConfig 'conf/test_index.config' } test_technical_repeats { includeConfig 'conf/test_technical_repeats.config' } test_mirgenedb { includeConfig 'conf/test_mirgenedb.config' } - + test_skipfastp { includeConfig 'conf/test_skipfastp.config' } //Protocol specific profiles From 99e69623ce1572bbae4d9783cdcb64bf4a9452b9 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:43:40 +0000 Subject: [PATCH 2/5] allow emission of trimmed fastq --- conf/modules.config | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/modules.config b/conf/modules.config index 1ca9f9e4..d7bfbd40 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -70,6 +70,12 @@ process { mode: params.publish_dir_mode, pattern: "*.fail.fastq.gz", enabled: params.save_trimmed_fail + ], + [ + path: { "${params.outdir}/fastp/fastq" }, + mode: params.publish_dir_mode, + pattern: "*.fastp.fastq.gz", + enabled: params.save_merged ] ] } From ac51567a88c2292332a57bc226030fd94f876d1e Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:46:07 +0000 Subject: [PATCH 3/5] if adapter is empty, create a similar channel for mirtrace --- workflows/smrnaseq.nf | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/workflows/smrnaseq.nf b/workflows/smrnaseq.nf index ac410b8f..256c3c6d 100644 --- a/workflows/smrnaseq.nf +++ b/workflows/smrnaseq.nf @@ -160,12 +160,23 @@ workflow NFCORE_SMRNASEQ { // // MODULE: mirtrace QC // - FASTQ_FASTQC_UMITOOLS_FASTP.out.adapter_seq - .join( ch_reads_for_mirna ) - .dump() - .map { meta, adapter_seq, reads -> [adapter_seq, meta.id, reads] } - .groupTuple() - .set { ch_mirtrace_inputs } + + // Define the main adapter sequence channel + ch_adapter_seq = FASTQ_FASTQC_UMITOOLS_FASTP.out.adapter_seq + + // Define a fallback channel with the default value "custom" + ch_fallback_adapter_seq = ch_reads_for_mirna.map { meta, reads -> [meta, 'custom'] } + + // Change to fallback channel if ch_adapter_seq is empty + ch_adapter_seq = ch_adapter_seq ? ch_fallback_adapter_seq : ch_adapter_seq + + // Now join the adapter sequence channel with the reads channel + ch_adapter_seq + .join(ch_reads_for_mirna) + .map { meta, adapter_seq, reads -> [adapter_seq, meta.id, reads] } + .groupTuple() + .map { adapter_seq, ids, reads_list -> [adapter_seq, ids, reads_list.flatten()] } + .set { ch_mirtrace_inputs } // // SUBWORKFLOW: MIRTRACE From 1f4d2fa4ff9836e551336e5d1be175b58e688ab1 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Thu, 22 Aug 2024 19:08:31 +0000 Subject: [PATCH 4/5] add test to ci --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e8af7b5..1c5a5625 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,7 @@ jobs: - "test_index" - "test_technical_repeats" - "test_mirgenedb" + - "test_skipfastp" steps: - name: Check out pipeline code uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 From 34548dd6b3d78a025164d10295fa8e712caeadcf Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Thu, 22 Aug 2024 19:08:48 +0000 Subject: [PATCH 5/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91deffb6..f6808949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [[#187]](https://github.com/nf-core/smrnaseq/issues/187) - Fix checking number of samples which causes error in plotMDS. - [[#378]](https://github.com/nf-core/smrnaseq/pull/378) - Fix [`--mirtrace_species` bug](<(https://github.com/nf-core/smrnaseq/issues/348)>). Make `MIRTRACE` process conditional. Add mirgenedb test. - [[#375]](https://github.com/nf-core/smrnaseq/pull/375) - Test merging of [technical repeats](https://github.com/nf-core/smrnaseq/issues/212). +- [[#383]](https://github.com/nf-core/smrnaseq/pull/383) - Fixes [parameter `--skip_fastp` throws an error](https://github.com/nf-core/smrnaseq/issues/263). ## v2.3.1 - 2024-04-18 - Gray Zinc Dalmation Patch