SPOTlight 的目标是提供一种工具, 能够对包含细胞混合物的每个捕获位置中存在的细胞类型和细胞类型比例进行解卷积,最初是为 10X 的 Visium - 空间转录组学技术开发的, it can be used for all technologies returning mixtures of cells 。 SPOTlight 基于通过 NMFreg 模型为每种细胞类型查找topics profiles singatures,并找到最适合我们想要解卷积的spot的组合。
Load single-cell reference dataset.
Load Spatial data
Visualize the clustering
为了确定最重要的标记基因,我们可以使用函数 Seurat::FindAllMarkers,它将返回每个cluster的标记。
Read RDS object
Before even looking at the decomposed spots we can gain insight on how well the model performed by looking at the topic profiles for the cell types.
The first thing we can do is look at how specific the topic profiles are for each cell type.
接下来我们可以看看每个细胞类型中每个细胞的各个topic profiles的行为。
在这里,我们期望来自同一细胞类型的所有细胞显示出相似的topic profiles分布, 否则该cluster中可能会有更多的子结构,我们可能只捕获其中一个 。
Lastly we can take a look at which genes are the most important for each topic and therefore get an insight into which genes are driving them.
Join decomposition with metadata
we can use the standard Seurat::SpatialFeaturePlot to view predicted celltype proportions one at a time.
现在我们知道在每个点内发现了哪些细胞类型,我们可以制作一个表示空间相互作用的图,其中细胞类型之间的边缘越强,我们在同一点内发现它们的频率越高。 为此,我们只需要运行 get_spatial_interaction_graph 函数,该函数将打印绘图并返回绘图所需的元素。
If you want to tune how the graph looks you can do the following or you can check out more options here :
Lastly one can compute cell-cell correlations to see groups of cells that correlate positively or negatively.
Here we are going to show step by step what is going on and all the different steps involved in the process
如果数据集非常大,我们希望在细胞数量和基因数量方面对其进行下采样,以训练模型。 为了进行下采样,我们希望保留每个簇的代表性细胞数量和最重要的基因。 我们表明这种下采样不会影响模型的性能并大大加快了模型训练的速度。
Once we have the data ready to pass to the model we can train it as shown below.
生活很好,有你更好