一旦计算出药物得分,就有可能实现以下目标:(1)找到感兴趣的药物靶向的细胞;(2) 找到靶向感兴趣细胞的药物;和(3)发现靶细胞中表达的靶分子,并可能介导药物的作用
最近使用Drug2cell,目标是找到靶向感兴趣细胞的药物,正好Drug2cell可以完成这件事,使用一下试试。
Drug2cell是发表在Nature的一项分析流程,python开发,流程示意图如下:
github链接:https://github.com/Teichlab/drug2cell
安装
# Installation
pip install drug2cell
# Successfully installed drug2cell-0.1.0
# Drug2cell's GSEA makes use of blitzGSEA, which needs to be installed from GitHub:
# pip install git+https://github.com/MaayanLab/blitzgsea.git
pip install blitzgsea
# Successfully installed blitzgsea-1.3.35
demo
import scanpy as sc
import drug2cell as d2c
import blitzgsea as blitz
sc.settings.set_figure_params(dpi=80)
adata = sc.datasets.pbmc3k_processed()
sc.pl.umap(adata, color="louvain")
计算得分
The scoring function efficiently computes the mean of the expression of each gene group in each cell. Can be directed to an appropriate location of log-normalised data via a combination of the layer
and use_raw
arguments.
By default, the function will load a set of ChEMBL drugs and their targets in a form distributed with the package.
计算每个细胞每个基因组的平均表达,可以指定使用哪个表达矩阵。默认情况下,该函数将以随包分发的形式加载一组 ChEMBL 药物及其靶标。
d2c.score(adata, use_raw=True)
d2c.score()在adata.uns['drug2cell']中创建了一个成熟的AnData对象,以基因组为特征空间。原始对象的.obs和.obsm被复制,以便于下游使用。让我们使用UMAP来可视化药物
adata.uns['drug2cell']
AnnData object with n_obs × n_vars = 2638 × 1637
obs: 'n_genes', 'percent_mito', 'n_counts', 'louvain'
var: 'genes', 'all_genes'
obsm: 'X_pca', 'X_tsne', 'X_umap', 'X_draw_graph_fr'
sc.pl.umap(adata.uns['drug2cell'], color="CHEMBL1743048|OBINUTUZUMAB", color_map="OrRd")
我们可以使用这个新对象进行差异表达分析,得到在特定簇中上调的基因组。
sc.tl.rank_genes_groups(adata.uns['drug2cell'], method="wilcoxon", groupby="louvain")
sc.pl.rank_genes_groups_dotplot(adata.uns['drug2cell'], swap_axes=True, dendrogram=False, n_genes=5)
如果使用ChEMBL药物靶点并旨在绘制完整的ATC组,drug2cell中有一个辅助功能,可以为扫描图绘制准备一些额外的论据。将它们传递给可视化功能,选择合适的化合物并将它们很好地分组。这样做的语法是将d2c.util.prepare_plot_args()的输出捕获到一个变量中,然后将该变量传递到一个开头带有**的绘图函数中,如下所示。
plot_args = d2c.util.prepare_plot_args(adata.uns['drug2cell'], categories=["B01","B02","B03"])
sc.pl.dotplot(adata.uns['drug2cell'], groupby="louvain", swap_axes=True, **plot_args)
指定基因组
重点来了
可以使用drug2cell对任意的基因组进行评分。
让我们加载一个gsea组并查看格式
targets = blitz.enrichr.get_library("GO_Molecular_Function_2021")
targets['UDP-xylosyltransferase activity (GO:0035252)']
targets['UDP-xylosyltransferase activity (GO:0035252)']
['POGLUT1', 'POGLUT3', 'XXYLT1', 'POGLUT2', 'GXYLT2', 'GXYLT1', 'RXYLT1']
现在可以对这些基因组进行drug2cell的评分,将它们作为目标参数传递。
d2c.score(adata, targets=targets, use_raw=True)
sc.pl.umap(adata.uns['drug2cell'], color="WW domain binding (GO:0050699)", color_map="OrRd")