How to pass the yml
format input file from an argument to a channel samples
as a list? Appreciate if any nextflow function or simple solution to make the channel samples
works with --input_list s3://my-bucket/params.yml
instead of -params-file s3://my-bucket/params.yml
The given below channel samples
code works with -params-file s3://my-bucket/params.yml
but that's not I'm looking.
$ nextflow run main.nf \ -config nextflow.config \ --input_list s3://my-bucket/params.yml \ --publish_dir ./output
--input_list s3://my-bucket/params.yml
samples:
-
biosample_id: WGS001
bam: WGS001.bam
-
biosample_id: WGS0002
bam: NWGS0002.bam
workflow
Channel
.fromList( params.samples )
.ifEmpty { ['biosample_id': params.biosample_id, 'bam': params.bam] }
.set { samples }
Channel
samples.branch { rec ->
....
Channel
samples.map { it.biosample_id }
....
How come undocumented? https://www.nextflow.io/docs/latest/cli.html?highlight=params%20file
There are even examples over there.
You are right, last time I looked into this it was still undocumented.
I want to pass the input file through an argument unfortunately not with
params-file
, reason being unable to use theparams-file
in the nftower dashboard underPipeline parameters
field which is equivalent toparams-file
option allowing to paste the json/yaml file in the field but it has a charcters limitation to give large number of samples list. To overcome this I need to give the input file with an arg like.insput_list: s3://my-bucket/params.yaml
I'd recommend to use a csv file to give out input file instead. This is what we do most of the time in nf-core nowadays.