-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional include are not expected to work #201
Comments
It does work indeed because the CI tests each of these independently. Will need to remember why I done things this way but I suspect it was because |
Yep, so the problem is that if I move the
Not sure I am making sense 😅 Let me try a couple of things. |
I warn you this can stop at any time, this was never meant to work in this way |
I agree. If you don't think it's a good idea then we need to find a fix 🛠️ So I had to move that conditional logic to within the workflow's themselves and these are the minimal changes I can make to get everything working f889766 How does that look? |
@pditommaso will it work if the e.g. if (params.public_data_ids) {
include { SRA_DOWNLOAD } from "${moduleDir}/workflows/sra_download"
}
else if (params.platform == 'illumina') {
include { ILLUMINA } from "${moduleDir}/workflows/illumina.nf"
}
else {
include { NANOPORE } from "${moduleDir}/workflows/nanopore"
}
workflow NFCORE_VIRALRECON {
if (params.public_data_ids) {
SRA_DOWNLOAD ()
} else if (params.platform == 'illumina') {
ILLUMINA ()
} else if (params.platform == 'nanopore') {
NANOPORE ()
}
} |
That should be ok, but what's the real need of condition inclusion? |
This 👇
|
Much better solution @JoseEspinosa 👍🏽 Reverted to that here 40d520e |
Tests are happy again. Thanks for pointing this out @pditommaso :) Will remember to change this elsewhere too. |
Can you point out an example? |
So both the |
@pditommaso I modified the example I added on the nextflow issue I opened yesterday. If you run: nextflow run main.nf --skip_foo Due to the validation trigger by the inclusion of the FOO N E X T F L O W ~ version 21.04.0
Launching `main.nf` [mighty_wescoff] - revision: 71cf30c291
WARN: Access to undefined parameter `foo` -- Initialise it to a default value eg. `params.foo = some_value`
Missing foo parameter This is solved by putting the |
I think we should introduce a |
Sounds interesting. How would something like that look? Would it be something implemented in native NF or in the pipeline? |
Yeah, also curious 🤓 |
Don't think this pattern is a good idea, if it works it's a bug!
viralrecon/main.nf
Lines 55 to 72 in a85d596
The text was updated successfully, but these errors were encountered: