Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pditommaso
Copy link
Contributor

@pditommaso pditommaso commented Oct 18, 2018

In the nf-core pipeline there's some recurrent boilerplate. Although, this is not a big problem per se, the NF idea is to have clear readable code, focused on the main pipeline logic. Ideally we would not like to have infrastructure depend code.

Only possible solution to modularise and hide some chunks of code is to use a simple helper class containing some custom methods that can be be imported in the main pipeline script.

I'm sending this PR to get your feedback on this possible solution. It still can be improved removing the need to pass some implicit objects such workflow, params and baseDir, but it gives a good idea how common routines could be encapsulated and reused.

Feedback is welcome.

@ewels
Copy link
Member

ewels commented Oct 18, 2018

Yes - definitely a good idea. I've been thinking of moving a lot of this into separate files for a while but not played with it yet.

Almost everything in this PR can hopefully just be deleted due to new core nextflow features though, which is even better! 🎉 The nextflow version validation is now built in, as is email support and the hostname check is related to nextflow-io/nextflow#792

Only other thing that could be put into its own file is the help message I think. But I wonder if it's kind of useful having this in the same file so that it doesn't get forgotten.

@pditommaso
Copy link
Contributor Author

True. I think only the mail message/attachment composition would still requires some boilerplate code that would requires this kind of approach.

@ewels
Copy link
Member

ewels commented May 7, 2021

It took us a long time, but we have finally now done this in the nf-core template 🧹 ✨

@ewels ewels closed this May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants