算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
graph-embedding-analysis【设计与创意】Design and debug Scanpy neighborhood graphs, embeddings, clustering, trajectories, marker genes, gene scoring, ingest projection, and graph metrics on AnnData objects.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a Scanpy task involves graph construction, low-dimensional embeddings, graph clustering, trajectory abstraction, marker ranking, gene-set scoring, reference-to-query ingest, or graph/cluster quality metrics.
sc.pp.neighbors; see references/workflows.md#graph-foundation.sc.tl.umap, sc.tl.tsne, sc.tl.diffmap, or sc.tl.draw_graph; see references/workflows.md#embeddings.sc.tl.leiden, optional sc.tl.louvain, sc.tl.dendrogram, and sc.tl.paga; see references/workflows.md#clustering-and-topology.sc.tl.diffmap plus sc.tl.dpt; see references/workflows.md#trajectories.sc.tl.rank_genes_groups and sc.tl.filter_rank_genes_groups; see references/workflows.md#marker-genes.sc.tl.score_genes and sc.tl.score_genes_cell_cycle; see references/workflows.md#gene-scoring.sc.tl.ingest; see references/workflows.md#ingest.scanpy.metrics; see references/workflows.md#metrics.This sub-skill owns outputs in .obs, .obsm, .obsp, and .uns created by sc.pp.neighbors, sc.tl.umap, tsne, diffmap, draw_graph, leiden, louvain, paga, dpt, rank_genes_groups, filter_rank_genes_groups, score_genes, score_genes_cell_cycle, ingest, dendrogram, embedding_density, and scanpy.metrics.morans_i, gearys_c, modularity, and confusion_matrix.
Route upstream matrix preparation, QC, normalization, HVG selection, scaling, and PCA decisions to preprocessing-qc. Route sc.pl.* figure rendering and report assembly to plotting-reporting. Route external algorithms such as BBKNN, Scanorama, MAGIC, Scrublet, and other optional wrappers to external-integrations.
import scanpy as sc
sc.pp.pca(adata, n_comps=30, random_state=0)
sc.pp.neighbors(adata, n_neighbors=15, n_pcs=30, rng=0)
sc.tl.umap(adata, rng=0)
sc.tl.leiden(adata, resolution=1.0, key_added="leiden", rng=0)
sc.tl.rank_genes_groups(adata, groupby="leiden", method="wilcoxon", use_raw=False, key_added="rank_leiden")
sc.pp.neighbors(adata, n_neighbors=20, use_rep="X_pca", metric="cosine", key_added="neighbors_cosine", rng=0)
sc.tl.umap(adata, neighbors_key="neighbors_cosine", key_added="X_umap_cosine", rng=0)
sc.metrics.morans_i(adata, obsm="X_pca", neighbors_key="neighbors_cosine")
references/workflows.md gives call sequences, parameter choices, graph selectors, and output slots.references/troubleshooting.md maps common exceptions, wrong-key issues, optional dependency failures, and suspicious outputs to fixes.scripts/scanpy_analysis_smoke.py is a deterministic synthetic smoke check for graph, embedding, marker, score, and metrics APIs without original repository files.From the root of this generated Scanpy skill, run:
python sub-skills/graph-embedding-analysis/scripts/scanpy_analysis_smoke.py
The script prints JSON with checks for neighbors, UMAP when available, marker ranking, gene scoring, Moran's I, Geary's C, and a confusion matrix. It intentionally avoids requiring Leiden/Louvain; optional clustering can be requested with a flag and is reported clearly if missing dependencies prevent it.