Skip to main content

Experimental tooling to support notebook analysis of polislike data

Project description

diagram of one workflow of valencyann-data

valency-anndata

Experimental tooling to support notebook analysis of polislike data.

:sparkles: Inspired by scanpy and the scverse ecosystem! :heart:

Installation

pip install valency-anndata

Usage

Loading Polis Data

import valency_anndata as val

adata = val.datasets.polis.load("https://pol.is/report/r29kkytnipymd3exbynkd")
val.viz.schematic_diagram(adata, diff_from=None)
Screenshot 2025-12-23 at 12 00 16 AM

Running Polis Pipelines

with val.viz.schematic_diagram(diff_from=adata):
    val.tools.recipe_polis(adata, key_added_pca="X_pca_polis")
Screenshot 2025-12-23 at 12 57 42 AM
val.viz.embedding(adata, basis="pca_polis", color="kmeans_polis")
Screenshot 2025-12-23 at 12 00 59 AM

Exploring Polis Pipelines

val.viz.schematic_diagram(diff_from=adata):
    val.preprocessing.calculate_qc_metrics(pacmap_adata, inplace=True)
Screenshot 2025-12-23 at 12 58 18 AM
val.viz.embedding(adata, basis="pca_polis",
    color=["kmeans_polis", "pct_seen", "pct_agree", "pct_pass"],
)
Screenshot 2025-12-23 at 12 58 50 AM

Running & Exploring Alternative Pipelines

from valency_anndata.tools._polis import _zero_mask, _cluster_mask

with val.viz.schematic_diagram(diff_from=adata):
    _zero_mask(adata)
    val.preprocessing.impute(
        adata,
        strategy="mean",
        source_layer="X_masked",
        target_layer="X_masked_imputed_mean",
    )
    val.tools.pacmap(
        adata,
        key_added="X_pacmap",
        layer="X_masked_imputed_mean",
    )
    _cluster_mask(adata)
    val.tools.kmeans(
        adata,
        k_bounds=(2, 9),
        use_rep="X_pacmap",
        mask_obs="cluster_mask",
        key_added="kmeans_pacmap",
    )
Screenshot 2025-12-23 at 12 58 59 AM
val.viz.embedding(adata, basis="pacmap",
    color=["kmeans_pacmap", "pct_seen", "pct_agree", "pct_pass"],
)
Screenshot 2025-12-23 at 12 59 09 AM

For full examples and planned features, see: example-usage.ipynb

AI-Assisted Exploration (Claude Code Skill)

This repo includes a Claude Code skill that guides you through loading and exploring Polis conversations interactively. It will prompt you for which projections and annotations to visualize, then run the full pipeline for you.

Contributing

We are maintaining a custom CONTRIBUTING.md with specific links and a compiled list of entry tasks!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valency_anndata-0.3.0.tar.gz (13.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

valency_anndata-0.3.0-py3-none-any.whl (65.6 kB view details)

Uploaded Python 3

File details

Details for the file valency_anndata-0.3.0.tar.gz.

File metadata

  • Download URL: valency_anndata-0.3.0.tar.gz
  • Upload date:
  • Size: 13.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for valency_anndata-0.3.0.tar.gz
Algorithm Hash digest
SHA256 efbe0b0d8b22fbedb53ba47b9060fe66d7e13661979fe8a2d36e2af1f8a4842e
MD5 fcc226d125ce4754e99eef5753fb003f
BLAKE2b-256 bce62d04caf12a1a262701ab1f3d2a559e91dc5d5ec2cbcd819e5be4aa1e426f

See more details on using hashes here.

File details

Details for the file valency_anndata-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for valency_anndata-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bbecdd0c4938de848ce777d09ff012222da338bdb199e9ded45018c65b0eae7
MD5 65fce683eba8e337c3d9b0c4ebd3b519
BLAKE2b-256 ccb219fbbcb6287cb701a10f2cf40ea4a5b2f64ab659c3298eff6dfef8b3dc4a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page