Created
September 11, 2023 07:01
-
-
Save lindenb/c49638bd42cb173a30aa7f5ccd7b50fe to your computer and use it in GitHub Desktop.
https://www.biostars.org/p/9574590/ Nextflow - How to pass the yml yaml format input file from an argument to channel as a list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params.samples="NO_FILE" | |
workflow { | |
ch = Channel.fromPath(params.samples). | |
flatMap(F->{ | |
def yaml = new org.yaml.snakeyaml.Yaml(); | |
def map = yaml.load(F); | |
return map.samples; | |
}); | |
doIt(ch) | |
} | |
process doIt { | |
tag "${row.biosample_id} = ${row.bam}" | |
input: | |
val(row) | |
script: | |
""" | |
echo "${row.biosample_id} = ${row.bam}" | |
""" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samples: | |
- | |
biosample_id: WGS001 | |
bam: WGS001.bam | |
- | |
biosample_id: WGS0002 | |
bam: NWGS0002.bam |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment