Skip to content

Commit

Permalink
he accession number is in fact mutually exclusive of the yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
muffato committed May 17, 2024
1 parent 51bf1b1 commit 052be1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"type": "object",
"fa_icon": "fas fa-dna",
"description": "Reference genome related files and options required for the workflow.",
"required": ["taxon", "accession", "fasta"],
"required": ["taxon", "fasta"],
"properties": {
"taxon": {
"type": ["string", "integer"],
Expand Down
6 changes: 4 additions & 2 deletions workflows/blobtoolkit.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true

// Check mandatory parameters
if (params.input) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' }
if (params.fasta && params.accession) { ch_fasta = Channel.value([ [ 'id': params.accession ], params.fasta ]) } else { exit 1, 'Genome fasta file and accession must be specified!' }
if (params.fasta) { ch_fasta = Channel.value([ [ 'id': params.accession ?: file(params.fasta).baseName ], file(params.fasta) ]) } else { exit 1, 'Genome fasta file must be specified!' }
if (params.taxon) { ch_taxon = Channel.of(params.taxon) } else { exit 1, 'NCBI Taxon ID not specified!' }
if (params.blastp) { ch_blastp = Channel.value([ [ 'id': file(params.blastp).baseName ], params.blastp ]) } else { exit 1, 'Diamond BLASTp database must be specified!' }
if (params.blastx) { ch_blastx = Channel.value([ [ 'id': file(params.blastx).baseName ], params.blastx ]) } else { exit 1, 'Diamond BLASTx database must be specified!' }
Expand All @@ -32,7 +32,9 @@ if (params.fetchngs_samplesheet && !params.align) { exit 1, '--align not specifi

// Create channel for optional parameters
if (params.busco_db) { ch_busco_db = Channel.fromPath(params.busco_db) } else { ch_busco_db = Channel.empty() }
if (params.yaml && params.accession) { ch_yaml = Channel.of([ [ 'id': params.accession ], params.yaml ]) } else { ch_yaml = Channel.empty() }
if (params.yaml) { ch_yaml = Channel.fromPath(file(params.yaml)) } else { ch_yaml = Channel.empty() }
if (params.yaml && params.accession) { exit 1, '--yaml cannot be provided at the same time as --accession !' }
if (!params.yaml && !params.accession) { exit 1, '--yaml and --accession are both mising. Pick one !' }

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 052be1c

Please sign in to comment.