From 70d0c0b69bf9c4cd11323f549dabffc77779fe84 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 18 Feb 2022 22:27:20 +0000 Subject: [PATCH] Make --outdir mandatory nf-core/tools#1415 --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/ci.yml | 8 ++++---- CHANGELOG.md | 1 + README.md | 5 ++++- conf/test.config | 4 ++-- conf/test_full.config | 2 +- conf/test_full_nanopore.config | 10 +++++----- conf/test_full_sispa.config | 8 ++++---- conf/test_nanopore.config | 2 +- conf/test_sispa.config | 4 ++-- docs/usage.md | 6 +++++- lib/WorkflowMain.groovy | 2 +- nextflow.config | 2 +- nextflow_schema.json | 6 ++++-- 14 files changed, 36 insertions(+), 26 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0536b7fb..b3799717 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -19,7 +19,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/vira - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/viralrecon/tree/master/.github/CONTRIBUTING.md) - [ ] If necessary, also make a PR on the nf-core/viralrecon _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. - [ ] Make sure your code lints (`nf-core lint`). -- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`). +- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). - [ ] Usage Documentation in `docs/usage.md` is updated. - [ ] Output Documentation in `docs/output.md` is updated. - [ ] `CHANGELOG.md` is updated. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f8c69cf..7d3067a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - name: Run pipeline with test data run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker + nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results parameters: name: Test workflow parameters @@ -74,7 +74,7 @@ jobs: - name: Run pipeline with various parameters run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker ${{ matrix.parameters }} + nextflow run ${GITHUB_WORKSPACE} -profile test,docker ${{ matrix.parameters }} --outdir ./results test_sispa: name: Test SISPA workflow @@ -96,7 +96,7 @@ jobs: - name: Run pipeline with minimal SISPA data and various options run: | - nextflow run ${GITHUB_WORKSPACE} -profile test_sispa,docker ${{ matrix.parameters }} + nextflow run ${GITHUB_WORKSPACE} -profile test_sispa,docker ${{ matrix.parameters }} --outdir ./results test_nanopore: name: Test Nanopore workflow @@ -122,4 +122,4 @@ jobs: - name: Run pipeline with minimal Nanopore data and various options run: | - nextflow run ${GITHUB_WORKSPACE} -profile test_nanopore,docker ${{ matrix.parameters }} + nextflow run ${GITHUB_WORKSPACE} -profile test_nanopore,docker ${{ matrix.parameters }} --outdir ./results diff --git a/CHANGELOG.md b/CHANGELOG.md index da122211..784d6a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes * [[#281](https://github.com/nf-core/viralrecon/issues/281)] - Nanopore medaka processing fails with error if model name, not model file, provided +* [nf-core/tools#1415](https://github.com/nf-core/tools/issues/1415) - Make `--outdir` a mandatory parameter ### Parameters diff --git a/README.md b/README.md index 0021583e..80541aab 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ A number of improvements were made to the pipeline recently, mainly with regard 3. Download the pipeline and test it on a minimal dataset with a single command: ```console - nextflow run nf-core/viralrecon -profile test,YOURPROFILE + nextflow run nf-core/viralrecon -profile test,YOURPROFILE --outdir ``` Note that some form of configuration will be needed so that Nextflow knows how to fetch the required software. This is usually done in the form of a config profile (`YOURPROFILE` in the example command above). You can chain multiple config profiles in a comma-separated string. @@ -104,6 +104,7 @@ A number of improvements were made to the pipeline recently, mainly with regard ```bash nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir --platform illumina \ --protocol metagenomic \ --genome 'MN908947.3' \ @@ -115,6 +116,7 @@ A number of improvements were made to the pipeline recently, mainly with regard ```bash nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir --platform illumina \ --protocol amplicon \ --genome 'MN908947.3' \ @@ -129,6 +131,7 @@ A number of improvements were made to the pipeline recently, mainly with regard ```bash nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir --platform nanopore \ --genome 'MN908947.3' \ --primer_set_version 3 \ diff --git a/conf/test.config b/conf/test.config index d8655763..45dad62c 100644 --- a/conf/test.config +++ b/conf/test.config @@ -5,7 +5,7 @@ Defines input files and everything required to run a fast and simple pipeline test. Use as follows: - nextflow run nf-core/viralrecon -profile test, + nextflow run nf-core/viralrecon -profile test, --outdir ---------------------------------------------------------------------------------------- */ @@ -32,7 +32,7 @@ params { // Variant calling options variant_caller = 'ivar' - + // Assembly options assemblers = 'spades,unicycler,minia' skip_plasmidid = true // Skip this by default to bypass Github Actions disk quota errors diff --git a/conf/test_full.config b/conf/test_full.config index cdd011f3..76c17fcb 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -5,7 +5,7 @@ Defines input files and everything required to run a full size pipeline test. Use as follows: - nextflow run nf-core/viralrecon -profile test_full, + nextflow run nf-core/viralrecon -profile test_full, --outdir ---------------------------------------------------------------------------------------- */ diff --git a/conf/test_full_nanopore.config b/conf/test_full_nanopore.config index 31e1c124..856246ea 100644 --- a/conf/test_full_nanopore.config +++ b/conf/test_full_nanopore.config @@ -2,10 +2,10 @@ ======================================================================================== Nextflow config file for running full-size tests ======================================================================================== - Defines input files and everything required to run a full size pipeline test. - + Defines input files and everything required to run a full size pipeline test. + Use as follows: - nextflow run nf-core/viralrecon -profile test_full_nanopore, + nextflow run nf-core/viralrecon -profile test_full_nanopore, --outdir ---------------------------------------------------------------------------------------- */ @@ -20,11 +20,11 @@ params { fastq_dir = 's3://nf-core-awsmegatests/viralrecon/input_data/20210205_1526_X4_FAP51364_21fa8135/fastq_pass/' fast5_dir = 's3://nf-core-awsmegatests/viralrecon/input_data/20210205_1526_X4_FAP51364_21fa8135/fast5_pass/' sequencing_summary = 's3://nf-core-awsmegatests/viralrecon/input_data/20210205_1526_X4_FAP51364_21fa8135/sequencing_summary.txt' - + // Genome references genome = 'MN908947.3' primer_set_version = 3 // Other parameters artic_minion_medaka_model = 's3://nf-core-awsmegatests/viralrecon/input_data/20210205_1526_X4_FAP51364_21fa8135/r941_min_high_g360_model.hdf5' -} \ No newline at end of file +} diff --git a/conf/test_full_sispa.config b/conf/test_full_sispa.config index 2e8b04d2..7c190905 100644 --- a/conf/test_full_sispa.config +++ b/conf/test_full_sispa.config @@ -2,10 +2,10 @@ ======================================================================================== Nextflow config file for running full-size tests ======================================================================================== - Defines input files and everything required to run a full size pipeline test. - + Defines input files and everything required to run a full size pipeline test. + Use as follows: - nextflow run nf-core/viralrecon -profile test_full_sispa, + nextflow run nf-core/viralrecon -profile test_full_sispa, --outdir ---------------------------------------------------------------------------------------- */ @@ -33,4 +33,4 @@ process { withName: 'PLASMIDID' { errorStrategy = 'ignore' } -} \ No newline at end of file +} diff --git a/conf/test_nanopore.config b/conf/test_nanopore.config index 647a5e5f..853d4a05 100644 --- a/conf/test_nanopore.config +++ b/conf/test_nanopore.config @@ -5,7 +5,7 @@ Defines input files and everything required to run a fast and simple pipeline test. Use as follows: - nextflow run nf-core/viralrecon -profile test_nanopore, + nextflow run nf-core/viralrecon -profile test_nanopore, --outdir ---------------------------------------------------------------------------------------- */ diff --git a/conf/test_sispa.config b/conf/test_sispa.config index 9aaff136..c918e194 100644 --- a/conf/test_sispa.config +++ b/conf/test_sispa.config @@ -5,7 +5,7 @@ Defines input files and everything required to run a fast and simple pipeline test. Use as follows: - nextflow run nf-core/viralrecon -profile test_sispa, + nextflow run nf-core/viralrecon -profile test_sispa, --outdir ---------------------------------------------------------------------------------------- */ @@ -30,7 +30,7 @@ params { // Variant calling options variant_caller = 'bcftools' - + // Assembly options assemblers = 'spades,unicycler,minia' skip_plasmidid = true // Skip this by default to bypass Github Actions disk quota errors diff --git a/docs/usage.md b/docs/usage.md index 895c9716..0540585f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -97,6 +97,7 @@ The command to run the pipeline would then be: ```console nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir \ --platform nanopore \ --genome 'MN908947.3' \ --primer_set_version 3 \ @@ -115,6 +116,7 @@ The command to run the pipeline would then be: ```console nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir \ --platform nanopore \ --genome 'MN908947.3' \ --primer_set_version 3 \ @@ -139,6 +141,7 @@ An example command using v3 ARTIC primers with "MN908947.3": ```console nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir \ --platform illumina \ --protocol amplicon \ --genome 'MN908947.3' \ @@ -157,6 +160,7 @@ An example command using SWIFT primers with "MN908947.3": ```console nextflow run nf-core/viralrecon \ --input samplesheet.csv \ + --outdir \ --platform illumina \ --protocol amplicon \ --genome 'MN908947.3' \ @@ -173,7 +177,7 @@ nextflow run nf-core/viralrecon \ The typical command for running the pipeline is as follows: ```console -nextflow run nf-core/viralrecon --input samplesheet.csv --genome 'MN908947.3' -profile docker +nextflow run nf-core/viralrecon --input samplesheet.csv --outdir --genome 'MN908947.3' -profile docker ``` This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy index 6f9a12db..9778e073 100755 --- a/lib/WorkflowMain.groovy +++ b/lib/WorkflowMain.groovy @@ -21,7 +21,7 @@ class WorkflowMain { // Print help to screen if required // public static String help(workflow, params, log) { - def command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome 'MN908947.3' -profile docker" + def command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --outdir --genome 'MN908947.3' -profile docker" def help_string = '' help_string += NfcoreTemplate.logo(workflow, params.monochrome_logs) help_string += NfcoreSchema.paramsHelp(workflow, params, command) diff --git a/nextflow.config b/nextflow.config index d7f1abda..0ab755d7 100644 --- a/nextflow.config +++ b/nextflow.config @@ -90,7 +90,7 @@ params { skip_assembly = false // Boilerplate options - outdir = './results' + outdir = null tracedir = "${params.outdir}/pipeline_info" publish_dir_mode = 'copy' email = null diff --git a/nextflow_schema.json b/nextflow_schema.json index f00acf7f..11d33169 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,6 +10,9 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", + "required": [ + "outdir" + ], "properties": { "input": { "type": "string", @@ -42,8 +45,7 @@ "outdir": { "type": "string", "format": "directory-path", - "description": "The output directory where the results will be saved.", - "default": "./results", + "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.", "fa_icon": "fas fa-folder-open" }, "email": {