Auto-discover AnnData fields and support validated gsMap trait queries - #1
Open
Ganten-Hornby wants to merge 2 commits into
Open
Ganten-Hornby wants to merge 2 commits into
Ganten-Hornby wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spatialvista --input data.h5adandspatialvista.vis(adata)work without listing common coordinate/annotation keys.uns["gsmap"]metadata and a searchable Query Traits interface with trait labels and −log10(P) units, separate from ordinary Query Continuous fields.Data convention
Precedence: explicit CLI/Python options → validated gsMap metadata → ordinary AnnData inference.
obsmkeys, starting withspatial; finite real(n_obs, 2 or 3)arrays. UMAP is not silently used as tissue coordinates.obsfields, or string fields with limited cardinality. Numeric category codes should be categorical or explicitly selected.obsfields with at least one finite value, excluding selected annotation/color/section fields.section,slice_id, andsample_name.uns["gsmap"]["traits"]; no prefix guessing.All declared columns must exist and follow the same observation order. gsMap coordinates must be finite
(n_obs, 3); observation IDs must be unique and nonempty. Traits must be real, nonnegative already-transformed −log10(P) with at least one finite value per trait. NaNs remain missing/transparent, not zero. Invalid declarations, infinities and declared raw-P scales are rejected. Exporters remain responsible for the correct scale: numerical validation cannot detect mislabeled raw P values.No expression matrix or gsMap dependency is required. This changes the package's CLI/notebook viewer, not the separately deployed SpatialVista portal.
Behavior changes and controls
--continuous ""/continuous=[]disables numeric discovery;--annotations ""/annotations=[]disables extra annotations;--section ""/section=""disables section discovery.--ignore-gsmap-metadata/ignore_gsmap_metadata=True.--genes/genes=.Validation
python -m pytest -q tests: 34 passed.frontend/tests/gsmap_colors.test.ts: 4 checks passed (NaN, maximum, constant, annotation colors).spawnwarning remains.python -m mkdocs build --strict: passed.The two generated
src/spatialvista/_widget/*.mjsfiles account for most diff volume; source changes can be reviewed separately.