算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
tools-workflows【设计与创意】Use Squidpy tool-layer workflows for sliding windows, distance-to-anchor design matrices, and plotting handoffs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a Squidpy task needs squidpy.tl helper workflows for spatial windows or distance-to-anchor design matrices. Keep plotting details routed to visualization once the design matrix exists.
sq.tl.sliding_window.sq.tl.var_by_distance.sq.pl.var_by_distance without duplicating plot-formatting guidance.datasets-and-io for AnnData/SpatialData structure, coordinate validation, readers, and missing metadata repair.graph-analysis for spatial neighbor graphs, graph statistics, ligand-receptor, Ripley, Moran/Geary, Sepal, niche, or graph masking workflows.visualization for sq.pl.var_by_distance layout, palettes, axes, saving, or other plot-formatting choices after adata.obsm[design_matrix_key] is valid.image-analysis or experimental-imaging for image containers, segmentation, tissue tiling, QC, staining, or SpatialData image workflows.references/tools-workflows.md for workflow recipes and output checks.references/api-reference.md for focused signatures, parameters, and storage keys.references/troubleshooting.md for coordinate columns, anchors, libraries, covariates, partial windows, and plot handoff failures.scripts/var_by_distance_smoke.py --help to inspect the bundled no-download smoke check, then run it with --quiet for a compact installation/API check.import squidpy as sq
sq.tl.sliding_window(
adata,
window_size=100,
overlap=0,
coord_columns=("globalX", "globalY"),
sliding_window_key="sliding_window_assignment",
)
sq.tl.var_by_distance(
adata,
groups="Tumor",
cluster_key="cell_type",
library_key="sample",
covariates="donor",
design_matrix_key="design_matrix",
)
sq.pl.var_by_distance(
adata,
var="GeneA",
anchor_key="Tumor",
design_matrix_key="design_matrix",
covariate="donor",
)
Confirm storage keys before downstream use: sliding_window writes columns to adata.obs when copy=False, and var_by_distance writes a pandas design matrix to adata.obsm[design_matrix_key] when copy=False.