Skip to content

Commit

Permalink
param checking for ncbimeta update channels
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Feb 27, 2020
1 parent 1b950c7 commit 1930b37
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,15 @@ if(params.ncbimeta_update){
ch_ncbimeta_annot_update = Channel.fromPath(params.ncbimeta_annot, checkIfExists: true)
.ifEmpty { exit 1, "NCBImeta annotation file not found: ${params.ncbimeta_annot}" }

ch_ncbimeta_sqlite_update = Channel.fromPath("${params.ncbimeta_sqlite_db_latest}", checkIfExists: true)
// If the database isn't being created in the same pipeline run, create channel from file path
if(!params.ncbimeta_create){
ch_ncbimeta_sqlite_update = Channel.fromPath("${params.ncbimeta_sqlite_db_latest}", checkIfExists: true)
.ifEmpty { exit 1, "NCBImeta SQLite database not found: ${params.ncbimeta_sqlite_db_latest}" }
}
// If the database is being created just before, use from input channel
else{
ch_ncbimeta_sqlite_update = ch_ncbimeta_sqlite_create
}

input:
file ncbimeta_yaml from ch_ncbimeta_yaml_update
Expand Down Expand Up @@ -231,9 +238,8 @@ process sqlite_import{
publishDir "${params.outdir}/sqlite_import", mode: 'copy'

// Set the sqlite channel to create or update depending on ncbimeta mode
// Update needs to happen so we can have the master table?
if(params.ncbimeta_create){ch_sqlite = ch_ncbimeta_sqlite_create}
else if(params.ncbimeta_update){ch_sqlite = ch_ncbimeta_sqlite_update}
// Only options are update or sqlite, no just create? Because we need Master Table Join
if(params.ncbimeta_update){ch_sqlite = ch_ncbimeta_sqlite_update}
else if(params.sqlite)
{
ch_sqlite = Channel.fromPath(params.sqlite, checkIfExists: true)
Expand Down

0 comments on commit 1930b37

Please sign in to comment.