Skip to content

feat: add opt-in taxon-filtered fullmaps and InChIKey support - #149

Merged
SkyeAv merged 1 commit into
mainfrom
taxon-allowlist
Sep 11, 2026
Merged

feat: add opt-in taxon-filtered fullmaps and InChIKey support#149
SkyeAv merged 1 commit into
mainfrom
taxon-allowlist

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Adds an opt-in top-100 experimental taxon allowlist for fullmap builds and preserves InChIKey terms during ingestion. Default fullmap builds and existing Python callers remain unchanged.

Taxon-filtered fullmaps

  • Checked-in allowlist: Adds src/tablassert/data/experimental_taxa.yaml containing 100 deterministic NCBI taxon IDs ranked from observed frequencies across the MultiomicsNext and MultiomicsHarness corpora.
  • Rust filtering: Adds optional taxon_allowlist support to rust/src/fullmap.rs, filtering non-OrganismTaxon rows before interning.
  • Retention semantics: Retains taxonless rows, including NCBITaxon:0 and malformed taxon values; retains rows with any allowlisted taxon; retains all rows whose categories include OrganismTaxon.
  • Build identity: Records a deterministic META.taxon_allowlist identity for filtered databases.
  • CLI behavior: Adds --taxon-allowlist to tablassert build-fullmap. This mode always builds from BABEL sources and never reuses an unfiltered prebuilt database.

InChIKey support

  • Token QC: Removes the inchikey rejection from Rust fullmap token validation while preserving newline, tab, hypothetical, uncharacterized, and dead-token filtering.
  • Normalization: Verifies both raw normalized terms such as abc-def and CURIE-form terms such as inchikey:abc-def.

Tests and documentation

  • Coverage: Adds Python and Rust coverage for allowlist filtering, taxonless sentinels, malformed taxa, multi-taxon rows, multi-category OrganismTaxon rows, deterministic metadata, CLI prebuilt bypass behavior, and InChIKey lookup.
  • Documentation: Updates docs/cli.md and docs/fullmap.md with the allowlist workflow, retention semantics, and metadata behavior.
  • Packaging: Explicitly includes the allowlist data file in the maturin package.
  • Compatibility: Updates src/tablassert/rs.pyi and existing Rust call sites while preserving the default unfiltered build path.

Testing

  • uv run pytest -q1327 passed, 43 skipped
  • uv run pytest -n 0 tests/test_cover_fullmap.py tests/test_cover_cli.py tests/test_docs_source_of_truth.py tests/test_docs_cli_coverage.py -q198 passed
  • cargo test --manifest-path rust/Cargo.toml --no-fail-fast → passed
  • cargo check --manifest-path rust/Cargo.toml → passed
  • cargo fmt --manifest-path rust/Cargo.toml --check → passed
  • uv run ruff check . → passed
  • uv run ruff format --check . → passed
  • uv build --wheel --out-dir /tmp/taxon-wheel-final → passed; wheel contains tablassert/data/experimental_taxa.yaml
  • uv run pyright → only pre-existing optional-import diagnostics remain for logger/loguru

Adds an opt-in top-100 experimental taxon allowlist for fullmap builds and preserves InChIKey terms during ingestion. Default fullmap builds and existing Python callers remain unchanged.\n\n### Taxon-filtered fullmaps\n- **Checked-in allowlist:** Adds src/tablassert/data/experimental_taxa.yaml containing 100 deterministic NCBI taxon IDs ranked from observed frequencies across the MultiomicsNext and MultiomicsHarness corpora.\n- **Rust filtering:** Adds optional taxon_allowlist support to rust/src/fullmap.rs, filtering non-OrganismTaxon rows before interning.\n- **Retention semantics:** Retains taxonless rows, including NCBITaxon:0 and malformed taxon values; retains rows with any allowlisted taxon; retains all rows whose categories include OrganismTaxon.\n- **Build identity:** Records a deterministic META.taxon_allowlist identity for filtered databases.\n- **CLI behavior:** Adds --taxon-allowlist to tablassert build-fullmap. This mode always builds from BABEL sources and never reuses an unfiltered prebuilt database.\n\n### InChIKey support\n- **Token QC:** Removes the inchikey rejection from Rust fullmap token validation while preserving newline, tab, hypothetical, uncharacterized, and dead-token filtering.\n- **Normalization:** Verifies both raw normalized terms such as abc-def and CURIE-form terms such as inchikey:abc-def.\n\n### Tests and documentation\n- **Coverage:** Adds Python and Rust coverage for allowlist filtering, taxonless sentinels, malformed taxa, multi-taxon rows, multi-category OrganismTaxon rows, deterministic metadata, CLI prebuilt bypass behavior, and InChIKey lookup.\n- **Documentation:** Updates docs/cli.md and docs/fullmap.md with the allowlist workflow, retention semantics, and metadata behavior.\n- **Packaging:** Explicitly includes the allowlist data file in the maturin package.\n- **Compatibility:** Updates src/tablassert/rs.pyi and existing Rust call sites while preserving the default unfiltered build path.\n\n### Testing\n- uv run pytest -q -> 1327 passed, 43 skipped\n- uv run pytest -n 0 tests/test_cover_fullmap.py tests/test_cover_cli.py tests/test_docs_source_of_truth.py tests/test_docs_cli_coverage.py -q -> 198 passed\n- cargo test --manifest-path rust/Cargo.toml --no-fail-fast -> passed\n- cargo check --manifest-path rust/Cargo.toml -> passed\n- cargo fmt --manifest-path rust/Cargo.toml --check -> passed\n- uv run ruff check . -> passed\n- uv run ruff format --check . -> passed\n- uv build --wheel --out-dir /tmp/taxon-wheel-final -> passed; wheel contains tablassert/data/experimental_taxa.yaml\n- uv run pyright -> only pre-existing optional-import diagnostics remain for logger/loguru
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 90f09afb-6189-48f9-a5f1-6cf9e2abbba3


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

Comment @coderabbitai help to get the list of available commands.

@SkyeAv
SkyeAv merged commit c2b78ba into main Sep 11, 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.

1 participant