AgentSkillsCN

gcell-celltype

利用 gcell 进行细胞类型调控分析。当用户询问以下内容时,可运用此技能: - 加载预先推断的细胞类型(GET 模型输出) - 展示转录因子对基因影响的基因—基序矩阵 - 通过基因雅可比矩阵分析调控重要性 - 可视化基序子网 - 探索细胞类型特异性的基因表达模式 触发条件:细胞类型、调控分析、基因表达、雅可比矩阵、基序子网、GET 模型、转录因子影响

SKILL.md
--- frontmatter
name: gcell-celltype
description: |
  Cell type regulatory analysis using gcell. Use this skill when users ask about:
  - Loading pre-inferred cell types (GET model outputs)
  - Gene-by-motif matrices showing TF influence on genes
  - Gene Jacobian analysis for regulatory importance
  - Motif subnet visualization
  - Cell type-specific gene expression patterns
  Triggers: cell type, regulatory analysis, gene expression, Jacobian, motif subnet, GET model, TF influence

Cell Type Regulatory Analysis

Loading Cell Types

python
from gcell.cell.celltype import GETDemoLoader

# Initialize loader
loader = GETDemoLoader()

# List available pre-inferred cell types
print(loader.available_celltypes)

# Load a specific cell type
ct = loader.load_celltype('Plasma Cell')
ct = loader.load_celltype('CD4+ T Cell')
ct = loader.load_celltype('Monocyte')

Gene-by-Motif Analysis

The gene-by-motif matrix shows how transcription factor motifs influence gene expression in a cell type.

python
# Get gene-by-motif matrix
gbm = ct.get_gene_by_motif()

# gbm is a DataFrame with genes as rows, motifs as columns
# Values represent regulatory influence scores
print(gbm.shape)
print(gbm.loc['MYC'])  # TF influences on MYC

Gene Jacobian Analysis

Jacobian analysis reveals which regulatory elements most influence a gene's expression.

python
# Get Jacobian summary for a specific gene
jacobian = ct.get_gene_jacobian_summary('MYC')
jacobian = ct.get_gene_jacobian_summary('TP53')

# Jacobian shows importance of each motif for the gene
print(jacobian.sort_values(ascending=False).head(20))

Motif Subnet Visualization

Visualize the regulatory network around a specific motif/TF.

python
# Interactive plotly visualization
ct.plotly_motif_subnet(motif_name='STAT3', top_genes=20)
ct.plotly_motif_subnet(motif_name='PU.1', top_genes=30)
ct.plotly_motif_subnet(motif_name='GATA1', top_genes=15)

# Parameters:
# - motif_name: Name of the motif/TF to center the network on
# - top_genes: Number of most influenced genes to show

Key Classes

ClassPurpose
GETDemoLoaderLoad pre-inferred cell types
GETCellTypeCell type analysis container
GETHydraCellTypeMulti-cell type analysis

Data Location

Pre-inferred cell type data is downloaded automatically to ~/.gcell_data/ on first use.