nextflow-io / patterns

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

Typo for "Process when empty"? #38

Closed nick-youngblut closed 1 year ago

nick-youngblut commented 1 year ago

Current example for process-when-empty:

params.inputs = ''

process foo {
  debug true  
  input:
  val x
  when:
  x ## 'EMPTY'

  script:
  '''
  echo hello
  ''' 
}

workflow {
  reads_ch = params.inputs
    ? Channel.fromPath(params.inputs, checkIfExists:true)
    : Channel.empty()

  reads_ch \
    | ifEmpty { 'EMPTY' } \
    | foo
}

I'm guessing that x ## 'EMPTY' should be x == 'EMPTY'

pditommaso commented 1 year ago

Yes, definitively. Thanks for reporting it

mribeirodantas commented 1 year ago

Fixed by https://github.com/nextflow-io/patterns/commit/9d66fbd39813f5b1139ea0cafceb02018b0c0109