Overview
Curated: · Written: · Reviewed:
Bioinformatics Pipelines & Reproducibility
In one line
A reproducible pipeline is a dependency graph of tools with typed inputs and outputs, immutable references, pinned environments and per-attempt provenance, so an authorized operator can reproduce or explain every published result. Reach for it whenever a result must be rerun, audited or moved to another site.
Key definitions
- Output contract: the format, schema, nonempty rule, sample and reference identity, checksum and domain QC a file must pass before it is published.
- Cache key: every semantic input (command, code, parameters, environment, input content, execution context). Filenames and timestamps are not keys.
- Immutable reference: a versioned, checksummed FASTA, index, annotation or model. "latest" or "GRCh38" alone does not identify one.
- Scatter-gather: fan-out over shards with unique keys, then a gather step that checks the expected shard set is complete before publishing.
- Provenance record: one row per task attempt linking output digest, input digests, config hash, workflow revision, image digest and executor.
- Resource declaration: a scheduling hypothesis fitted from measured peak usage, not a guess.
Formulas and complexity
A pilot fit from 40 samples (2 to 25 GB inputs) is a starting point, not a guarantee. Size the request from the fit plus headroom, then check the measured peak on production samples:
For a 25 GB input the fit predicts about 33 GB. An 8 GB request for that input is the kind of mismatch that produces exit 137 on most tasks.
How it works
The engine resolves the graph from declared inputs, so ordering follows data dependencies, not filenames or completion timing. A cache hit is accepted only when the full key matches. A miss runs the task in task-local temporary space. The output contract is checked, and only then is the file published atomically. A failed contract is classified and its logs and work directory are kept. Every attempt writes a provenance row, whether it executed or came from cache.
When to use and when not to
| Situation | Managed workflow | Ad hoc script |
|---|---|---|
| Result will be rerun, audited or shared | Yes: manifest, pinned inputs, contracts | Not sufficient |
| Many samples on HPC or cloud | Yes: scatter-gather, retries, resume | Manual fan-out, no resume safety |
| One-off exploration on a laptop | Overhead may exceed value | Acceptable if outputs are not reported |
| Output feeds a clinical or regulated report | Yes, plus protected-data validation | Not acceptable |
| Caching across reference or config changes | Only with content-based keys | Filename caching silently reuses stale results |
Traps interviewers probe
- Treating file existence or size as success. A 12 MB Parquet file that parses cleanly can still hold a fraction of the usual rows. Fix: check row counts and size against recent runs and fail the task when the output falls outside the contract.
- Caching on filename or modification time. Restoring an archived file with
tar -xcan keep an old mtime, so make-style checks skip the rebuild. Fix: key the cache on input content hashes plus the full command and image digest. - Non-idempotent writes on retry. A retried task that appends rows duplicates data, and a timed-out attempt can leave a partial file. Fix: write to staging, publish atomically, and deduplicate or upsert on a natural key such as shard ID.
- Pinning a mutable tag. A tag like
2.7.1can be re-pushed, so the same manifest pulls different bytes. Fix: pin the image digest and record the imageID the pod actually ran. - Recording a seed and assuming reproducibility. The seed does not fix GPU model, library build or reduction order. Fix: pin the environment and target hardware, then measure residual variance across repeated runs.
Interview tips
Open with the invariant: every published artifact resolves to immutable inputs and a pinned environment, and the graph, config and contracts can be replayed from the run manifest.
Expect these follow-ups: how the cache invalidates when a reference changes; how you retry without duplicating output; how you prove a resume re-executed the tasks it should have; how a missing shard is detected; how you handle a reference patch or decoy change; how you keep sample identifiers out of public logs.
30-second outline: "Each task declares its inputs and an output contract. Inputs and references are checksummed and pinned by digest. The cache key covers content, command and environment. Outputs are staged, validated and published atomically. Every attempt writes provenance to a run manifest, so a resume can show what re-ran and why. Failures are classified, and only transient ones are retried, with limits."
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.