본문으로 건너뛰기
Skillpedia
머신러닝51k · #3559

scanpy

하는 일

이 도구는 단일 세포 RNA 시퀀싱(scRNA-seq) 데이터를 분석합니다. 데이터 품질을 이해하고, 비슷한 세포를 묶고, 중요한 유전자를 찾고, 결과를 시각화하도록 돕습니다.

사용하는 경우

  • ✓원시 단일 세포 시퀀싱 데이터가 있을 때.
  • ✓단일 세포 데이터를 정리하고 시각화할 때.
  • ✓시료에서 세포 유형을 식별할 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/scanpy/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/scanpy/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 단일 세포 RNA-seq 데이터를 분석해 주세요. 품질 관리를 하고, 정규화하고, PCA와 UMAP으로 차원을 줄이고, 세포를 군집화하고, 마커 유전자를 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 Scanpy라는 지침 세트를 사용해 데이터를 처리합니다. 정리, 정규화, 차원 축소, 군집화 같은 여러 단계를 수행해 데이터의 패턴을 드러냅니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 counts when X is already normalized; never infer provenance from integer-looking values alone.
  • layers["counts"] remains unnormalized; .raw is an independent full-gene log-normalized snapshot. Gene subsetting also subsets every layer, but does not subset .raw genes. Retain a full-gene object for pseudobulk; the full pipeline does so.
  • seurat/cell_ranger HVGs use log-normalized values; seurat_v3 and seurat_v3_paper use counts and require scanpy[skmisc]. Scaling/regression are optional, may densify sparse data, and can remove biology along with covariates.
  • Marker ranking defaults to .raw when present; --no-use-raw selects X and --layer selects an explicit log-normalized layer. --groups/--reference control 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.
  • .rds needs 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.

…

자주 묻는 질문

단일 세포 RNA 시퀀싱(scRNA-seq) 데이터란 무엇인가요?

개별 세포의 RNA를 분석하는 기술로, 조직이나 시료에 있는 각 세포의 다양성과 기능을 드러냅니다.

.h5ad 파일이란 무엇인가요?

단일 세포 데이터를 효율적으로 저장하는 데 쓰이는 흔한 파일 형식으로, Scanpy 도구와 호환됩니다.

.rds 같은 다른 형식의 데이터도 쓸 수 있나요?

네, 이 도구는 분석 전에 .rds(R에서 흔한 형식) 데이터를 .h5ad 형식으로 변환할 수 있습니다.

상세 정보

작성자의 원본 설명

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.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3559
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬