用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- --skill bio-single-cell-clustering命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Operate MedSAM2 for promptable segmentation of 3D medical images and medical videos, including CT lesion propagation, MRI volumes, RECIST-guided prompts, efficient CPU-oriented variants, training, and 3D Slicer integration. Use when generating or validating volumetric masks from sparse prompts or propagating masks through image slices or video frames.
Build reproducible healthcare imaging pipelines with Project MONAI for DICOM, NIfTI, pathology, and multidimensional imaging tasks including preprocessing, augmentation, training, sliding-window inference, evaluation, model bundles, labeling, and deployment. Use when implementing medical image classification, segmentation, registration, detection, generative, or foundation-model workflows in PyTorch.
Operate Google TxGemma prediction and chat models for therapeutic property prediction across small molecules, proteins, nucleic acids, diseases, targets, and cell lines. Use when formatting Therapeutics Data Commons tasks, choosing TxGemma model size or variant, running local or Model Garden inference, fine-tuning on private therapeutic data, or evaluating TxGemma in drug-discovery workflows.
基于 SOC 职业分类
正在显示 SKILL.md
| name | bio-single-cell-clustering |
| description | scRNA-seq clustering analysis |
| keywords | ["clustering","single-cell","seurat","scanpy","umap"] |
| measurable_outcome | Identifies stable cell clusters with silhouette score > 0.5. |
| tool_type | mixed |
| primary_tool | Seurat |
Dimensionality reduction, neighbor graph construction, and clustering.
import scanpy as sc
import matplotlib.pyplot as plt
# Run PCA
sc.tl.pca(adata, n_comps=50, svd_solver='arpack')
# Visualize variance explained
sc.pl.pca_variance_ratio(adata, n_pcs=50)
# Visualize PCA
sc.pl.pca(adata, color='n_genes_by_counts')
# Elbow plot to choose number of PCs
sc.pl.pca_variance_ratio(adata, n_pcs=50, log=True)
# Typically use 10-50 PCs based on elbow
n_pcs = 30
# Build k-nearest neighbor graph
sc.pp.neighbors(adata, n_neighbors=15, n_pcs=30)
# Leiden clustering (preferred over Louvain)
sc.tl.leiden(adata, resolution=0.5)
# Higher resolution = more clusters
sc.tl.leiden(adata, resolution=1.0, key_added='leiden_r1')
# View cluster sizes
adata.obs['leiden'].value_counts()
# Louvain clustering (alternative)
sc.tl.louvain(adata, resolution=0.5)
# Compute UMAP embedding
sc.tl.umap(adata, min_dist=0.3, spread=1.0)
# Visualize clusters on UMAP
sc.pl.umap(adata, color='leiden')
# Color by gene expression
sc.pl.umap(adata, color=['leiden', 'CD3D', 'MS4A1', 'CD14'])
# Compute tSNE (slower than UMAP)
sc.tl.tsne(adata, n_pcs=30, perplexity=30)
# Visualize
sc.pl.tsne(adata, color='leiden')
import scanpy as sc
# Assumes preprocessed data
adata = sc.read_h5ad('preprocessed.h5ad')
# PCA
sc.tl.pca(adata, n_comps=50)
# Neighbors
sc.pp.neighbors(adata, n_neighbors=15, n_pcs=30)
# Cluster
sc.tl.leiden(adata, resolution=0.5)
# UMAP
sc.tl.umap(adata)
# Visualize
sc.pl.umap(adata, color='leiden')
# Try multiple resolutions
for res in [0.2, 0.5, 0.8, 1.0, 1.5]:
sc.tl.leiden(adata, resolution=res, key_added=f'leiden_r{res}')
n_clusters = adata.obs[f'leiden_r{res}'].nunique()
print(f'Resolution {res}: {n_clusters} clusters')
# Compare on UMAP
sc.pl.umap(adata, color=['leiden_r0.2', 'leiden_r0.5', 'leiden_r1.0'], ncols=3)
# Partition-based graph abstraction
sc.tl.paga(adata, groups='leiden')
sc.pl.paga(adata, color='leiden')
# Use PAGA for UMAP initialization
sc.tl.umap(adata, init_pos='paga')
library(Seurat)
library(ggplot2)
# Run PCA
seurat_obj <- RunPCA(seurat_obj, features = VariableFeatures(seurat_obj), npcs = 50)
# Visualize PCA
DimPlot(seurat_obj, reduction = 'pca')
VizDimLoadings(seurat_obj, dims = 1:2, reduction = 'pca')
# Heatmaps of PC genes
DimHeatmap(seurat_obj, dims = 1:6, cells = 500, balanced = TRUE)
# Elbow plot
ElbowPlot(seurat_obj, ndims = 50)
# JackStraw (more rigorous but slow)
seurat_obj <- JackStraw(seurat_obj, num.replicate = 100)
seurat_obj <- ScoreJackStraw(seurat_obj, dims = 1:20)
JackStrawPlot(seurat_obj, dims = 1:20)
# Build KNN graph
seurat_obj <- FindNeighbors(seurat_obj, dims = 1:30)
# Louvain clustering (default)
seurat_obj <- FindClusters(seurat_obj, resolution = 0.5)
# View cluster assignments
head(Idents(seurat_obj))
table(Idents(seurat_obj))
# Try multiple resolutions
seurat_obj <- FindClusters(seurat_obj, resolution = c(0.2, 0.5, 0.8, 1.0, 1.5))
# Results stored in metadata
head(seurat_obj@meta.data)
# Compare resolutions
library(clustree)
clustree(seurat_obj, prefix = 'RNA_snn_res.')
# Run UMAP
seurat_obj <- RunUMAP(seurat_obj, dims = 1:30)
# Visualize
DimPlot(seurat_obj, reduction = 'umap', label = TRUE)
# Split by sample
DimPlot(seurat_obj, reduction = 'umap', split.by = 'sample')
# Run tSNE
seurat_obj <- RunTSNE(seurat_obj, dims = 1:30)
# Visualize
DimPlot(seurat_obj, reduction = 'tsne')
library(Seurat)
# Assumes preprocessed data
seurat_obj <- readRDS('preprocessed.rds')
# PCA
seurat_obj <- RunPCA(seurat_obj, npcs = 50, verbose = FALSE)
# Neighbors
seurat_obj <- FindNeighbors(seurat_obj, dims = 1:30)
# Cluster
seurat_obj <- FindClusters(seurat_obj, resolution = 0.5)
# UMAP
seurat_obj <- RunUMAP(seurat_obj, dims = 1:30)
# Visualize
DimPlot(seurat_obj, reduction = 'umap', label = TRUE)
# Get PCA coordinates
pca_coords <- Embeddings(seurat_obj, reduction = 'pca')
# Get UMAP coordinates
umap_coords <- Embeddings(seurat_obj, reduction = 'umap')
# Add to metadata for custom plotting
seurat_obj$UMAP_1 <- umap_coords[, 1]
seurat_obj$UMAP_2 <- umap_coords[, 2]
| Parameter | Typical Values | Effect |
|---|---|---|
| n_pcs | 10-50 | More PCs capture more variance |
| n_neighbors | 10-30 | Higher = smoother, lower = more local |
| resolution | 0.2-2.0 | Higher = more clusters |
| min_dist (UMAP) | 0.1-0.5 | Lower = tighter clusters |
| Step | Scanpy | Seurat |
|---|---|---|
| PCA | sc.tl.pca() | RunPCA() |
| Neighbors | sc.pp.neighbors() | FindNeighbors() |
| Cluster | sc.tl.leiden() | FindClusters() |
| UMAP | sc.tl.umap() | RunUMAP() |
| tSNE | sc.tl.tsne() | RunTSNE() |