空间转录组的细胞通讯分析算法很多,今天来学习一个可以得到通讯结果信息流向的一个算法COMMOT,这个算法被封装为了一个Python模块,算法于2023年1月23号发表在顶刊Nature Methods杂志上,标题为《Screening cell–cell communication in spatial transcriptomics via collective optimal transport》。
学习节奏:1看文献了解原理,2看官方说明手册,3运行官网示例,最后就是看这个算法在一些高分文献中的应用啦!
先把官网网址放出来:
官网的参考文档(https://github.com/zcang/COMMOT)
python官网:https://commot.readthedocs.io/en/latest/index.html(这里比较详细)
先看看几个缩写的含义:cell–cell communication (CCC),COMMOT (COMMunication analysis by Optimal Transport, 基于最优传输的通信分析)
这个算法不一样的地方在于加入了:不同配体和受体之间的竞争以及细胞之间的空间距离。
集体最优传输(collective optimal transport)在细胞间通信(CCC)分析中的应用及其三个关键特点:
下面是这个算法的Overview:
因为这篇文献的作者来自数学系,嗯,给了一个数学公式说明其原理:
给定一个包含 ns个细胞或点的空间转录组学数据集,以及 nl 种配体和 nr 种受体。
通过集体最优传输,确定一个最优的多物种耦合 P∗,其维度为 nl×nr×ns×ns。
矩阵 P∗ 中的元素 P*~i,j,k,l~ 表示通过配体 i 和受体 j 从发送细胞 k 到接收细胞 l 的信号强度。
通过解决一个最小化问题来找到最优耦合矩阵 P∗。该问题的目标函数涉及:
这个文献用了五种测序技术来表明其方法的可靠性。
b,c,两个示例配体-受体对GAS6-TYRO3和PROS1-TYRO3在细胞水平(b)和细胞簇水平(c)上推断出的接收信号量
展示了四种主要信号通路的信号传导方向。信号传导方向可能通过向量场或其他可视化方式表示,反映了信号在细胞或组织中的传播路径:
人乳腺癌组织:
小鼠脑组织中的信号:
这些案例的分析代码可以去这里看:https://doi.org/10.5281/zenodo.7272562
安装在conda小环境spatial中,然后运行使用vscode的jupter插件,非常方便:
conda activate spatial
pip install commot -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
新建jupter脚本:
touch commot.ipynb
加载python模块测试是否成功:
import commot as ct
import scanpy as sc
import pandas as pd
import numpy as np
使用的还是10x genomics官网发布的很有名的数据:V1_Mouse_Brain_Sagittal_Posterior
下载地址:https://www.10xgenomics.com/datasets/mouse-brain-serial-section-1-sagittal-posterior-1-standard-1-0-0
下载并整理成如下格式:
#V1_Mouse_Brain_Sagittal_Posterior
.
├── filtered_feature_bc_matrix.h5
├── spatial
│ ├── aligned_fiducials.jpg
│ ├── detected_tissue_image.jpg
│ ├── scalefactors_json.json
│ ├── tissue_hires_image.png
│ ├── tissue_lowres_image.png
│ └── tissue_positions_list.csv
└── web_summary.html
简单读取进来:
import scanpy as sc
adata = sc.read_visium(path="../data/V1_Mouse_Brain_Sagittal_Posterior/")
adata.var_names_make_unique()
adata
后面运行的代码我就不放了,官网写了非常详细:https://commot.readthedocs.io/en/latest/notebooks/visium-mouse_brain.html
需要注意的地方在于 空间细胞通讯的那句:dis_thr=500 这个参数的设定比较重要,dis_thr (Optional
[float
]) – The threshold of spatial distance of signaling,空间距离通讯的限制参数,需要根据实际情况进行调整~
ct.tl.spatial_communication(adata_dis500,
database_name='cellchat', df_ligrec=df_cellchat_filtered, dis_thr=, heteromeric=True, pathway_sum=True)
看看这篇于2024年12月12号发表在Cell杂志上的文献,标题为《Multiparameter imaging reveals clinically relevant cancer cell-stroma interaction dynamics in head and neck cancer》。
这里的细胞通讯作者用的cellphonedb,只是用 使用 COMMOT(版本 0.0.325)通过函数 commot.tl.spatial_communication
计算了选定通路的空间相互作用得分,其中设置了空间距离阈值参数 dis_thr=500
。结果通过 squidy.pl.spatial_scatter
和 seaborn(版本 0.13.252)进行可视化,展示了接收方和发送方得分的总和,以小提琴图的形式呈现。