PROOF OF CONCEPT: samtools/multicommand - #11550
Open
prototaxites wants to merge 20 commits into
Open
Conversation
muffato
reviewed
May 7, 2026
muffato
reviewed
Aug 19, 2026
muffato
reviewed
Sep 2, 2026
muffato
reviewed
Sep 3, 2026
prototaxites
marked this pull request as ready for review
September 4, 2026 12:39
muffato
reviewed
Sep 4, 2026
Contributor
Author
|
I will see if anyone else wants to weigh in before I merge! |
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.
The exact order of operations is specified by the pipeline input, which takes a list such as [view, sort, markdup]. This is then interpolated to a script where the output of each command is streamed to the next before being written to disk. The script can handle references being passed, as well as writing indexes, outputting in CRAM format, and conversion to FASTA and FASTQ.
By default, the threads for each tool are set to the total number of available cpus. However, it may be desirable to configure the number of threads used for each step, for example to give more threads to
samtools sortthan tosamtools view. This can be achieved by specifying a number of threads in$argsXwith-@, which will override the number of threads for that command. There is no sanity check that the number of threads is less than the total number available when doing this.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