mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-11 00:53:09 +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",
|
||||
"fa_icon": "fas fa-terminal",
|
||||
"description": "Define where the pipeline should find input data and save output data.",
|
||||
"required": [ "input", "outdir", "databases"],
|
||||
"required": ["input", "outdir", "databases"],
|
||||
"properties": {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"format": "file-path",
|
||||
"mimetype": "text/csv",
|
||||
"pattern": "^\\S+\\.(csv|yaml)$",
|
||||
"pattern": "^\\S+\\.(csv|yaml|yml)$",
|
||||
"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).",
|
||||
|
|
|
@ -9,11 +9,11 @@ include { EIDO_CONVERT } from '../../modules/nf-core/modules/eido/convert/main'
|
|||
workflow INPUT_CHECK {
|
||||
take:
|
||||
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:
|
||||
EIDO_VALIDATE ( samplesheet_or_pep_config, file("$projectDir/assets/samplesheet_schema.yaml"), ch_pep_input_base_dir )
|
||||
converted_samplesheet = EIDO_CONVERT ( samplesheet_or_pep_config, "csv", 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", pep_input_base_dir )
|
||||
parsed_samplesheet = SAMPLESHEET_CHECK ( converted_samplesheet.samplesheet_converted )
|
||||
.csv
|
||||
.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) } }
|
||||
|
||||
// Check mandatory parameters
|
||||
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 = []
|
||||
|
||||
if ( params.input ) {
|
||||
ch_input = file(params.input, checkIfExists: true)
|
||||
pep_input_base_dir = file(params.input).extension.matches("yaml|yml") ? file(file(params.input).getParent(), checkIfExists: true) : []
|
||||
} 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!' }
|
||||
|
@ -116,7 +104,7 @@ workflow TAXPROFILER {
|
|||
SUBWORKFLOW: Read in samplesheet, validate and stage input files
|
||||
*/
|
||||
INPUT_CHECK (
|
||||
ch_input, ch_pep_input_base_dir
|
||||
ch_input, pep_input_base_dir
|
||||
)
|
||||
ch_versions = ch_versions.mix(INPUT_CHECK.out.versions)
|
||||
|
||||
|
|
Loading…
Reference in a new issue