https://github.com/ZJUFanLab/SpaTalk
Knowledge-graph-based cell-cell communication inference for spatially resolved transcriptomic data
https://github.com/ZJUFanLab/SpaTalk
cell-cell-communication cell-cell-interaction graph-network knowledge-graph ligand-receptor-interaction single-cell spatial-data-analysis spatial-transcriptomics spatially-resolved-transcriptomics
Last synced: 19 days ago
JSON representation
Knowledge-graph-based cell-cell communication inference for spatially resolved transcriptomic data
- Host: GitHub
- URL: https://github.com/ZJUFanLab/SpaTalk
- Owner: ZJUFanLab
- License: gpl-3.0
- Created: 2022-03-29T11:07:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-17T07:56:46.000Z (4 months ago)
- Last Synced: 2025-04-25T21:16:53.403Z (24 days ago)
- Topics: cell-cell-communication, cell-cell-interaction, graph-network, knowledge-graph, ligand-receptor-interaction, single-cell, spatial-data-analysis, spatial-transcriptomics, spatially-resolved-transcriptomics
- Language: R
- Homepage: https://github.com/multitalk/awesome-cell-cell-communication
- Size: 9.83 MB
- Stars: 69
- Watchers: 3
- Forks: 18
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-cell-cell-communication - SpaTalk - [R]- SpaTalk is a spatially resolved cell-cell communication inference method relying on the graph network and knowledge graph to model ligand-receptor-target signaling network for either single-cell or spot-based spatially resolved transcriptomic data, e.g., STARmap, MERFISH, seqFISH, Slide-seq, 10X Visium. (Uncategorized / Uncategorized)
README
# SpaTalk
[](https://www.r-project.org/) [](https://doi.org/10.5281/zenodo.6809147) [](https://github.com/multitalk/awesome-cell-cell-communication/blob/main/method/SpaTalk.ipynb) [](https://www.nature.com/articles/s41467-022-32111-8)### A cell-cell communication inference approach for spatially resolved transcriptomic data
[Spatially resolved transcriptomics (ST)](https://pubmed.ncbi.nlm.nih.gov/32505359/) provides the informative details of genes and retained the crucial spatial information, which have enabled the uncovering of spatial architecture in intact organs, shedding light on the spatially resolved [cell-cell communications](https://pubmed.ncbi.nlm.nih.gov/32435978/) mediating tissue homeostasis, development and disease. However, inference of cell-cell communications for ST data remains a great challenge. Here, we present SpaTalk, a spatially resolved cell-cell communication inference method relying on the [graph network](https://pubmed.ncbi.nlm.nih.gov/34500471/) and [knowledge graph](https://www.sciencedirect.com/science/article/pii/S1570826820300585) to model ligand-receptor-target signaling network between the spatially proximal cells, which were decomposed from the ST data through the non-negative linear model and spatial mapping between single-cell RNA-seq and ST data. SpaTalk is a reliable method that can help scientists uncover the spatially resolved cell-cell communications for either single-cell or spot-based ST data universally, providing new insights into the understanding of spatial cellular dynamics in tissues.
# Install
- install dependent packages `devtools` and [`NNLM`](https://github.com/linxihui/NNLM)
```
> install.packages(pkgs = 'devtools')
> devtools::install_github('linxihui/NNLM')
```- then install SpaTalk
```
> devtools::install_github('ZJUFanLab/SpaTalk')# or download the repository as ZIP
> devtools::install_local("/path/to/SpaTalk-main.zip")
```# Usage
SpaTalk method consists of two components, wherein the first is to dissect the cell-type composition of ST data and the second is to infer the spatially resolved cell-cell communications over the decomposed single-cell ST data. Classification and description of SpaTalk functions are shown in the __[wiki page](https://github.com/ZJUFanLab/SpaTalk/wiki)__ and __[tutorial](https://raw.githack.com/multitalk/awesome-cell-cell-communication/main/method/tutorial.html)__- ### Cell-type decomposition to reconstruct single-cell ST atlas with known cell types
```
# st_data: A matrix containing counts of st data
# st_meta: A data.frame containing x and y
# sc_data: A matrix containing counts of scRNA-seq data as the reference
# sc_celltype: A character containing the cell types for scRNA-seq data> obj <- createSpaTalk(st_data, st_meta, species)
>
> obj
An object of class SpaTalk
996 genes across 509 spots (0 lrpair)
>
> obj <- dec_celltype(obj, sc_data, sc_celltype)
```- ### Inference of cell-cell communication and ligand-receptor-target network in space
```
# obj: SpaTalk object containg ST and scRNA-seq data
# lrpairs: A data.frame of the system data containing ligand-receptor pairs
# pathways: A data.frame of the system data containing gene-gene interactions and pathways
# celltype_sender
# celltype_receiver> obj <- find_lr_path(object = obj, lrpairs = lrpairs, pathways = pathways)
> obj <- dec_cci(obj, celltype_sender, celltype_receiver)
```OR
```
> obj <- dec_cci_all(object)# score in obj@lrpair is the combined score
> str(obj@lrpair)
'data.frame': 9 obs. of 9 variables:
$ ligand : chr "Inhba" "Inhba" "Sst" "Apoe" ...
$ receptor : chr "Acvr1c" "Acvr1c" "Sstr2" "Sdc4" ...
$ species : chr "Mouse" "Mouse" "Mouse" "Mouse" ...
$ celltype_sender : chr "eL6" "Astro" "SST" "Smc" ...
$ celltype_receiver : chr "PVALB" "eL2_3" "PVALB" "Astro" ...
$ lr_co_exp_num : num 8 8 2 31 21 5 16 4 5
$ lr_co_ratio : num 0.216 0.092 0.286 0.912 0.618 ...
$ lr_co_ratio_pvalue: num 0.001 0.042 0.009 0 0 0.028 0 0.001 0.001
$ score : num 0.855 0.837 0.707 0.709 0.709 ...# score in obj@tf is the intra-cellular score
> str(obj@tf)
'data.frame': 8 obs. of 7 variables:
$ celltype_sender : chr "eL6" "Astro" "SST" "Smc" ...
$ celltype_receiver: chr "PVALB" "eL2_3" "PVALB" "Astro" ...
$ receptor : chr "Acvr1c" "Acvr1c" "Sstr2" "Sdc4" ...
$ tf : chr "Smad3" "Smad3" "Smad3" "Smad3" ...
$ n_hop : num 1 1 3 3 1 3 1 1
$ n_target : num 1 1 1 1 2 1 2 2
$ score : num 1 1 0.0565 0.0405 1 0.0871 1 1
```# Note
[](http://tcm.zju.edu.cn/celltalkdb/) [](https://www.kegg.jp/kegg/pathway.html) [](https://reactome.org/) [](http://bioinfo.life.hust.edu.cn/AnimalTFDB/#!/)SpaTalk uses the ligand-receptor interactions (LRIs) from [`CellTalkDB`](http://tcm.zju.edu.cn/celltalkdb/), pathways from [`KEGG`](https://www.kegg.jp/kegg/pathway.html) and [`Reactome`](https://reactome.org/), and transcrptional factors (TFs) from [`AnimalTFDB`](http://bioinfo.life.hust.edu.cn/AnimalTFDB/#!/) by default. In the current version:
- __SpaTalk can be applied to either [single-cell (vignette)](https://raw.githack.com/multitalk/awesome-cell-cell-communication/main/method/sc_tutorial.html) or [spot-based (vignette)](https://raw.githack.com/multitalk/awesome-cell-cell-communication/main/method/spot_tutorial.html) ST data__
- __SpaTalk allows to use custom [LRIs(wiki)](https://github.com/ZJUFanLab/SpaTalk/wiki/Use-customed-lrpairs), [pathways, and TFs database (wiki)](https://github.com/ZJUFanLab/SpaTalk/wiki/Use-customed-pathways)__
- __SpaTalk allows to use the parallel processing for `dec_celltype()`, `dec_cci()`, and `dec_cci_all()`__
- __SpaTalk allows to [use other deconvolution methods](https://github.com/ZJUFanLab/SpaTalk/wiki/Use-other-deconvolution-methods) followed by the inference of cell-cell communications__
- RCTD, Seurat, SPOTlight, deconvSeq, stereoscope, cell2location, or other methods
- __SpaTalk allows to [directly infer cell-cell communications skiping deconvolution](https://github.com/ZJUFanLab/SpaTalk/wiki/Directly-infer-cell-cell-communication-skiping-deconvolution)__
- __SpaTalk can visualize [cell-type compositions (wiki)](https://github.com/ZJUFanLab/SpaTalk/wiki#visulization-cell-types) and [cell-cell communications (wiki)](https://github.com/ZJUFanLab/SpaTalk/wiki#visulization-cell-cell-communications)__
- LRIs and pathways can be download at[`data/`](https://github.com/ZJUFanLab/SpaTalk/tree/main/data)
- Demo data can be download at[`inst/extdata/`](https://github.com/ZJUFanLab/SpaTalk/tree/main/inst/extdata)__Please refer to the [tutorial vignette](https://raw.githack.com/multitalk/awesome-cell-cell-communication/main/method/tutorial.html) with demo data processing steps. Detailed functions see the [document](https://raw.githack.com/ZJUFanLab/SpaTalk/main/vignettes/SpaTalk.pdf)__
### News
- Compatible with Seurat 5. [see issue 40](https://github.com/ZJUFanLab/SpaTalk/issues/40)
- Fix the bug in `dec_celltype()` when using other deconvolution methods, [see issue 11](https://github.com/ZJUFanLab/SpaTalk/issues/11)
- Fix the bug in `dec_celltype()` when using `dec_result`, [see issue 30](https://github.com/ZJUFanLab/SpaTalk/issues/30)
- Fix the bug in `dec_cci()` and `dec_cci_all()`, [see issue 10](https://github.com/ZJUFanLab/SpaTalk/issues/10)
- Fix the bug in performing parallel functions, e.g., `invalid character indexing` see [issue 30](https://github.com/ZJUFanLab/SpaTalk/issues/30) and [issue 10](https://github.com/ZJUFanLab/SpaTalk/issues/10)
- __Allow to retain genes consistent with reference `sc_data` for reconstructed single-cell ST data [(wiki)](https://github.com/ZJUFanLab/SpaTalk/wiki/Retain-all-genes-in-the-reference)__# About
SpaTalk was developed by Xin Shao. Should you have any questions, please contact Xin Shao at [email protected]Please cite us as "Shao, X., et al. Knowledge-graph-based cell-cell communication inference for spatially resolved transcriptomic data with SpaTalk. Nat Commun 13, 4429 (2022). https://doi.org/10.1038/s41467-022-32111-8"