Skip to content

Mount sidecar inputs without placing them on the command line - #92

Open
jorgeMFS wants to merge 1 commit into
honour-input-filenamefrom
input-sidecar-mount
Open

jorgeMFS wants to merge 1 commit into
honour-input-filenamefrom
input-sidecar-mount

Conversation

@jorgeMFS

@jorgeMFS jorgeMFS commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Merge order. Stacked on #91 and targets honour-input-filename, not main — merge #91 first, then this. It is also the frontend half of a two-repo change: ieeta-pt/biochef-hub#26 adds the mode to the schema and is itself stacked on ieeta-pt/biochef-hub#25. A recipe cannot use mode: sidecar until both repos have landed, so neither half is useful alone, but neither breaks anything if it lands first.

Full order: biochef-hub#25 → biochef-hub#26, and Biochef#91 → this. The two chains are independent of each other.

Summary

Some tools locate a companion file by name rather than taking it as an argument. htslib resolves an index by string-appending .csi or .bai to the data file path, so bcftools merge, isec and consensus need a file at exactly <datafile>.csi that is never passed to the tool.

Today that is inexpressible. A mode: file input is always emitted — flagged, or positional if it has no flag — so declaring the index as an extra input hands it to the tool as a stray positional and the command fails. This is the gap noted in #91, which said the filename change alone would not unblock those operations.

This treats mode: sidecar exactly like a file input for mounting, and leaves the argument-building block untouched so a sidecar falls through it.

Why the naming works out

The sidecar goes through the same resolver as every other input, so within one invocation:

Declared Mounted as
data input, filename: a.vcf.gz input-<nodeId>-a.vcf.gz
sidecar, filename: a.vcf.gz.csi input-<nodeId>-a.vcf.gz.csi

The data file is passed to the tool as input-<nodeId>-a.vcf.gz; htslib appends .csi and finds the sidecar. The per-invocation prefix is on both, so the sibling relationship survives and names stay unique between nodes.

The upstream-node path is covered too: a sidecar piped from, say, a samtools index node is re-mounted under its declared name by the same code #91 added.

Scope

+8 −2, all within the input-preparation loop. The argument-building block is deliberately not touched — that is what makes a sidecar invisible to argv.

Verification

  • Inert until adopted — no recipe declares mode: sidecar on any ref of biochef-recipes (it could not, until the hub change lands), so the new path is unreachable and nothing existing changes behaviour.
  • Buildnpm run build: webpack 5.106.2 compiled successfully.

No automated tests: the repo has no test script and no workflow runs on a PR here. As with #91, the substantive evidence is that the changed path cannot execute for any recipe that exists today.


Merge order

Stacked on #91base it on honour-input-filename, not main, and merge #91 first.

src/utils/toolUtils.js is where five open branches meet: #91, #92, #93, this one, and WildBunnie's aioli-vendored (#90). They all conflict there pairwise, so the order matters more than usual.

Tools that locate a companion file by name need it present in the filesystem
but absent from the arguments. htslib resolves an index by appending .csi or
.bai to the data file path, so bcftools merge, isec and consensus need a file
at exactly <datafile>.csi that is never passed to the tool.

A file input is always emitted, flagged or positional, so declaring the index
as an extra input sends it along as a stray argument and the command fails.

Treat mode: sidecar exactly like a file input for mounting, including the
re-mount under a declared name when the file comes from an upstream node, and
leave the argument-building block untouched so a sidecar falls through it.

The name comes from the same resolver as every other input, so a data input
declaring filename a.vcf.gz and a sidecar declaring a.vcf.gz.csi land beside
each other with the per-invocation prefix on both, and the sibling
relationship htslib needs is preserved.

Depends on the schema change in the hub, which adds the mode and requires a
sidecar to declare a filename. No recipe declares mode: sidecar on any branch
today, so this path is unreachable until one opts in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants