These are chat archives for nextflow-io/nextflow

5th
Feb 2019
Chadi Saad
@chadisaad
Feb 05 10:57
Hello everyone. I have a question regarding the params definition. that's my problem:
in my nextflow.config I have params{flag=true}. In my script.nf, I try to redefine params.flag = false, but it still = true. Is thats a question of priority nextflow.config > script.nf ?
Paolo Di Tommaso
@pditommaso
Feb 05 10:58
yes, the priority is: command line > config > script
Chadi Saad
@chadisaad
Feb 05 10:59
Thanks Paolo !
Paolo Di Tommaso
@pditommaso
Feb 05 10:59
welcome
Reka Toth
@tkik
Feb 05 12:13
Hi everyone. I am setting up a nf-core methylation pipeline on our lsf cluster. It will be used by different users, so I thought I will remove the params{} part of the nextflow.config file and move it to a separate config file. So the users only have to set the parameters in a separate config file, not touching the nextflow.config. They can then start the pipeline with specifying their config file with the -c option. I don't want to use the includeConfig in the nextflow.config, because it would still mean that they have to modify it every time they want to run something. Unfortunately, it doesn't work, it doesn't see the parameters defined in the custom config file... It is complaining about e.g. missing the outDir. Any idea, why doesn't it work? Or any other solution to manage the users' config files?
Luca Cozzuto
@lucacozzuto
Feb 05 12:14
have a look here
you need to include it in the config file
ah sorry you DON'T want this :)
Reka Toth
@tkik
Feb 05 12:18
I have a params.config file very similar to this, but yes, I would like to make it work without adding to the nextflow.config. :)
Luca Cozzuto
@lucacozzuto
Feb 05 12:18
I see a -params-file option that is not documented
in nextflow run
   Load script parameters from a JSON/YAML file
maybe this is what you need
Reka Toth
@tkik
Feb 05 12:20
Yes, it seems like it. I will give it a try, thanks! Any idea why the -c option is not working?
Luca Cozzuto
@lucacozzuto
Feb 05 12:20
-c is for specifying a new nextflow.config file
so you want to embed the parameters inside the config file?
Reka Toth
@tkik
Feb 05 12:22
I did. I have in the config file and I used the -c in the command line to make the pipeline use this config file. But it doesn't see the parameters defined in it...
Luca Cozzuto
@lucacozzuto
Feb 05 12:22
I think it should work... I don't know why is complaining. Do you have a test case?
Reka Toth
@tkik
Feb 05 12:44
Hmm. It seems it really should work. I set up a small test case for you and it turns out it works as expected... Maybe I will then try to ask the nf-core guys (the pipeline I have this problem with) for help.
Thanks a lot!
Reka Toth
@tkik
Feb 05 13:04
Sounds great! I need to go there :) Thanks!
Alexander Peltzer
@apeltzer
Feb 05 13:04
Yup, just come by :+1:
Paolo Di Tommaso
@pditommaso
Feb 05 13:05
social media works ! :wink:
Alexander Peltzer
@apeltzer
Feb 05 13:05
It does ;-)
Thomas Van Parys
@thpar
Feb 05 13:15
The join() method behaves unexpectedly when the second channel appears to be empty.
With remainder: true, I'd think I'd just get the first channel as result. Instead I'm getting only the keys.
Would there be a way around this? Or should I somehow detect that my second channel will stay empty?
Paolo Di Tommaso
@pditommaso
Feb 05 13:18
not sure to understand, please provide a test case
Alexander Peltzer
@apeltzer
Feb 05 13:19
Thomas Van Parys
@thpar
Feb 05 13:21
left = Channel.from(['X', 1], ['Y', 2], ['Z', 3], ['P', 7])
right= Channel.from(['Z', 6], ['Y', 5], ['X', 4])
left.join(right, remainder: true).println()

this outputs:

[Y, 2, 5]
[Z, 3, 6]
[X, 1, 4]
[P, 7, null]

(keeping the unmatched ['P', 7] as expected.

Paolo Di Tommaso
@pditommaso
Feb 05 13:21
so far so good
Thomas Van Parys
@thpar
Feb 05 13:22

but if right is empty:

right= Channel.empty()

I don't get the unmatched left items. Instead the output is:

X
Y
Z
P
which is kind of unexpected
I'm running into this issue in a use case where, because of a filter, my second channel doesn't emit any items.
Paolo Di Tommaso
@pditommaso
Feb 05 13:25
umm, interesting, you may want to fill a bug for that
Thomas Van Parys
@thpar
Feb 05 13:34
Ok, will do.
Paolo Di Tommaso
@pditommaso
Feb 05 13:34
thanks