Skip to content

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

Merged
mrvollger merged 1 commit into
release/v0.13from
fix/140-call-peaks-haps
Sep 18, 2026
Merged

mrvollger merged 1 commit into
release/v0.13from
fix/140-call-peaks-haps

Conversation

@mrvollger

@mrvollger mrvollger commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

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.

The flag was parsed on CallPeaksOptions but call_peaks hardcoded
haps: false when building the pileup, so no haplotype tracks were
made and every H1/H2 column was zero.

Closes #140
@mrvollger
mrvollger merged commit 38b2fb1 into release/v0.13 Sep 18, 2026
6 checks passed
mrvollger added a commit that referenced this pull request Sep 18, 2026
Cherry-pick of the CI commit from the closed #137. Without it nothing
releases from this branch: the release-plz workflow here still triggers
only on pushes to `main`, so merging #142 opened no 0.13.1 release PR.

- CI runs on PRs that target `release/**`.
- release-plz triggers on pushes to `release/**` and on
`workflow_dispatch`. Push events use the pushed branch's workflow file,
so this copy only acts on this branch.
- cargo-dist is dispatched on the released tag instead of `main`, so
binaries build from the patched 0.13.x source.

Merging this is itself a push to `release/v0.13`, so release-plz will
run and open the `chore: release` PR for 0.13.1 with the #142 fix.

Co-authored-by: Mitchell R. Vollger <mvollger@gmail.com>
mrvollger pushed a commit that referenced this pull request Sep 18, 2026
## 🤖 New release

* `fibertools-rs`: 0.13.0 -> 0.13.1

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.13.1](v0.13.0...v0.13.1)
- 2026-09-18

### Fixed

- pin hts-sys 2.2.0 and turn off the release-plz semver check
([#148](#148))
- bump vergen-git2 to 9.1 so a fresh resolution builds again
([#146](#146))
- ft call-peaks --haps fills the H1/H2 columns
([#142](#142))

### Other

- put semver_check = false in the [workspace] table
([#150](#150))
- support patch releases from release/** branches
([#143](#143))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
mrvollger added a commit that referenced this pull request Sep 18, 2026
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

---------

Co-authored-by: Mitchell R. Vollger <mvollger@gmail.com>
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.

1 participant