Skip to content

Use the supplied chromosome ID for an implicit complement group - #44

Merged
endrebak merged 1 commit into
pyranges:masterfrom
antonsoo:fix/implicit-complement-chromosome
Oct 27, 2026
Merged

endrebak merged 1 commit into
pyranges:masterfrom
antonsoo:fix/implicit-complement-chromosome

Conversation

@antonsoo

@antonsoo antonsoo commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

With groups=None, complement documents that chrom_len_ids must describe one chromosome, but creates group 0 regardless of that chromosome's ID. For intervals [10, 20), [30, 40) on chromosome 7 of length 100, it labels the gaps as chromosome 0 and loses the terminal gap [40, 100).

Build the implicit group from the supplied chromosome ID and check the documented single-chromosome precondition. Explicit groups and the native kernel are unchanged.

Validation: 46 tests pass on Python 3.12/3.13/3.14 with NumPy 2.5.4, and on 3.12 with NumPy 1.26.4; eight regression cases fail before the change. An independent interval-union reference on public chrX/chrY exon and chromosome-size data reproduces 32 truncated/mislabelled configurations. Sixteen zero-ID controls and all 48 explicit-group controls remain exact. A clean ABI3 wheel repeats the results, and 16 public PyRanges1 operation results per profile stay unchanged. This branch also combines with #43 without changing either fix's complete workload results.

@endrebak

Copy link
Copy Markdown
Collaborator

I'll have a look. Thanks

@endrebak
endrebak merged commit e34e354 into pyranges:master Oct 27, 2026
16 checks passed
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.

2 participants