Skip to content

Instantly share code, notes, and snippets.

@lindenb
Created September 11, 2023 07:01
Show Gist options
  • Save lindenb/c49638bd42cb173a30aa7f5ccd7b50fe to your computer and use it in GitHub Desktop.
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
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}"
"""
}
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