nextflow-io / patterns

A curated collection of Nextflow implementation patterns
http://nextflow-io.github.io/patterns/
MIT License
329 stars 72 forks source link

Update optional-input.md so it doesn't fail on Batch #45

Closed odoublewen closed 1 year ago

odoublewen commented 1 year ago

Updates the solution according to https://github.com/nextflow-io/nextflow/issues/1645#issuecomment-648396928

bentsherman commented 1 year ago
odoublewen commented 1 year ago

Updated optional-input.nf and also replaced both instances of deprecated baseDir with projectDir everywhere in both the .md and .nf file.

Confirmed it works:

$ nextflow run optional-input.nf 
N E X T F L O W  ~  version 22.10.0
Launching `optional-input.nf` [sharp_fermat] DSL2 - revision: 663aa00679
executor >  local (3)
[ec/66da87] process > foo (2) [100%] 3 of 3 ✔
your_commad --input prot_2.fa

your_commad --input prot_1.fa

your_commad --input prot_3.fa

$ nextflow run optional-input.nf --filter foo.txt
N E X T F L O W  ~  version 22.10.0
Launching `optional-input.nf` [sharp_wescoff] DSL2 - revision: 663aa00679
executor >  local (3)
[c3/f7795c] process > foo (3) [100%] 3 of 3 ✔
your_commad --input prot_3.fa --filter foo.txt

your_commad --input prot_2.fa --filter foo.txt

your_commad --input prot_1.fa --filter foo.txt