Skip to content

Instantly share code, notes, and snippets.

@elowy01
Last active May 7, 2020 14:26
Show Gist options
  • Save elowy01/b2e83f6d1517bfdf47fb3159563a0230 to your computer and use it in GitHub Desktop.
Save elowy01/b2e83f6d1517bfdf47fb3159563a0230 to your computer and use it in GitHub Desktop.
#!/usr/bin/env nextflow
params.samplel = false
process test_sample {
when:
params.sample
script:
"""
echo "sample"
"""
}
process test_sample_list {
when:
params.samplel
script:
"""
echo "sample list"
"""
}
//Other example:
// There is the option of running the script with a single sample passed
// in command line or passing a file with sample ids
params.sample = false
params.samplel = false
process test_sample {
when:
params.sample
script:
"""
echo "sample"
"""
}
if (params.samplel) {
Channel.fromPath(params.samplel)
.splitText()
.set { sample_list }
process test_sample_list {
input:
val s from sample_list
when:
params.samplel
script:
"""
echo "sample list: $s"
"""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment