Skip to content

Inherit native reference DNA and preserve genome identity (10.11.0) - #566

Merged
iskandr merged 2 commits into
mainfrom
feat/native-reference-dna
Sep 30, 2026
Merged

iskandr merged 2 commits into
mainfrom
feat/native-reference-dna

Conversation

@iskandr

@iskandr iskandr commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Genome(native) currently hides installed PyEnsembl DNA, so intronic and
intergenic queries return no sequence. In 10.11.0 the wrapper inherits native
DNA lazily; an explicit fasta= keeps precedence. Native sequence() retains
PyEnsembl's missing-DNA/invalid-interval errors, and tiered lookups retain cDNA
fallback. Construction and reads never download reference DNA.

Reader ownership is explicit: closing a wrapper closes only a reader it opened
from an explicit path. Native genomes, caller-provided readers, and readers
borrowed by rewrapping remain owned by their original owner. Documentation now
covers native installation, fallback, error and lifetime behavior. Previously
pickled wrappers migrate their stored FASTA field when loaded.

The regression tests also exposed #565: memoized genome inference conflated
equal annotations carrying different DNA files. Object arguments now pass
through by identity; integer/string resolution retains its existing caches.

Fixes #488. Fixes #565.

Validation:

  • The annotated intronic lookup regression fails on the previous implementation.
  • 46 focused DNA/wrapper tests pass, including the legacy pickle regressions.
  • PyEnsembl 2.6.4 compatibility: 77 pass; 15 native-DNA tests correctly skip
    because that upstream API was added in 2.11.
  • ./lint.sh and mkdocs build --strict pass.
  • Full ./test.sh: 3,104 passed (PyEnsembl 2.17.1, pandas 3.0.6, Sercol 1.0.3).
  • GitHub CI
    passes on Python 3.9, 3.10 and 3.11, including cross-annotator parity;
    the docs check also passes.

Upstream contract: PyEnsembl #401
and 2.17.1 Genome implementation.

@iskandr
iskandr merged commit a5169bb into main Sep 30, 2026
5 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.

infer_genome conflates equal native genomes with different reference DNA Inherit native PyEnsembl reference DNA in the Genome wrapper

1 participant