Skip to content

Commit

Permalink
refactor: ica handling CDCgov#149
Browse files Browse the repository at this point in the history
  • Loading branch information
slsevilla committed Mar 31, 2024
1 parent f0876a8 commit 4e8df4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ workflow PHOENIX {
//input on command line
if (params.input) { ch_input = file(params.input) } else { exit 1, 'For -entry PHOENIX: Input samplesheet not specified!' }
ch_versions = Channel.empty() // Used to collect the software versions
if (params.ica != true && params.ica != false) {exit 1, "Please set params.ica to either \"true\" if running on ICA or \"false\" for all other methods."}

main:
PHOENIX_EXTERNAL ( ch_input, ch_versions, true )
Expand Down
9 changes: 3 additions & 6 deletions modules/local/samplesheet_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ process SAMPLESHEET_CHECK {
path("versions.yml"), emit: versions

script: // This script is bundled with the pipeline, in cdcgov/phoenix/bin/
// Adding if/else for if running on ICA it is a requirement to state where the script is, however, this causes CLI users to not run the pipeline from any directory.
if (params.ica==false) { ica = "" }
else if (params.ica==true) { ica = "python ${workflow.launchDir}/bin/" }
else { error "Please set params.ica to either \"true\" if running on ICA or \"false\" for all other methods." }
// define variables
def container_version = "base_v2.1.0"
def container = task.container.toString() - "quay.io/jvhagey/phoenix@"
def script = params.ica ? "python ${params.ica_path}/check_samplesheet.py" : "check_samplesheet.py"
"""
${ica}check_samplesheet.py \\
${script} \\
$samplesheet \\
samplesheet.valid.csv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | sed 's/Python //g')
check_samplesheet.py: \$(${ica}check_samplesheet.py --version )
check_samplesheet.py: ${script} --version )
phoenix_base_container_tag: ${container_version}
phoenix_base_container: ${container}
END_VERSIONS
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ params {
// Terra and ICA specific options
terra = false
ica = false
ica_path = "${launchDir}/bin/"

// Database paths
//path2db = "${baseDir}/assets/databases" // need this for kraken2db if you place those files in the assets folder
Expand Down

0 comments on commit 4e8df4c

Please sign in to comment.