-
Notifications
You must be signed in to change notification settings - Fork 74
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
DSL2+ #312
base: dev
Are you sure you want to change the base?
DSL2+ #312
Conversation
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Closing in favor of #309
Based on discussions with the community, I have concluded that the other proposed changes (use params only in entry workflow, remove ext config, workflow outputs) will be much easier to do with static types, so I'm not going to push for it very much in the meantime. IMO it makes more sense to wait for static types and refactor your pipeline once, rather than refactor now with suboptimal syntax and then refactor again in a year, which wouldn't bring much benefit, especially now with the language server. I do encourage fetchngs to go ahead and update where appropriate, but we can pursue these changes in smaller pieces, in particular:
|
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
|
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
I have revived this PR and rescoped it to what we can do now with Nextflow 24.10 -- see the updated PR description. Let me know what you guys think. |
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
main.nf
Outdated
def dirs = [ | ||
'fastq': 'fastq', | ||
'md5': 'fastq/md5' | ||
] | ||
return { file -> "${dirs[file.extension]}/${file.name}" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more explicit way to write this could be as a list of source-target pairs:
def files = [
sample.fastq_1,
sample.fastq_2,
sample.md5_1,
sample.md5_2
]
def dirs = [
'fastq': 'fastq',
'md5': 'fastq/md5'
]
return files
.findAll { file -> file != null }
.collect { file ->
[ file, "${dirs[file.extension]}/${file.name}" ]
}
It's more verbose but it spells out more clearly what it going on. But as long as Nextflow can infer the files
list automatically, the user should only need to return the mapping closure
Signed-off-by: Ben Sherman <[email protected]>
This PR refactors the fetchngs pipeline to use some of the newest features in Nextflow and follow some recommended practices. All of these changes should be possible with Nextflow 24.10.
Use strict syntax. Currently enforced by the language server, will be enforced by Nextflow in the future. Some of these changes might need to be applied to the upstream pipeline template.
Use params in top-level workflow. Pass params into processes and workflows as explicit inputs.
Use eval output, topic channels to collect tool versions. Simplify the collection of tool versions, removes lots of boilerplate from processes and workflows.
Replace publishDir with workflow outputs. Move publish definition to workflow level by publishing channels. Use the index file feature to generate the samplesheet.