Skip to content
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

Test how variable numbers of inputs and outputs work #6

Closed
ewels opened this issue Dec 5, 2019 · 5 comments
Closed

Test how variable numbers of inputs and outputs work #6

ewels opened this issue Dec 5, 2019 · 5 comments
Labels
question Further information is requested

Comments

@ewels
Copy link
Member

ewels commented Dec 5, 2019

Need to look in to how Nextflow DSL2 handles variable numbers of inputs or outputs.

For example - TrimGalore! can optionally save untrimmed reads. If that is enabled, we will have an additional output channel. How do pipelines handle this?

@ewels ewels added the question Further information is requested label Dec 5, 2019
@ewels ewels mentioned this issue Dec 5, 2019
@drpatelh
Copy link
Member

drpatelh commented Dec 5, 2019

Yeah, this is going to be tricky. Pipelines will want to use the module command in different ways so we will have to try and anticipate different numbers/types of inputs and outputs. Should this be done on a case-by-case basis? e.g. add the option for a another input/output whilst maintaining backward compatability?

With DSL1 the way I have provided conditional inputs is:
https://github.com/nf-core/chipseq/blob/21be3149542cdc84431e12d1e092359058aed32a/main.nf#L424

and conditional outputs as:
https://github.com/nf-core/chipseq/blob/21be3149542cdc84431e12d1e092359058aed32a/main.nf#L1087

Note all of the files dont have to be created as an output here and so NF wont fail if they arent. Maybe the solution is to have all outputs from a module in a single channel and then filter as required but this could get messy...

@ewels
Copy link
Member Author

ewels commented Dec 5, 2019

I think DSLv2 can have named outputs, right? So I'm hoping that if pipelines specify the output channels that they are using, they can ignore the ones that they don't need. Then we can just allow those channels to be empty and I think everything should be fine... 🤞

The conditional input ifEmpty() thing shouldn't be necessary... I think... because with modules you don't specify the input channel name. Not sure though.

I think the one channel for everything isn't necessary if we use optional outputs and named outputs in the workflows.

Make sense? Bit scatterbrained today sorry - say if the above is jumbled jibberish 😆

@drpatelh
Copy link
Member

drpatelh commented Dec 5, 2019

No. That makes sense. Like most things "modules" this will need a play around to work out how best to proceed. I need to fix up and look sharp with DSL2 too. Maybe we can try with a simple TrimGalore implementation?

@apeltzer
Copy link
Member

apeltzer commented Dec 5, 2019

Yes I agree - we should really get some "basic" tests for this and play around a bit to get a feeling for how this behaves. During the discussion we all kind of agreed its got lots of potential for problems arising, which is why Phil created the issue here 👍

@ewels ewels added this to DSLv2 conversion in hackathon-crick-2020 Mar 2, 2020
grst added a commit that referenced this issue Jul 14, 2020
@drpatelh
Copy link
Member

drpatelh commented Mar 26, 2021

We have a requirement to emit every output file which solves this issue. Where required, we are using the optional declaration for optional outputs.

We still don't have a proper solution for optional inputs but this will have to be announced officially on the Nextflow end

muffato pushed a commit that referenced this issue Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
No open projects
hackathon-crick-2020
DSLv2 conversion
Development

No branches or pull requests

3 participants