PROOF OF CONCEPT: samtools/multicommand#11550
Draft
prototaxites wants to merge 6 commits intonf-core:masterfrom
Draft
PROOF OF CONCEPT: samtools/multicommand#11550prototaxites wants to merge 6 commits intonf-core:masterfrom
prototaxites wants to merge 6 commits intonf-core:masterfrom
Conversation
muffato
reviewed
May 7, 2026
Comment on lines
+80
to
+102
| def pipeline_command = pipeline.withIndex().collect { subcommand, idx -> | ||
| def argsKey = idx == 0 ? "args" : "args${idx + 1}" | ||
| def taskArgs = task.ext[argsKey] ?: "" | ||
|
|
||
| def cmd_parts = ["samtools", subcommand] | ||
| if (taskArgs) { | ||
| cmd_parts << taskArgs | ||
| } | ||
| if (idx == 0) { | ||
| if (input_reference) { | ||
| cmd_parts << input_reference | ||
| } | ||
| cmd_parts << (input instanceof List ? input.join(" ") : input) | ||
| } | ||
| if (idx == n_commands - 1) { | ||
| if (output_reference) { | ||
| cmd_parts << output_reference | ||
| } | ||
| cmd_parts << output_string | ||
| } | ||
|
|
||
| return cmd_parts.join(" ") | ||
| }.join(" |\\\n") |
Member
There was a problem hiding this comment.
You just pipe the commands directly. Don't you need to add some - or -o - to force stdin/stdout ? I did that in my version https://github.com/nf-core/modules/pull/4571/changes#diff-34320bc32138ad0bc2d6a277f60183a5c4fc988b01314cab05ac6ff6245a9c94R38 , but perhaps that was unnecessary.
Contributor
Author
There was a problem hiding this comment.
AFAIK it's not mandatory in samtools?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See discussion on the nf-core slack: https://nfcore.slack.com/archives/C043UU89KKQ/p1777986494144269
Here is a working example of a "samtools/multicommand" module that constructs a chain of samtools commands that pipe into each other following a user-specified input describing which tools to use.
Currently the supported commands are only those which write *AM or fasta/fastq - I think that limits the scope helpfully. If you want to run samtools stats, for example, pass the output from this into that dedicated module.
Name TBD, and probably pending further discussion about the guidelines, how this fits and what would need to change.
PR checklist
Closes #XXX
topic: versions- See version_topicslabelnf-core modules test <MODULE> --profile dockernf-core modules test <MODULE> --profile singularitynf-core modules test <MODULE> --profile condanf-core subworkflows test <SUBWORKFLOW> --profile dockernf-core subworkflows test <SUBWORKFLOW> --profile singularitynf-core subworkflows test <SUBWORKFLOW> --profile conda