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.2.0.tar.gz (6.7 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.2.0-py3-none-any.whl (56.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for valency_anndata-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4d41d54441556aa211e93f923a44692aee5c79e1a19d1f050ec4d8b703f77e66
MD5 afaa0c27f38cac240ef5a88091cac375
BLAKE2b-256 2e9c53961bdee381aa5019dfdad2827a978a77a1c735a1a67b98a8cb70b4b080

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for valency_anndata-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95941bc52a337ca39d1f861bee99b4e4bf7397efb0a3f87f3317793fc5bf354f
MD5 4f544c331fa591c8de8dbcc4aeeb7973
BLAKE2b-256 ba5cbf08efa4b4bcd0910a72927ded9aa9494e01ff61497b5da56c4922733a6b

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