Repository navigation
v2.6.9: slim IPC for fiberhmm-apply — lift main-process bottleneck
⚠️ Reverse-strand MM/ML parsing bug — UPGRADE TO v2.9.0
Versions 2.6 – 2.8.2 had a parser bug that shifted m6A/m5C modification positions on reverse-aligned reads (~24 bp median), causing ns/nl/as/al/MA/AQ tags to be wrong on reverse reads. Forward reads unaffected. DAF with IUPAC (R/Y) encoding unaffected.
Upgrade: pip install --upgrade fiberhmm (v2.9.0+). See v2.9.0 release notes for details.
Throughput release for `fiberhmm-apply`.
What changed
The streaming `apply` pipeline used to call `_extract_fiber_read_from_pysam` in the serial main process per read — decoding the 4-bit query sequence (~1–2 ms for a 20 kb PacBio read) AND parsing MM/ML (~1–2 ms), all before dispatching anything to the worker pool. Total serial cost was ~3–7 ms/read, capping throughput at ~150–300 r/s regardless of how many workers were available. Field report (24-sample run): `-c 4` workers running at 38% / 22% CPU — idle waiting for input.
How it's fixed
Slim IPC, mirroring what `recall-tfs` got in 2.6.6/2.6.7:
- Main process builds a slim payload (`make_apply_payload`) — cheap pysam tag access + `bytes(ML)` only. No MM/ML parsing.
- Workers receive the payload, call `extract_fiber_read_from_payload` to parse (in parallel), then encode + Viterbi + decode as before.
- `_ApplyPayloadRead` duck-types `pysam.AlignedSegment` so the existing extractor works unchanged whether it's called on a real pysam read (main) or a payload wrapper (worker).
Validation
- Per-read equivalence: `fiber_read` dicts produced by the two paths match exactly across 200 DAF/DddA reads + 200 Hia5 PacBio MM/ML reads (modification position sets identical).
- End-to-end smoke: `fiberhmm-apply -c 2` on 1808-read DAF BAM — 0 reads out of monotonic order, all expected ns/nl tags present, index built directly without sort.
Expected impact
Lifts the apply ceiling from ~150–300 r/s to whatever the worker pool can sustain. With `-c 4` on PacBio data, workers should now run at near-100% utilization (was 38%/22%) and aggregate throughput should land at ~500–1000 r/s per pipeline.
For the user with the 24-sample 360 GB Hia5 PacBio batch, this combined with the 2.6.8 sort fix should push wall-clock from ~7 days down to ~1.5–2 days for the full run.
Install
```bash
pip install --upgrade fiberhmm
```
🤖 Generated with Claude Code