單細胞基因組學分析需要機率模型來處理技術雜訊和批次效應。scvi-tools 提供深度生成模型,使用變分推理進行降維、批次校正、差異表達和單細胞資料的多模態整合。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「scvi-tools」。 幫我在我的包含兩個批次的單細胞資料集上設定 scVI 進行批次校正。
預期結果:
```python
import scvi
import scanpy as sc
# Preprocess data
adata = sc.read_h5ad("my_single_cell_data.h5ad")
sc.pp.filter_genes(adata, min_counts=3)
# Register data with batch information
scvi.model.SCVI.setup_anndata(
adata,
layer="counts",
batch_key="batch"
)
# Train model
model = scvi.model.SCVI(adata)
model.train()
# Get batch-corrected latent representation
latent = model.get_latent_representation()
adata.obsm["X_scVI"] = latent
# Downstream analysis
sc.pp.neighbors(adata, use_rep="X_scVI")
sc.tl.umap(adata)
sc.tl.leiden(adata)
```
正在使用「scvi-tools」。 如何在我的 scVI 模型中識別兩種細胞類型之間的標記基因?
預期結果:
```python
# Differential expression between two groups
de_results = model.differential_expression(
groupby="leiden",
group1="0", # Cluster 0
group2="1", # Cluster 1
mode="change",
delta=0.25 # Minimum effect size
)
# View top differentially expressed genes
print(de_results.head(20))
# Filter for significant genes
significant_genes = de_results[
(de_results['is_de_fdr_0.05']) &
(de_results['bayes_factor'] > 1)
]
print(f"Found {len(significant_genes)} differentially expressed genes")
```
安全審計
低風險This is a documentation-only skill containing markdown reference files for scvi-tools, a legitimate Python library for single-cell genomics analysis. All 399 static findings are false positives caused by incorrect pattern matching: Python code examples in documentation were flagged as shell commands, bioinformatics statistical terms were misidentified as cryptographic algorithms, and documentation URLs were flagged as hardcoded URLs. No executable code or malicious patterns exist. Safe for publication.
風險因素
🌐 網路存取 (1)
📁 檔案系統存取
品質評分
你能建構什麼
整合單細胞分析的批次校正
使用 scVI 從跨多個供體、協定或測序運行的單細胞 RNA-seq 資料集中移除技術批次效應,以建立統一的整合細胞圖譜。
帶有不確定性的差異表達
識別細胞類型或條件之間的差異表達基因,並提供機率不確定性估計,為下游驗證提供更可靠的統計結論。
多模態資料整合
聯合分析配對的 RNA 和蛋白質測量(CITE-seq)或染色質可及性資料,以增強的生物學解析度發現細胞群體。
試試這些提示
幫我設定 scvi-tools 來分析我的單細胞 RNA-seq 資料。我有一個包含原始計數資料的 AnnData 物件,並想執行批次校正。向我展示如何註冊資料、訓練模型和提取潛在表示。
我在帶有細胞類型註釋的單細胞資料集上訓練了一個 scVI 模型。幫我使用 differential_expression 方法識別兩種細胞類型(例如,叢集 A vs 叢集 B)之間的差異表達基因。包括如何解釋結果和設定效應量閾值。
我有配對的 CITE-seq 資料,包含 RNA 計數和蛋白質抗體衍生計數。幫我設定 totalVI 以聯合建模兩種模態,訓練模型並提取捕捉 RNA 和蛋白質變異的聯合潛在表示。
我有一個帶有細胞類型註釋的單細胞參考資料集和一個帶有位點級計數的空間轉錄組學資料集。幫我使用 DestVI 或 Stereoscope 在空間資料中反卷積細胞類型並建立細胞類型比例圖。
最佳實務
- 始終向 scvi-tools 模型提供原始、未正規化的計數資料以實現準確的機率建模
- 在設定期間註冊所有已知的技術協變量(批次、供體、協定)以改進批次校正
- 使用 model.save() 定期儲存訓練好的模型,以避免在大型資料集上重新訓練
- 在訓練超過 50,000 個細胞的資料集時使用 GPU 加速(accelerator="gpu")
避免
- 不要使用對數正規化資料作為輸入 - scvi-tools 模型期望原始計數資料
- 訓練前不要跳過資料過濾(低計數基因/細胞),因為它會影響模型品質
- 不要在未根據已知生物標記驗證的情況下解釋潛在表示
- 不要將 scvi-tools 用於大量 RNA-seq 分析 - 它是專門為單細胞資料設計的