scanpy
Skill này làm gì
Công cụ này phân tích dữ liệu giải trình tự RNA đơn tế bào (scRNA-seq). Nó giúp hiểu chất lượng dữ liệu, nhóm các tế bào tương tự, tìm các gen quan trọng và trực quan hóa kết quả.
Khi nào nên dùng
- ✓Khi bạn có dữ liệu giải trình tự đơn tế bào thô.
- ✓Khi cần sắp xếp và trực quan hóa dữ liệu đơn tế bào.
- ✓Khi muốn xác định các loại tế bào khác nhau trong mẫu.
Liên kết skill
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/scanpy/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Phân tích dữ liệu RNA-seq đơn tế bào của tôi: kiểm soát chất lượng, chuẩn hóa dữ liệu, giảm chiều bằng PCA và UMAP, phân cụm tế bào và tìm các gen đánh dấu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng một bộ lệnh gọi là Scanpy để xử lý dữ liệu. Nó thực hiện nhiều bước như làm sạch, chuẩn hóa, giảm chiều và phân cụm để làm lộ ra các quy luật trong dữ liệu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Scanpy: Single-Cell Analysis
Overview
Scanpy is a scalable Python toolkit for analyzing single-cell RNA-seq data, built on AnnData. Apply this skill for complete single-cell workflows including quality control, normalization, dimensionality reduction, clustering, marker gene identification, visualization, and trajectory analysis. Targets Scanpy 1.12.4 (released 2026-08-27), reviewed 2026-10-01. Native synthetic tests establish data/API contracts, not biological validity.
Installation
Requires Python 3.12+ (scanpy 1.12 dropped Python ≤3.11) and anndata ≥0.10.
uv pip install "scanpy[leiden]"
The [leiden] extra installs igraph and leidenalg; the scripts explicitly select flavor="igraph". For reproducible environments, pin a version: uv pip install "scanpy[leiden]==1.12.4".
For large or out-of-core datasets, many functions support Dask arrays (experimental):
uv pip install "scanpy[leiden]" dask
See the Using dask with Scanpy tutorial. For GPU-accelerated scanpy-like operations, use rapids-singlecell as a separate package.
If the input is an R-native single-cell object (.rds, .RData, Seurat, or SingleCellExperiment), first convert it to .h5ad with R tooling, then load it with Scanpy. Read references/r_interop.md for agent-run installation and conversion instructions across macOS, Linux, and Windows.
For AnnData structure and I/O details, use the anndata skill. For probabilistic models and batch correction, use scvi-tools.
Representation and inference contracts
- Input to QC/preprocessing must be identified raw counts. The scripts reject negative,
fractional, nonfinite or zero-total cells. Use
--counts-layer countswhen X is already normalized; never infer provenance from integer-looking values alone. layers["counts"]remains unnormalized;.rawis an independent full-gene log-normalized snapshot. Gene subsetting also subsets every layer, but does not subset.rawgenes. Retain a full-gene object for pseudobulk; the full pipeline does so.seurat/cell_rangerHVGs use log-normalized values;seurat_v3andseurat_v3_paperuse counts and requirescanpy[skmisc]. Scaling/regression are optional, may densify sparse data, and can remove biology along with covariates.- Marker ranking defaults to
.rawwhen present;--no-use-rawselects X and--layerselects an explicit log-normalized layer.--groups/--referencecontrol contrasts. Wilcoxon/t-test adjusted p-values use BH within each comparison; logreg returns ranking scores without p-values. Clusters chosen from the same data yield exploratory markers. - Condition DE requires raw-count sums per sample and cell type, independent biological replicates, aligned condition/donor metadata and a full-rank design. Analyze each cell type separately; repeated donor samples require a suitable paired design. Aggregation cannot fix confounding, missing replication, doublets or incorrect annotations.
- Harmony (
harmonypy) changes PCA coordinates; BBKNN (bbknn) changes the graph; ComBat changes X. Keep original expression/counts for DE, and assess biological conservation and batch mixing together. Requested integration/doublet failures stop. - The toolkit loads files into memory. For backed data, explicitly call
.to_memory()on a chosen subset and close the file; backed mode is not a general out-of-core pipeline. Copy views before mutation. Dask support varies by function/array layout. .rdsneeds an explicit R conversion stage. Cluster IDs do not determine cell types: all mappings/signature assets are illustrative human marker examples, requiring review.
Harmony 2 returns cells x PCs; the toolkit calls its native API because the Scanpy 1.12.4 wrapper still transposes that output and fails with current Harmony.
Optional packages: scikit-image for Scrublet automatic thresholding, loompy for Loom,
scikit-misc for v3 HVGs, harmonypy==2.0.2/bbknn==1.6.0 for their integration branches, and louvain
for the deprecated Louvain option (separate environment: louvain 0.8.2 requires
igraph <0.12, conflicting with the tested igraph 1.0). Install only needed branches. R and optional integration
execution boundaries are recorded in references/upstream-review.md.
…
Câu hỏi thường gặp
Dữ liệu giải trình tự RNA đơn tế bào là gì?
Đó là công nghệ cho phép phân tích RNA của từng tế bào riêng lẻ, giúp thấy được sự đa dạng và chức năng của mỗi tế bào trong mô hoặc mẫu.
File .h5ad là gì?
Đó là định dạng file phổ biến dùng để lưu dữ liệu đơn tế bào một cách hiệu quả, tương thích với Scanpy.
Tôi có thể dùng dữ liệu ở định dạng khác như .rds không?
Có, công cụ có thể chuyển dữ liệu từ định dạng như .rds (phổ biến trong R) sang định dạng .h5ad trước khi phân tích.
Chi tiết
Mô tả gốc của tác giả
Performs Scanpy single-cell RNA-seq QC, normalization, HVG selection, PCA/UMAP/t-SNE, clustering, exploratory marker ranking, pseudobulk preparation, visualization, and Seurat or SingleCellExperiment RDS conversion to h5ad. Applies to established exploratory scRNA-seq workflows with explicit count and expression provenance; complementary skills cover scvi-tools models and AnnData format details.
Độ phổ biến
- Sao GitHub
- 51k
- Vị trí xếp hạng
- #3559
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
13c-metabolic-flux
51kƯớc tính thông lượng chuyển hóa bằng dữ liệu theo dõi đồng vị carbon-13. Hữu ích để phân tích chuyển hóa tế bào và các con đường sinh hóa.
adaptyv
51kThiết kế thí nghiệm đặc trưng protein bằng Adaptyv API. Hỗ trợ ước tính chi phí, gửi trình tự và theo dõi kết quả phòng thí nghiệm.
aeon
51kThực hiện các tác vụ học máy trên dữ liệu chuỗi thời gian. Hữu ích để phân loại, dự báo, phát hiện bất thường và tìm mẫu trong dữ liệu tuần tự.
alphagenome
51kTra cứu các tác động di truyền đã được tính trước cho biến thể gen. Cung cấp điểm số và giải thích để hiểu ảnh hưởng của biến thể lên bộ gen.
Skill tương tự
pytorch-patterns
280kGiúp agent của bạn dùng PyTorch cho các mô hình học máy. Áp dụng thực hành tốt nhất để huấn luyện mô hình hiệu quả và đảm bảo kết quả có thể lặp lại.
evm-token-decimals
280kGiúp agent tránh lỗi về số thập phân khi làm việc với các mạng blockchain khác nhau. Đảm bảo giá trị token chính xác trong giao dịch và phép tính.
ito-inference
280kGiúp agent kiểm tra xem các mô hình AI đã sẵn sàng để dùng chưa. Kết nối yêu cầu tài nguyên tính toán với dịch vụ mô hình đã sẵn sàng.