Skip to content

Commit

Permalink
Quote paths in Nextflow script to handle spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
thalassemia committed Nov 28, 2024
1 parent 099f520 commit e636624
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions runscripts/nextflow/analysis.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ process analysisSingle {
--lineage_seed $lineage_seed \\
--generation $generation \\
--agent_id "$agent_id" \\
--variant_metadata_path ${variant_metadata} \\
-o \$(pwd)/plots \\
--variant_metadata_path "${variant_metadata}" \\
-o "\$(pwd)/plots" \\
-t single
cd plots
cd experiment_id=*
Expand Down Expand Up @@ -71,8 +71,8 @@ process analysisMultiDaughter {
--variant $variant \\
--lineage_seed $lineage_seed \\
--generation $generation \\
--variant_metadata_path ${variant_metadata} \\
-o \$(pwd)/plots \\
--variant_metadata_path "${variant_metadata}" \\
-o "\$(pwd)/plots" \\
-t multidaughter
cd plots
cd experiment_id=*
Expand Down Expand Up @@ -116,8 +116,8 @@ process analysisMultiGeneration {
--experiment_id "$experiment_id" \\
--variant $variant \\
--lineage_seed $lineage_seed \\
--variant_metadata_path ${variant_metadata} \\
-o \$(pwd)/plots \\
--variant_metadata_path "${variant_metadata}" \\
-o "\$(pwd)/plots" \\
-t multigeneration
cd plots
cd experiment_id=*
Expand Down Expand Up @@ -159,8 +159,8 @@ process analysisMultiSeed {
--validation_data_path "$kb/validationData.cPickle" \\
--experiment_id "$experiment_id" \\
--variant $variant \\
--variant_metadata_path ${variant_metadata} \\
-o \$(pwd)/plots \\
--variant_metadata_path "${variant_metadata}" \\
-o "\$(pwd)/plots" \\
-t multiseed
cd plots
cd experiment_id=*
Expand Down Expand Up @@ -199,8 +199,8 @@ process analysisMultiVariant {
--validation_data_path "$kb/validationData.cPickle" \\
--experiment_id "$experiment_id" \\
--variant ${variant.join(" ")} \\
--variant_metadata_path ${variant_metadata} \\
-o \$(pwd)/plots \\
--variant_metadata_path "${variant_metadata}" \\
-o "\$(pwd)/plots" \\
-t multivariant
cd plots
cd experiment_id=*
Expand Down
4 changes: 2 additions & 2 deletions runscripts/nextflow/sim.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ process simGen0 {
PYTHONPATH=${params.projectRoot} python ${params.projectRoot}/ecoli/experiments/ecoli_master_sim.py \\
--config $config \\
--sim_data_path $sim_data \\
--daughter_outdir \$(pwd) \\
--daughter_outdir "\$(pwd)" \\
--variant ${sim_data.getBaseName()} \\
--seed ${lineage_seed} \\
--lineage_seed ${lineage_seed} \\
Expand Down Expand Up @@ -79,7 +79,7 @@ process sim {
--config $config \\
--sim_data_path $sim_data \\
--initial_state_file ${initial_state.getBaseName()} \\
--daughter_outdir \$(pwd) \\
--daughter_outdir "\$(pwd)" \\
--variant ${sim_data.getBaseName()} \\
--seed ${sim_seed} \\
--lineage_seed ${lineage_seed} \\
Expand Down
12 changes: 6 additions & 6 deletions runscripts/nextflow/template.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process runParca {

script:
"""
PYTHONPATH=${params.projectRoot} python ${params.projectRoot}/runscripts/parca.py --config $config -o \$(pwd)
PYTHONPATH=${params.projectRoot} python ${params.projectRoot}/runscripts/parca.py --config "$config" -o "\$(pwd)"
"""

stub:
Expand All @@ -37,10 +37,10 @@ process analysisParca {

script:
"""
PYTHONPATH=${params.projectRoot} python ${params.projectRoot}/runscripts/analysis.py --config $config \
--sim_data_path=$kb/simData.cPickle \
--validation_data_path=$kb/validationData.cPickle \
-o \$(pwd)/plots \
PYTHONPATH=${params.projectRoot} python ${params.projectRoot}/runscripts/analysis.py --config "$config" \
--sim_data_path="$kb/simData.cPickle" \
--validation_data_path="$kb/validationData.cPickle" \
-o "\$(pwd)/plots" \
-t parca
"""

Expand All @@ -66,7 +66,7 @@ process createVariants {
script:
"""
PYTHONPATH=${params.projectRoot} python ${params.projectRoot}/runscripts/create_variants.py \
--config $config --kb $kb -o \$(pwd)
--config "$config" --kb "$kb" -o "\$(pwd)"
"""

stub:
Expand Down

0 comments on commit e636624

Please sign in to comment.