diff --git a/.github/workflows/awstest.yml b/.github/workflows/awstest.yml index 8eb5837c..398ec4cc 100644 --- a/.github/workflows/awstest.yml +++ b/.github/workflows/awstest.yml @@ -23,7 +23,7 @@ jobs: { "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/smrnaseq/results-test-${{ github.sha }}" } - profiles: test + profiles: test,illumina - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 997e6ef3..3463d872 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,10 @@ jobs: - "23.04.0" - "latest-everything" profile: - - "test" - - "test_no_genome" - - "test_umi" - - "test_index" + - "test,illumina" + - "test_no_genome,illumina" + - "test_umi,illumina" + - "test_index,illumina" steps: - name: Check out pipeline code uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml index 2d20d644..d569c851 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -76,7 +76,7 @@ jobs: env: NXF_SINGULARITY_CACHEDIR: ./ NXF_SINGULARITY_HOME_MOUNT: true - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results + run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity,illumina --outdir ./results - name: Run the downloaded pipeline (stub run not supported) id: run_pipeline if: ${{ job.steps.stub_run_pipeline.status == failure() }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f19786ae..d5ffb78f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v2.3.2dev - 2024-XX-XX - X +## v2.4.0dev - 2024-XX-XX - X - [[#332]](https://github.com/nf-core/smrnaseq/issues/332) by [[#361]](https://github.com/nf-core/smrnaseq/pull/361) - Fix documentation to use only single-end - [[#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 +- [[#351]](https://github.com/nf-core/smrnaseq/issues/351) - Fix [Protocol inheritance issue](https://github.com/nf-core/smrnaseq/pull/364) - fixing protocol inheritance from subworkflow with move to config profile(s) for different protocols ## v2.3.1 - 2024-04-18 - Gray Zinc Dalmation Patch diff --git a/README.md b/README.md index 963013eb..3db1a5b9 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,10 @@ Now, you can run the pipeline using: ```bash nextflow run nf-core/smrnaseq \ - -profile \ + -profile ,illumina \ --input samplesheet.csv \ --genome 'GRCh37' \ --mirtrace_species 'hsa' \ - --protocol 'illumina' \ --outdir ``` diff --git a/conf/protocol_cats.config b/conf/protocol_cats.config new file mode 100644 index 00000000..eb555c88 --- /dev/null +++ b/conf/protocol_cats.config @@ -0,0 +1,7 @@ +//This profile handles CATs miRNA defaults. Include it as an additional profile to set certain pipeline parameters appropriately. +params{ + clip_r1 = 3 + three_prime_clip_r1 = 0 + three_prime_adapter = "AAAAAAAA" + protocol = 'cats' +} diff --git a/conf/protocol_illumina.config b/conf/protocol_illumina.config new file mode 100644 index 00000000..d867fa66 --- /dev/null +++ b/conf/protocol_illumina.config @@ -0,0 +1,7 @@ +//This profile handles Illumina miRNA defaults. Include it as an additional profile to set certain pipeline parameters appropriately. +params{ + clip_r1 = 0 + three_prime_clip_r1 = 0 + three_prime_adapter = "TGGAATTCTCGGGTGCCAAGG" + protocol = 'illumina' +} diff --git a/conf/protocol_nextflex.config b/conf/protocol_nextflex.config new file mode 100644 index 00000000..08a1ef82 --- /dev/null +++ b/conf/protocol_nextflex.config @@ -0,0 +1,7 @@ +//This profile handles Nextflex miRNA defaults. Include it as an additional profile to set certain pipeline parameters appropriately. +params{ + clip_r1 = 4 + three_prime_clip_r1 = 4 + three_prime_adapter = "TGGAATTCTCGGGTGCCAAGG" + protocol = 'nextflex' +} diff --git a/conf/protocol_qiaseq.config b/conf/protocol_qiaseq.config new file mode 100644 index 00000000..e9dccc20 --- /dev/null +++ b/conf/protocol_qiaseq.config @@ -0,0 +1,7 @@ +//This profile handles QIASEQ miRNA defaults. Include it as an additional profile to set certain pipeline parameters appropriately. +params{ + clip_r1 = 0 + three_prime_clip_r1 = 0 + three_prime_adapter = "AACTGTAGGCACCATCAAT" + protocol = 'qiaseq' +} diff --git a/conf/test.config b/conf/test.config index a56b2e96..65137212 100644 --- a/conf/test.config +++ b/conf/test.config @@ -25,7 +25,6 @@ params { fasta = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/genome.fa' mirtrace_species = 'hsa' - protocol = 'illumina' skip_mirdeep = true save_merged = false save_aligned_mirna_quant = false diff --git a/conf/test_full.config b/conf/test_full.config index 964dc5b2..cc5ecd92 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -18,7 +18,6 @@ params { input = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/samplesheet/v2.0/samplesheet-full.csv' genome = 'GRCh37' mirtrace_species = 'hsa' - protocol = 'illumina' } diff --git a/conf/test_index.config b/conf/test_index.config index bb9f4707..237251af 100644 --- a/conf/test_index.config +++ b/conf/test_index.config @@ -26,7 +26,6 @@ params { bowtie_index = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/bowtie_index.tar.gz' mirtrace_species = 'hsa' - protocol = 'illumina' skip_mirdeep = true save_merged = false save_aligned_mirna_quant = false diff --git a/conf/test_no_genome.config b/conf/test_no_genome.config index aae8ce91..cbc496ff 100644 --- a/conf/test_no_genome.config +++ b/conf/test_no_genome.config @@ -26,6 +26,5 @@ params { mirna_gtf = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/hsa.gff3' mirtrace_species = 'hsa' skip_mirdeep = true - protocol = 'illumina' } diff --git a/conf/test_umi.config b/conf/test_umi.config index c7d0db15..cd359a6f 100644 --- a/conf/test_umi.config +++ b/conf/test_umi.config @@ -25,7 +25,6 @@ params { fasta = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/genome.fa' mirtrace_species = 'hsa' - protocol = 'illumina' skip_mirdeep = true //UMI Specific testcase diff --git a/docs/usage.md b/docs/usage.md index ffd7537c..7bf35ed5 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -14,11 +14,18 @@ This option indicates the experimental protocol used for the sample preparation. - 'nextflex': adapter (`TGGAATTCTCGGGTGCCAAGG`), clip_r1 (`4`), three_prime_clip_r1 (`4`) - 'qiaseq': adapter (`AACTGTAGGCACCATCAAT`) - 'cats': adapter (`GATCGGAAGAGCACACGTCTG`), clip_r1(`3) -- 'custom' (where the user can indicate the `three_prime_adapter`, `clip_r1` and `three_prime_clip_r1` manually) + +This option is not chosen as a parameter but as an additional profile that sets the corresponding `three_prime_adapter`, `clip_r1` and `three_prime_clip_r1` parameters accordingly. You can choose to either use any of the provided profiles by running the pipeline with e.g. `illumina` to set the defaults as described above in a more convenient way. + +```bash +-profile your_other_profiles,illumina +``` + +In case you have a custom protocol, please supply the `three_prime_adapter`, `clip_r1` and `three_prime_clip_r1` manually. The parameter `--three_prime_adapter` is set to the Illumina TruSeq single index adapter sequence `AGATCGGAAGAGCACACGTCTGAACTCCAGTCA`. This is also to ensure, that the auto-detect functionality of `FASTP` is disabled. Please make sure to adapt this adapter sequence accordingly for your run. -:warning: At least the `custom` protocol has to be specified, otherwise the pipeline won't run. In case you specify the `custom` protocol, ensure that the parameters above are set accordingly or the defaults will be applied. If you want to auto-detect the adapters using `fastp`, please set `--three_prime_adapter` to `auto-detect`. +:warning: If you do not choose a profile that sets the `three_prime_adapter`, `clip_r1` and `three_prime_clip_r1` options, the pipeline won't run. If you want to auto-detect the adapters using `fastp`, please set `--three_prime_adapter` to `auto-detect`. ### `mirtrace_species` or `mirgenedb_species` diff --git a/nextflow.config b/nextflow.config index 0821332f..5fb75bb4 100644 --- a/nextflow.config +++ b/nextflow.config @@ -13,8 +13,8 @@ params { input = null - // Workflow flags - protocol = 'illumina' + // Protocol default (override via config profile - NOT directly via parameter!) + protocol = "Custom" // References genome = null @@ -243,6 +243,12 @@ profiles { test_no_genome { includeConfig 'conf/test_no_genome.config' } test_full { includeConfig 'conf/test_full.config' } test_index { includeConfig 'conf/test_index.config' } + + //Protocol specific profiles + cats { includeConfig 'conf/protocol_cats.config' } + illumina { includeConfig 'conf/protocol_illumina.config' } + qiaseq { includeConfig 'conf/protocol_qiaseq.config' } + nextflex { includeConfig 'conf/protocol_nextflex.config' } } // Set default registry for Apptainer, Docker, Podman and Singularity independent of -profile diff --git a/nextflow_schema.json b/nextflow_schema.json index e56d11ff..07eb35c2 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -23,14 +23,6 @@ "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/smrnaseq/usage#samplesheet-input).", "fa_icon": "fas fa-file-csv" }, - "protocol": { - "type": "string", - "default": "illumina", - "fa_icon": "fas fa-vial", - "description": "Protocol for constructing smRNA-seq libraries.", - "help_text": "Presets for trimming parameters and 3' adapter sequence with a specified protocol.\n\n| Protocol | Library Prep Kit | Trimming Parameter | 3' Adapter Sequence |\n| :------------ | :-------------------------------------- | :-------------------------------------- | :--------------------- |\n| illumina | Illumina TruSeq Small RNA | `clip_r1 = 0` `three_prime_clip_r1 = 0` | `TGGAATTCTCGGGTGCCAAGG` |\n| nextflex | BIOO SCIENTIFIC NEXTFLEX Small RNA-Seq | `clip_r1 = 4` `three_prime_clip_r1 = 4` | `TGGAATTCTCGGGTGCCAAGG` |\n| qiaseq | QIAGEN QIAseq miRNA | `clip_r1 = 0` `three_prime_clip_r1 = 0` | `AACTGTAGGCACCATCAAT` |\n| cats | Diagenode CATS Small RNA-seq | `clip_r1 = 3` `three_prime_clip_r1 = 0` | `AAAAAAAAAAA` + `GATCGGAAGAGCACACGTCTG` (only polyA is used for trimming) |\n| custom | user defined | user defined | user defined |\n\n> NB: When running `--protocol custom` the user ***must define the 3' Adapter Sequence***.\n> If trimming parameters aren't provided the pipeline will deafult to `clip_R1 = 0` and `three_prime_clip_R1 = 0` (i.e. no extra clipping).", - "enum": ["illumina", "nextflex", "qiaseq", "cats", "custom"] - }, "outdir": { "type": "string", "format": "directory-path", @@ -48,6 +40,11 @@ "type": "string", "description": "MultiQC report title. Printed as page header, used for filename if not otherwise specified.", "fa_icon": "fas fa-file-signature" + }, + "protocol": { + "type": "string", + "default": "Custom", + "fa_icon": "fas fa-atom" } } }, diff --git a/subworkflows/local/utils_nfcore_smrnaseq_pipeline/main.nf b/subworkflows/local/utils_nfcore_smrnaseq_pipeline/main.nf index 57c97a86..0b72ae34 100644 --- a/subworkflows/local/utils_nfcore_smrnaseq_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_smrnaseq_pipeline/main.nf @@ -50,8 +50,7 @@ workflow PIPELINE_INITIALISATION { outdir, workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1 ) - //Detect Protocol setting, set this early before help so help shows proper adapters etc pp - formatProtocol(params,log) + // // Validate parameters and generate parameter summary to stdout // @@ -261,45 +260,3 @@ def methodsDescriptionText(mqc_methods_yaml) { return description_html.toString() } - -/* -* Format the protocol -* Given the protocol parameter (params.protocol), -* this function formats the protocol such that it is fit for the respective -* subworkflow -*/ -def formatProtocol(params,log) { - - switch(params.protocol){ - case 'illumina': - params.putIfAbsent("clip_r1", 0); - params.putIfAbsent("three_prime_clip_r1",0); - params.putIfAbsent("three_prime_adapter", "TGGAATTCTCGGGTGCCAAGG"); - break - case 'nextflex': - params.putIfAbsent("clip_r1", 4); - params.putIfAbsent("three_prime_clip_r1", 4); - params.putIfAbsent("three_prime_adapter", "TGGAATTCTCGGGTGCCAAGG"); - break - case 'qiaseq': - params.putIfAbsent("clip_r1",0); - params.putIfAbsent("three_prime_clip_r1",0); - params.putIfAbsent("three_prime_adapter","AACTGTAGGCACCATCAAT"); - break - case 'cats': - params.putIfAbsent("clip_r1",3); - params.putIfAbsent("three_prime_clip_r1", 0); - params.putIfAbsent("three_prime_adapter", "AAAAAAAA"); - break - case 'custom': - params.putIfAbsent("clip_r1", params.clip_r1) - params.putIfAbsent("three_prime_clip_r1", params.three_prime_clip_r1) - default: - log.warn "Please make sure to specify all required clipping and trimming parameters, otherwise only adapter detection will be performed." - } - - log.warn "Running with Protocol ${params.protocol}" - log.warn "Therefore using Adapter: ${params.three_prime_adapter}" - log.warn "Clipping ${params.clip_r1} bases from R1" - log.warn "And clipping ${params.three_prime_clip_r1} bases from 3' end" - }