关于 depmap
depmap 是用于分析癌症细胞系 Cancer Dependency Map 数据的研究技能,面向肿瘤研究人员。它介绍如何通过 API 或下载数据开展基因依赖性、生物标志物、合成致死及化合物敏感性分析。
主要功能
- 01通过 API 查询 DepMap 数据
- 02分析 CRISPR 和 RNAi 依赖性评分
- 03查找选择性基因依赖
- 04检验突变相关生物标志物
- 05识别共必需基因
- 06分析化合物敏感性
适用场景
- 01验证某癌种中的靶点
- 02查找突变的合成致死伙伴
- 03识别药物反应生物标志物
- 04比较泛癌与选择性必需性
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ kalarislabs/ research-agent-skills --skill depmap安装后在 Claude Code 中输入/depmap确认已加载。
附带文件references/dependency_analysis.md
详细介绍
DepMap — 癌症依赖性图谱
概述
Broad Institute 开展的癌症依赖性图谱(DepMap)项目通过全基因组 CRISPR 敲除筛选(DepMap CRISPR)、RNA 干扰(RNAi)和化合物敏感性检测(PRISM),系统地表征数百种癌细胞系中的基因依赖性。DepMap 数据对于以下工作至关重要:
- 确定哪些基因对特定癌症类型至关重要
- 寻找癌症选择性依赖(治疗靶点)
- 验证肿瘤药物靶点
- 发现合成致死相互作用
关键资源:
- DepMap 门户:https://depmap.org/portal/
- DepMap 数据下载:https://depmap.org/portal/download/all/
- Python 包:
depmap(或通过 API/下载获取) - API:https://depmap.org/portal/api/
何时使用此技能
以下情况可使用 DepMap:
- 靶点验证:在具有特定突变(例如 KRAS 突变)的癌细胞系中,某个基因是否对存活至关重要?
- 生物标志物发现:哪些基因组特征可以预测细胞对敲除某个基因的敏感性?
- 合成致死:寻找在另一个基因发生突变/缺失时具有选择性必需性的基因
- 药物敏感性:哪些细胞系特征可以预测对某种化合物的响应?
- 泛癌必需性:某个基因在所有癌症类型中是否普遍必需(不适合作为靶点),还是仅在特定类型中必需?
- 相关性分析:哪些基因对的依赖性特征相关(共同必需性)?
核心概念
依赖性评分
| 评分 | 范围 | 含义 |
|---|---|---|
| Chronos(CRISPR) | ~ -3 至 0+ | 数值越负=越必需。常见必需性阈值:−1。泛必需基因约为 −1 至 −2 |
| RNAi DEMETER2 | ~ -3 至 0+ | 与 Chronos 的量表相似 |
| 基因效应 | 已归一化 | 归一化的 Chronos;−1=常见必需基因的中位效应 |
关键阈值:
- Chronos ≤ −0.5:很可能存在依赖性
- Chronos ≤ −1:强依赖(常见必需范围)
细胞系注释
每个细胞系都有:
DepMap_ID:唯一标识符(例如ACH-000001)cell_line_name:易读名称primary_disease:癌症类型lineage:广义组织谱系lineage_subtype:具体亚型
核心功能
1. DepMap API
import requests
import pandas as pd
BASE_URL = "https://depmap.org/portal/api"
def depmap_get(endpoint, params=None):
url = f"{BASE_URL}/{endpoint}"
response = requests.get(url, params=params)
response.raise_for_status()
return response.json()
2. 基因依赖性评分
def get_gene_dependency(gene_symbol, dataset="Chronos_Combined"):
"""Get CRISPR dependency scores for a gene across all cell lines."""
url = f"{BASE_URL}/gene"
params = {
"gene_id": gene_symbol,
"dataset": dataset
}
response = requests.get(url, params=params)
return response.json()
# Alternatively, use the /data endpoint:
def get_dependencies_slice(gene_symbol, dataset_name="CRISPRGeneEffect"):
"""Get a gene's dependency slice from a dataset."""
url = f"{BASE_URL}/data/gene_dependency"
params = {"gene_name": gene_symbol, "dataset_name": dataset_name}
response = requests.get(url, params=params)
data = response.json()
return data
3. 基于下载的分析(推荐用于大型查询)
对于大规模分析,请下载 DepMap 数据文件并在本地分析:
import pandas as pd
import requests, os
def download_depmap_data(url, output_path):
"""Download a DepMap data file."""
response = requests.get(url, stream=True)
with open(output_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
# DepMap 24Q4 data files (update version as needed)
FILES = {
"crispr_gene_effect": "https://figshare.com/ndownloader/files/...",
# OR download from: https://depmap.org/portal/download/all/
# Files available:
# CRISPRGeneEffect.csv - Chronos gene effect scores
# OmicsExpressionProteinCodingGenesTPMLogp1.csv - mRNA expression
# OmicsSomaticMutationsMatrixDamaging.csv - mutation binary matrix
# OmicsCNGene.csv - copy number
# sample_info.csv - cell line metadata
}
def load_depmap_gene_effect(filepath="CRISPRGeneEffect.csv"):
"""
Load DepMap CRISPR gene effect matrix.
Rows = cell lines (DepMap_ID), Columns = genes (Symbol (EntrezID))
"""
df = pd.read_csv(filepath, index_col=0)
# Rename columns to gene symbols only
df.columns = [col.split(" ")[0] for col in df.columns]
return df
def load_cell_line_info(filepath="sample_info.csv"):
"""Load cell line metadata."""
return pd.read_csv(filepath)
4. 识别选择性依赖
import numpy as np
import pandas as pd
def find_selective_dependencies(gene_effect_df, cell_line_info, target_gene,
cancer_type=None, threshold=-0.5):
"""Find cell lines selectively dependent on a gene."""
# Get scores for target gene
if target_gene not in gene_effect_df.columns:
return None
scores = gene_effect_df[target_gene].dropna()
dependent = scores[scores <= threshold]
# Add cell line info
result = pd.DataFrame({
"DepMap_ID": dependent.index,
"gene_effect": dependent.values
}).merge(cell_line_info[["DepMap_ID", "cell_line_name", "primary_disease", "lineage"]])
if cancer_type:
result = result[result["primary_disease"].str.contains(cancer_type, case=False, na=False)]
return result.sort_values("gene_effect")
# Example usage (after loading data)
# df_effect = load_depmap_gene_effect("CRISPRGeneEffect.csv")
# cell_info = load_cell_line_info("sample_info.csv")
# deps = find_selective_dependencies(df_effect, cell_info, "KRAS", cancer_type="Lung")
5. 生物标志物分析(基因效应与突变)
import pandas as pd
from scipy import stats
def biomarker_analysis(gene_effect_df, mutation_df, target_gene, biomarker_gene):
"""
Test if mutation in biomarker_gene predicts dependency on target_gene.
Args:
gene_effect_df: CRISPR gene effect DataFrame
mutation_df: Binary mutation DataFrame (1 = mutated)
target_gene: Gene to assess dependency of
biomarker_gene: Gene whose mutation may predict dependency
"""
if target_gene not in gene_effect_df.columns or biomarker_gene not in mutation_df.columns:
return None
# Align cell lines
common_lines = gene_effect_df.index.intersection(mutation_df.index)
scores = gene_effect_df.loc[common_lines, target_gene].dropna()
mutations = mutation_df.loc[scores.index, biomarker_gene]
mutated = scores[mutations == 1]
wt = scores[mutations == 0]
stat, pval = stats.mannwhitneyu(mutated, wt, alternative='less')
return {
"target_gene": target_gene,
"biomarker_gene": biomarker_gene,
"n_mutated": len(mutated),
"n_wt": len(wt),
"mean_effect_mutated": mutated.mean(),
"mean_effect_wt": wt.mean(),
"pval": pval,
"significant": pval < 0.05
}
6. 共同必需性分析
import pandas as pd
def co_essentiality(gene_effect_df, target_gene, top_n=20):
"""Find genes with most correlated dependency profiles (co-essential partners)."""
if target_gene not in gene_effect_df.columns:
return None
target_scores = gene_effect_df[target_gene].dropna()
correlations = {}
for gene in gene_effect_df.columns:
if gene == target_gene:
continue
other_scores = gene_effect_df[gene].dropna()
common = target_scores.index.intersection(other_scores.index)
if len(common) < 50:
continue
r = target_scores[common].corr(other_scores[common])
if not pd.isna(r):
correlations[gene] = r
corr_series = pd.Series(correlations).sort_values(ascending=False)
return corr_series.head(top_n)
# Co-essential genes often share biological complexes or pathways
查询工作流
工作流 1:验证某种癌症类型的靶点
- 下载
CRISPRGeneEffect.csv和sample_info.csv - 按癌症类型筛选细胞系
- 计算目标基因在该癌症类型与其他所有细胞系中的平均基因效应
- 计算选择性:该依赖性对目标癌症类型有多大特异性?
- 将结果与突变、表达或 CNA 数据交叉参照,作为生物标志物
工作流 2:合成致死筛选
- 找出在目标基因(例如 BRCA1)中存在突变/缺失的细胞系
- 分别计算突变细胞系和 WT 细胞系中所有基因的基因效应评分
- 找出在突变细胞系中显著更必需的基因(合成致死伙伴)
- 按选择性和效应大小筛选
工作流 3:化合物敏感性分析
- 下载 PRISM 化合物敏感性数据(
primary-screen-replicate-treatment-info.csv) - 分析化合物 AUC/log2(fold-change) 与基因组特征的相关性
- 找出可预测化合物敏感性的生物标志物
DepMap 数据文件参考
| 文件 | 描述 |
|---|---|
CRISPRGeneEffect.csv | CRISPR Chronos 基因效应(主要依赖性数据) |
CRISPRGeneEffectUnscaled.csv | 未缩放的 CRISPR 评分 |
RNAi_merged.csv | DEMETER2 RNAi 依赖性 |
sample_info.csv | 细胞系元数据(谱系、疾病等) |
OmicsExpressionProteinCodingGenesTPMLogp1.csv | mRNA 表达 |
OmicsSomaticMutationsMatrixDamaging.csv | 有害体细胞突变(二元) |
OmicsCNGene.csv | 每个基因的拷贝数 |
PRISM_Repurposing_Primary_Screens_Data.csv | 药物敏感性(药物再利用文库) |
从以下网址下载所有文件:https://depmap.org/portal/download/all/
最佳实践
- 使用 Chronos 评分(而非 DEMETER2)进行当前 CRISPR 分析——对切割效率的控制更好
- 区分泛必需基因和癌症选择性基因:方差较低的靶基因(在所有细胞系中都必需)不是理想的药物靶点
- 使用表达数据验证:如果某个基因在细胞系中不表达,无论其实际功能如何,都会被评为非必需
- 使用 DepMap ID 识别细胞系——cell_line_name 可能存在歧义
- 考虑拷贝数:扩增基因可能因拷贝数效应(垃圾 DNA 假说)而显得必需
- 多重检验校正:全基因组计算生物标志物关联时,应用 FDR 校正
其他资源
- DepMap 门户:https://depmap.org/portal/
- 数据下载:https://depmap.org/portal/download/all/
- DepMap 论文:Behan FM 等(2019)Nature。PMID:30971826
- Chronos 论文:Dempster JM 等(2021)Nature Methods。PMID:34349281
- GitHub:https://github.com/broadinstitute/depmap-portal
- Figshare:https://figshare.com/articles/dataset/DepMap_24Q4_Public/27993966
Agent 操作流程
- **检查环境。**确认网络访问、API 密钥(如有需要),以及数据库当前的 API 文档和速率限制。
- **明确输入。**根据数据或用户确认格式、标识符和参数。对于任何会改变结果的值,不要猜测,应先询问。
- **先运行小规模版本。**获取一条已知记录,并在批量查询前检查响应格式。
- 使用上述说明和参考资料执行完整任务。
- **验证结果。**确认标识符有效、报告记录数,并记录数据库版本或访问日期。
- **报告。**说明运行了什么(版本、命令、参数)、检查了什么,以及仍有哪些不确定之处。
| 如果发生这种情况 | 请这样做 |
|---|---|
| HTTP 429 或 5xx 错误 | 通过退避策略遵守速率限制、分批请求,并如实报告部分结果。 |
| 这些说明中的函数、标志或端点在已安装版本中不存在 | 查看已安装版本自身的文档(help()、--help、官方文档),进行调整并告知用户。切勿捏造 API。 |
| 必需输入、标识符或参数存在歧义 | 询问用户,或在运行前明确说明假设。 |
完整性规则
- 切勿捏造结果、参数、标识符、引文或统计数据。如果无法运行或验证某项内容,请明确说明。
- 切勿虚构登录号、ID 或记录;找不到时请报告“未找到”。
- 此处与特定版本相关的细节可能已过时:请对照已安装版本的官方文档进行确认。
- 对于需要付费、占用共享 GPU 或云配额、涉及个人或患者数据,或无法撤销的操作,请先征求同意。
相关技能
imaging-data-commons:查询和下载 NCI Imaging Data Commons 中的公开癌症影像数据。arboreto:使用可扩展算法(GRNBoost2、GENIE3)从基因表达数据推断基因调控网络(GRN)。
评论
支持 Markdown