diff --git a/README.md b/README.md index 6f64c5a..d1e6f33 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ On release, automated continuous integration tests run the pipeline on a full-si nextflow run nf-core/taxprofiler --input samplesheet.csv --databases database.csv --outdir --run_ --run_ -profile ``` - Note pipeline supports both CSV and PEP input sample sheets. Find out more [here](http://pep.databio.org/en/2.1.0/specification/). +Note pipeline supports both CSV and PEP input sample sheets. Find out more [here](http://pep.databio.org/en/2.1.0/specification/). ## Documentation diff --git a/conf/modules.config b/conf/modules.config index e367a67..0efd251 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -421,4 +421,12 @@ process { saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } + + withName: 'EIDO_VALIDATE' { + ext.args = '--st-index sample' + } + + withName: 'EIDO_CONVERT' { + ext.args = '--st-index sample' + } } diff --git a/conf/test_pep.config b/conf/test_pep.config index e3428fd..7f8c95d 100644 --- a/conf/test_pep.config +++ b/conf/test_pep.config @@ -8,8 +8,7 @@ params { max_time = '6.h' // Input data - input = null - pep = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/pep/test_pep_format_files/config.yaml' + input = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/pep/test_pep_format_files/config.yaml' databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv' perform_shortread_qc = true perform_longread_qc = true @@ -41,10 +40,4 @@ process { withName: MEGAN_RMA2INFO { maxForks = 1 } - withName: 'EIDO_VALIDATE' { - ext.args = '--st-index sample' - } - withName: 'EIDO_CONVERT' { - ext.args = '--st-index sample' - } } diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy index b9dd514..7883d70 100755 --- a/lib/WorkflowMain.groovy +++ b/lib/WorkflowMain.groovy @@ -74,8 +74,8 @@ class WorkflowMain { NfcoreTemplate.awsBatch(workflow, params) // Check input has been provided - if (!params.input && !params.pep) { - log.error "Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'" + if (!params.input) { + log.error "Please provide an input samplesheet or PEP to the pipeline e.g. '--input samplesheet.csv'" System.exit(1) } } diff --git a/modules.json b/modules.json index feed11f..d24c7e2 100644 --- a/modules.json +++ b/modules.json @@ -43,11 +43,11 @@ }, "eido/convert": { "branch": "master", - "git_sha": "c9b29c76869d9713130a13a418c1e8b5aecfb80d" + "git_sha": "9764eef361ded86e9242075bda64c2662421386a" }, "eido/validate": { "branch": "master", - "git_sha": "8c0127e071711cb0a2648a6bdf881637a9d7eadc" + "git_sha": "38383cfaefc06cd35e25de99989a3e6ab9ed2980" }, "fastp": { "branch": "master", diff --git a/modules/nf-core/modules/eido/convert/main.nf b/modules/nf-core/modules/eido/convert/main.nf index 40cd57a..be4c02f 100644 --- a/modules/nf-core/modules/eido/convert/main.nf +++ b/modules/nf-core/modules/eido/convert/main.nf @@ -10,6 +10,7 @@ process EIDO_CONVERT { input: path samplesheet val format + path pep_input_base_dir output: path "versions.yml" , emit: versions diff --git a/modules/nf-core/modules/eido/convert/meta.yml b/modules/nf-core/modules/eido/convert/meta.yml index 0cf354a..bd12e03 100644 --- a/modules/nf-core/modules/eido/convert/meta.yml +++ b/modules/nf-core/modules/eido/convert/meta.yml @@ -22,6 +22,9 @@ input: - format: type: value description: Extension of an output file + - pep_input_base_dir: + type: file + description: Optional path to the directory where files specified in a PEP config file are stored. Any paths specified in the config will need to be relative to this base directory. output: - versions: diff --git a/modules/nf-core/modules/eido/validate/main.nf b/modules/nf-core/modules/eido/validate/main.nf index bc6a111..e564e83 100644 --- a/modules/nf-core/modules/eido/validate/main.nf +++ b/modules/nf-core/modules/eido/validate/main.nf @@ -10,6 +10,7 @@ process EIDO_VALIDATE { input: path samplesheet path schema + path pep_input_base_dir output: path "versions.yml" , emit: versions diff --git a/modules/nf-core/modules/eido/validate/meta.yml b/modules/nf-core/modules/eido/validate/meta.yml index 962f59e..eb7b295 100644 --- a/modules/nf-core/modules/eido/validate/meta.yml +++ b/modules/nf-core/modules/eido/validate/meta.yml @@ -23,6 +23,9 @@ input: type: file description: Schema that the samplesheet will be validated against pattern: "*.{yaml,yml}" + - pep_input_base_dir: + type: file + description: Optional path to the directory where files specified in a PEP config file are stored. Any paths specified in the config will need to be relative to this base directory. output: - versions: diff --git a/nextflow.config b/nextflow.config index f3c7756..9d03211 100644 --- a/nextflow.config +++ b/nextflow.config @@ -12,7 +12,6 @@ params { // TODO nf-core: Specify your pipeline's command line flags // Input options input = null - pep = null // References diff --git a/nextflow_schema.json b/nextflow_schema.json index e8690f2..ffe8313 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,18 +10,13 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": ["outdir", "databases"], + "required": ["outdir", "databases", "input"], "properties": { - "pep": { - "type": "string", - "format": "file-path", - "pattern": "^\\S+\\.yaml$" - }, "input": { "type": "string", "format": "file-path", "mimetype": "text/csv", - "pattern": "^\\S+\\.csv$", + "pattern": "^\\S+\\.(csv|yaml)$", "schema": "assets/schema_input.json", "description": "Path to comma-separated file containing information about the samples and libraries/runs.", "help_text": "You will need to create a design file with information about the samples and libraries/runs you want to running in your pipeline run. Use this parameter to specify its location. It has to be a comma-separated file with 6 columns, and a header row. See [usage docs](https://nf-co.re/taxprofiler/usage#samplesheet-input).", diff --git a/workflows/taxprofiler.nf b/workflows/taxprofiler.nf index 76cc83c..b88b286 100644 --- a/workflows/taxprofiler.nf +++ b/workflows/taxprofiler.nf @@ -17,23 +17,22 @@ def checkPathParamList = [ params.input, params.databases, params.hostremoval_re for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } } // Check mandatory parameters -if (params.input) { +if ( params.input.endsWith(".yaml") ) { + + if ( params.input.startsWith("http://") || params.input.startsWith("https://") ) { + ch_input = file(params.input) + ch_pep_input_base_dir = [] + } + else { + ch_input = file(params.input) + ch_pep_input_base_dir = new File(params.input).getParent() + } + +} else if ( params.input.endsWith(".csv") ) { ch_input = file(params.input) ch_pep_input_base_dir = [] -} else if (params.pep) { - - if ( params.pep.startsWith("http://") || params.pep.startsWith("https://") ) { - ch_input = file(params.pep) - ch_pep_input_base_dir = [] - } - - else { - ch_input = file(params.pep) - ch_pep_input_base_dir = new File(params.pep).getParent() - } - -} else { +} else { exit 1, 'Input samplesheet or PEP config not specified!' }