Skip to content

fix: keep computeMatrix groups distinct when filenames match - #1502

Open
rpinho wants to merge 1 commit into
deeptools:masterfrom
rpinho:fix-computematrix-same-basename
Open

rpinho wants to merge 1 commit into
deeptools:masterfrom
rpinho:fix-computematrix-same-basename

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown

When two input BED files share a basename, computeMatrix can write group boundaries beyond the row count.
Pass two paths ending in peaks.bed with one and two regions and inspect the matrix header.
The patch counts retained rows by input file position.
The test checks group boundaries, values and both exports with the input order and with sorting enabled.

  • Does the PR contain new feature?
  • Does the PR contain bugfix?
  • Does the PR contain documentation changes?
  • Does the PR contain changes to the galaxy wrapper?
  • Does the PR title follow Conventional Commits?

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

computeMatrix now tracks region groups by input-file index and derives ordered group sizes from row indices. Matrix headers and sorted-region outputs consume positional counts. A regression test covers same-basename region files under keep and ascend sorting.

Changes: Region group tracking

Layer / File(s) Summary
Derive groups from input-file indices
src/computematrix.rs
Rows retain their input-file index. Group sizes and slices are rebuilt in index order.
Use ordered sizes in output
src/matrix/header.rs, src/matrix/writer.rs, pydeeptools/deeptools/test/test_computeMatrix_referencepoint.py
Matrix headers and sorted-region boundaries use positional group sizes. The regression test checks same-basename groups, boundaries, values, and sorting order.

Change: Bug fix

Merge Risk: Minimal · up to c7a25

This change keeps region groups distinct when input files share a basename, so computeMatrix group boundaries no longer exceed the row count. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed Title uses the Conventional Commits form fix: ... with lowercase type and no scope. It names the main change: region groups stay distinct when input filenames match.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed Me caveman. PR description talk about bug: computeMatrix group boundaries wrong when two BED files share basename. Patch counts rows by input file position. Test described. Description match changeset…
Full details: Description check

Explanation

Me caveman. PR description talk about bug: computeMatrix group boundaries wrong when two BED files share basename. Patch counts rows by input file position. Test described. Description match changeset. Pass.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution failed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@rpinho

rpinho commented Nov 24, 2026

Copy link
Copy Markdown
Author

Let me know if you have any thoughts on this one.

This branch has not been deployed

No deployments
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