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

Workflow output DSL (channel selectors) #302

Closed
wants to merge 3 commits into from

Conversation

bentsherman
Copy link

Alternative to #275 which uses workflow output channels instead of process selectors

@bentsherman bentsherman changed the base branch from master to dev March 15, 2024 17:32
@nf-core nf-core deleted a comment from github-actions bot Mar 15, 2024
@bentsherman
Copy link
Author

My initial reaction is... I guess we could implement both and see where users land? It would be confusing to have both approaches, but not as confusing as I originally thought

@bentsherman bentsherman marked this pull request as draft March 15, 2024 17:38
@pinin4fjords
Copy link
Member

This is is sooooo much better IMO. Bye bye process selectors and file globbing! Thanks @bentsherman .

I was hoping we'd be able to incorporate this into the emit somehow:

emit:
runinfo_tsv = SRA.out.runinfo_tsv, publish = '/path/to/dir'

But that's based on next to no understanding of how the Groovy internals work, so what you have here makes me happy.

I am wary of implementing both, purely because people would then use both and we'd end up in Perl-like wild west situations with mutually incomprehensible code.

Comment on lines 207 to +215
emit:
runinfo_tsv = ch_runinfo_tsv
fastq = ch_fastq
fastq_md5 = ch_fastq_md5
samplesheet = ch_samplesheet
mappings = ch_mappings
sample_mappings = ch_sample_mappings_yml
sra_metadata = ch_sra_metadata
versions = ch_versions.unique()
versions_yml = ch_versions_yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this requires more code to return the channels, I think overall the code will improve as people have to start thinking about their workflows as functional units.

Comment on lines +8 to +10
properties:
sample:
type: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this information be encoded in the output block? We could generate this with the output, instead of alongside it.

It feels kinda redundant having to maintain a separate file which only does output validation. On the other hand, it might get very messy in the output declaration if you are having to type everything.

@bentsherman bentsherman changed the title Workflow output DSL (alternative) Workflow output DSL (channel selectors) Mar 19, 2024
@adamrtalbot
Copy link
Contributor

I didn't say this directly, but I think this is 10000% times better than the solution based on process names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants