Repository navigation
v2.7.1: region-parallel fiberhmm-call
⚠️ 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.
Region-parallel mode for `fiberhmm-call`
New `--region-parallel` flag splits the input BAM into genomic regions (10 Mb default) and runs fused apply+recall in parallel, one region per worker. Scales near-linearly with `--cores` up to chromosome count.
Why this matters
Streaming mode has a serial main-process loop: one Python process reads the BAM, feeds workers, drains results, writes output. That main process is the per-lane bottleneck. Region-parallel sidesteps it entirely — each region worker is its own pipeline (fetch → apply → recall → write to temp BAM), and the main process only merges temp BAMs at the end with `samtools cat` (no sort, just concatenation).
Usage
```bash
Drosophila: skip small scaffolds for cleaner region set
fiberhmm-call -i in.bam -o out.bam --enzyme hia5 --seq pacbio
-c 8 --io-threads 16 --region-parallel --skip-scaffolds
Human: restrict to main chroms
fiberhmm-call -i in.bam -o out.bam --enzyme dddb
-c 16 --io-threads 16 --region-parallel
--chroms chr1 chr2 chr3 ... chrX chrY
Alternative: all chroms with default 10 Mb region size
fiberhmm-call -i in.bam -o out.bam --enzyme hia5 --seq pacbio
-c 16 --io-threads 16 --region-parallel
```
Requirements
- Input BAM must be coordinate-sorted AND indexed (`.bai` alongside).
- Not compatible with stdin (`-i -`) or stdout (`-o -`) — use streaming mode for those.
- Unmapped reads in the input are silently skipped (use streaming mode if you need them).
Validation
1228-read hia5 PacBio test:
- 0 out-of-monotonic-order reads (coordinate sort preserved)
- 1227 ns tags, 1190 as tags, 1190 MA tags — matches streaming fused output
Expected impact
On multi-chrom production BAMs (Drosophila or human), region-parallel with `-c 8` gives ~4–8× speedup over streaming-mode `fiberhmm-call` on the same hardware, on top of the 2–9× that fusion already provides over the old `fiberhmm-run` streaming chain.
Install
```bash
pip install --upgrade fiberhmm
```
🤖 Generated with Claude Code