-
Notifications
You must be signed in to change notification settings - Fork 57
Refactor main-nf -II #768
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
Refactor main-nf -II #768
Conversation
|
fellen31
left a comment
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.
💯
main.nf
Outdated
| /** | ||
| * Creates a channel from a file path, maps it to [id, file] format, and collects | ||
| * @param filePath The path to the file (can be null) | ||
| * @param doubleEmpty If true, returns channel.value([[:], []]) when filePath is null; otherwise returns channel.empty() (default: false) | ||
| * @param customId The custom ID to be used in meta.id (default: null) | ||
| * @return Channel with [[id:name], file] format and collected, or fallback channel | ||
| */ | ||
| def channelFromPathWithMeta(filePath, doubleEmpty = false, customId = null) { | ||
| if (!filePath) { | ||
| return doubleEmpty ? channel.value([[:], []]) : channel.empty() | ||
| } | ||
| return channel.fromPath(filePath).map { file -> | ||
| def meta_id = customId ?: file.simpleName | ||
| return [[id: meta_id], file] | ||
| }.collect() | ||
| } |
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.
Any thought on having these functions here vs. in utils_nfcore_raredisease_pipeline?
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.
Not really. But best to keep it all in one place I guess 😅
Moved the functions to utils now
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.
👌
PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile test_singleton,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).