Skip to content

fix: ft call-peaks --haps fills the H1/H2 columns - #141

Merged
mrvollger merged 2 commits into
mainfrom
fix/call-peaks-haps-coverage
Sep 18, 2026
Merged

mrvollger merged 2 commits into
mainfrom
fix/call-peaks-haps-coverage

Conversation

@mrvollger

@mrvollger mrvollger commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Forward-port to main of the 0.13.1 fix for #140, which shipped from release/v0.13 in #142.

Cause

--haps was parsed on CallPeaksOptions, but call_peaks_for_chrom hardcoded haps: false when it built the pileup. The pileup never made H1/H2 tracks, so every peak printed the empty-track placeholder (0 0 -1.0 0 0) for both haplotypes.

Fix

haps moves from CallPeaksOptions into PeakCallingParams, which is what call_peaks_for_chrom receives. Both structs are flattened, so the flag name and help text are unchanged; --haps now appears among the peak-calling options in --help instead of last. union-peaks sets it false because BED intervals carry no HP tag.

The second commit keeps --haps from costing more than it must. Per-haplotype tracks triple the pileup memory per chromosome, and about a third of that was FIRE element tracking on the H1/H2 tracks that nothing reads (only all_data.fire_elements feeds peak boundaries). The haplotype tracks are now built without it.

Check

NAPA.bam carries HP tags. ft call-peaks --haps --min-fire-frac 0.5 on it:

coverage coverage_H1 coverage_H2
before 95 0 0
after 95 45 14

A regression test pins these three values. The call-peaks snapshot and pileup tests pass.

Order

Merge into main after #149 and before #138. release-plz opens the 0.14.0 release PR on the first push to main after #149.

Fixes #140

The flag was parsed on CallPeaksOptions but call_peaks_for_chrom hardcoded
haps: false, so the pileup never built haplotype tracks and every H1/H2
column was zero. Move haps into PeakCallingParams so it reaches the pileup.
union-peaks sets it false since BED intervals carry no HP tag.

Closes #140
mrvollger added a commit that referenced this pull request Sep 18, 2026
Fixes #140.

`ft call-peaks --haps` printed zero for every H1/H2 column on a
haplotagged BAM, while `ft pileup --haps` on the same BAM was correct.

## Cause

`--haps` was parsed on `CallPeaksOptions`, but `call_peaks` hardcoded
`haps: false` when it built the pileup. The pileup never made H1/H2
tracks, so every peak printed the empty-track placeholder (`0 0 -1.0 0
0`) for both haplotypes.

## Fix

Pass `opts.haps` through. One line.

## Check

`NAPA.bam` carries HP tags. `ft call-peaks --haps --min-fire-frac 0.5`
on it:

| | coverage | coverage_H1 | coverage_H2 |
|---|---|---|---|
| before | 95 | 0 | 0 |
| after | 95 | 45 | 14 |

A regression test pins these three values.

## Patch release (0.13.1)

Targets `release/v0.13` so it ships in 0.13.1. Forward-port to main is
#141.

Co-authored-by: Mitchell R. Vollger <mvollger@gmail.com>
@mrvollger mrvollger changed the title fix: ft call-peaks --haps fills the H1/H2 columns (main) fix: ft call-peaks --haps fills the H1/H2 columns Sep 18, 2026
Only all_data's fire_elements are read (peak boundaries in call-peaks).
With --haps now live, the H1/H2 tracks were allocating a Vec per base
that nothing used, about a third of the tripled call-peaks memory.
mrvollger added a commit that referenced this pull request Sep 18, 2026
Twin of #148 for main, rebased onto #147 so the two do not conflict on
the release-plz.toml comment. Merging this brings in #147's commit too;
#147 can then be closed as included.

Same content as #148 plus the fix from #150: `semver_check = false`
lives in the `[workspace]` table.

**Do not merge until #132 (the 0.13.1 release PR on `release/v0.13`) is
merged.** release-plz finds its open release PR by branch prefix only. A
push to main with the semver check off would run release-plz-pr, find
#132 by its `release-plz-` branch name, and force-push 0.14.0 content
onto it. Today the only thing preventing that is main's run dying in the
semver check, which this PR removes.

After #132: merge this first on main, then #141 and #138. release-plz
then opens a fresh 0.14.0 release PR.

---------

Co-authored-by: Mitchell R. Vollger <mvollger@gmail.com>
@mrvollger
mrvollger merged commit aa80ad1 into main Sep 18, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 18, 2026
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.

ft call-peaks --haps reports zero haplotype coverage on a haplotagged BAM

1 participant