diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df639239..d1806f1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: - "test_index" - "test_technical_repeats" - "test_mirgenedb" + - "test_skipfastp" steps: - name: Check out pipeline code uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index b59afc2f..10c6aaed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v2.4.0dev - 2024-XX-XX - X -- [[#349]](https://github.com/nf-core/smrnaseq/pull/349) - Fix [MIRTOP_QUANT conda issue](https://github.com/nf-core/smrnaseq/issues/347), change conda-base to conda-forge channel +- [[#349]](https://github.com/nf-core/smrnaseq/pull/349) - Fix [MIRTOP_QUANT conda issue](https://github.com/nf-core/smrnaseq/issues/347), change conda-base to conda-forge channel. - [[#350]](https://github.com/nf-core/smrnaseq/pull/350) - Fix [MIRTOP_QUANT conda issue](https://github.com/nf-core/smrnaseq/issues/347), set python version to 3.7 to fix pysam issue. -- [[#361]](https://github.com/nf-core/smrnaseq/pull/361) by [[#332]](https://github.com/nf-core/smrnaseq/issues/332) - Fix documentation to use only single-end. +- [[#361]](https://github.com/nf-core/smrnaseq/pull/361) - Fix [[#332]](https://github.com/nf-core/smrnaseq/issues/332) - Fix documentation to use only single-end. - [[#364]](https://github.com/nf-core/smrnaseq/pull/364) - Fix [Protocol inheritance issue](https://github.com/nf-core/smrnaseq/issues/351) - fixing protocol inheritance from subworkflow with move to config profile(s) for different protocols. - [[#372]](https://github.com/nf-core/smrnaseq/pull/372) - Fix [Plain test profile](https://github.com/nf-core/smrnaseq/issues/371) - Updated default protocol value to "custom". - [[#374]](https://github.com/nf-core/smrnaseq/pull/374) - Fix [default tests](https://github.com/nf-core/smrnaseq/issues/375) so that they do not require additional profiles in CI. Change GitHub CI fail-fast strategy to false. -- [[#375]](https://github.com/nf-core/smrnaseq/pull/375) - Test merging of [technical repeats](https://github.com/nf-core/smrnaseq/issues/212). +- [[#375]](https://github.com/nf-core/smrnaseq/pull/375) - Test [technical repeats](https://github.com/nf-core/smrnaseq/issues/212) - Test merging of technical repeats. - [[#377]](https://github.com/nf-core/smrnaseq/pull/377) - Fix [Linting](https://github.com/nf-core/smrnaseq/issues/369) - Fixed linting warnings and updated modules & subworkflows. - [[#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. -- [[#380]](https://github.com/nf-core/smrnaseq/pull/380) - Fix checking number of samples which causes error in plotMDS. Add nf-tests for local modules using custom R scripts: [edgeR_mirBase.R](https://github.com/nf-core/smrnaseq/issues/187). -- [[#381]](https://github.com/nf-core/smrnaseq/pull/381) - Update CI tests to nf-tests [Convert tests to nf-tests](https://github.com/nf-core/smrnaseq/issues/379). -- [[#382]](https://github.com/nf-core/smrnaseq/pull/382) - Add nf-tests for local modules using custom R scripts: [collapse_mirtop.R](https://github.com/nf-core/smrnaseq/issues/174). -- [[#384]](https://github.com/nf-core/smrnaseq/pull/384) - Fix filter stats module and add filter contaminants test profile: [filter status bug fix](https://github.com/nf-core/smrnaseq/issues/360). +- [[#380]](https://github.com/nf-core/smrnaseq/pull/380) - Fix [edgeR_mirBase.R](https://github.com/nf-core/smrnaseq/issues/187) - Fix checking number of samples which causes error in plotMDS. Add nf-tests for local modules using custom R scripts. +- [[#381]](https://github.com/nf-core/smrnaseq/pull/381) - Update [Convert tests to nf-tests](https://github.com/nf-core/smrnaseq/issues/379) - CI tests to nf-tests. +- [[#382]](https://github.com/nf-core/smrnaseq/pull/382) - Add [collapse_mirtop.R](https://github.com/nf-core/smrnaseq/issues/174) - Add nf-tests for local modules using custom R scripts. +- [[#383]](https://github.com/nf-core/smrnaseq/pull/383) - Fix [parameter `--skip_fastp` throws an error](https://github.com/nf-core/smrnaseq/issues/263) - Fix parameter --skip_fastp. +- [[#384]](https://github.com/nf-core/smrnaseq/pull/384) - Fix [filter status bug fix](https://github.com/nf-core/smrnaseq/issues/360) - Fix filter stats module and add filter contaminants test profile. ## v2.3.1 - 2024-04-18 - Gray Zinc Dalmation Patch 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 ] ] } 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 d5f34d40..be7bc161 100644 --- a/nextflow.config +++ b/nextflow.config @@ -239,6 +239,7 @@ profiles { } + test { includeConfig 'conf/test.config' } test_umi { includeConfig 'conf/test_umi.config' } test_no_genome { includeConfig 'conf/test_no_genome.config' } @@ -247,7 +248,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 diff --git a/workflows/smrnaseq.nf b/workflows/smrnaseq.nf index c6c9af0b..8b6a605a 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