mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 08:19:54 +00:00
Update workflows/taxprofiler.nf
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
parent
0ccbf50938
commit
1584d6fc51
3 changed files with 10 additions and 22 deletions
|
@ -10,13 +10,13 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"fa_icon": "fas fa-terminal",
|
"fa_icon": "fas fa-terminal",
|
||||||
"description": "Define where the pipeline should find input data and save output data.",
|
"description": "Define where the pipeline should find input data and save output data.",
|
||||||
"required": [ "input", "outdir", "databases"],
|
"required": ["input", "outdir", "databases"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"input": {
|
"input": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "file-path",
|
"format": "file-path",
|
||||||
"mimetype": "text/csv",
|
"mimetype": "text/csv",
|
||||||
"pattern": "^\\S+\\.(csv|yaml)$",
|
"pattern": "^\\S+\\.(csv|yaml|yml)$",
|
||||||
"schema": "assets/schema_input.json",
|
"schema": "assets/schema_input.json",
|
||||||
"description": "Path to comma-separated file containing information about the samples and libraries/runs.",
|
"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).",
|
"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).",
|
||||||
|
|
|
@ -9,11 +9,11 @@ include { EIDO_CONVERT } from '../../modules/nf-core/modules/eido/convert/main'
|
||||||
workflow INPUT_CHECK {
|
workflow INPUT_CHECK {
|
||||||
take:
|
take:
|
||||||
samplesheet_or_pep_config // file: /path/to/samplesheet.csv or /path/to/pep/config.yaml
|
samplesheet_or_pep_config // file: /path/to/samplesheet.csv or /path/to/pep/config.yaml
|
||||||
ch_pep_input_base_dir
|
pep_input_base_dir
|
||||||
|
|
||||||
main:
|
main:
|
||||||
EIDO_VALIDATE ( samplesheet_or_pep_config, file("$projectDir/assets/samplesheet_schema.yaml"), ch_pep_input_base_dir )
|
EIDO_VALIDATE ( samplesheet_or_pep_config, file("$projectDir/assets/samplesheet_schema.yaml"), pep_input_base_dir )
|
||||||
converted_samplesheet = EIDO_CONVERT ( samplesheet_or_pep_config, "csv", ch_pep_input_base_dir )
|
converted_samplesheet = EIDO_CONVERT ( samplesheet_or_pep_config, "csv", pep_input_base_dir )
|
||||||
parsed_samplesheet = SAMPLESHEET_CHECK ( converted_samplesheet.samplesheet_converted )
|
parsed_samplesheet = SAMPLESHEET_CHECK ( converted_samplesheet.samplesheet_converted )
|
||||||
.csv
|
.csv
|
||||||
.splitCsv ( header:true, sep:',' )
|
.splitCsv ( header:true, sep:',' )
|
||||||
|
|
|
@ -17,23 +17,11 @@ def checkPathParamList = [ params.input, params.databases, params.hostremoval_re
|
||||||
for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } }
|
for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } }
|
||||||
|
|
||||||
// Check mandatory parameters
|
// Check mandatory parameters
|
||||||
if ( params.input.endsWith(".yaml") ) {
|
if ( params.input ) {
|
||||||
|
ch_input = file(params.input, checkIfExists: true)
|
||||||
if ( params.input.startsWith("http://") || params.input.startsWith("https://") ) {
|
pep_input_base_dir = file(params.input).extension.matches("yaml|yml") ? file(file(params.input).getParent(), checkIfExists: true) : []
|
||||||
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 {
|
} else {
|
||||||
exit 1, 'Input samplesheet or PEP config not specified!'
|
exit 1, "Input samplesheet, or PEP config and base directory not specified"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.databases) { ch_databases = file(params.databases) } else { exit 1, 'Input database sheet not specified!' }
|
if (params.databases) { ch_databases = file(params.databases) } else { exit 1, 'Input database sheet not specified!' }
|
||||||
|
@ -116,7 +104,7 @@ workflow TAXPROFILER {
|
||||||
SUBWORKFLOW: Read in samplesheet, validate and stage input files
|
SUBWORKFLOW: Read in samplesheet, validate and stage input files
|
||||||
*/
|
*/
|
||||||
INPUT_CHECK (
|
INPUT_CHECK (
|
||||||
ch_input, ch_pep_input_base_dir
|
ch_input, pep_input_base_dir
|
||||||
)
|
)
|
||||||
ch_versions = ch_versions.mix(INPUT_CHECK.out.versions)
|
ch_versions = ch_versions.mix(INPUT_CHECK.out.versions)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue