{"id":14378478,"url":"https://github.com/JiangBioLab/DeepTalk","last_synced_at":"2025-08-23T07:32:17.645Z","repository":{"id":208403914,"uuid":"721541096","full_name":"JiangBioLab/DeepTalk","owner":"JiangBioLab","description":"Deciphering cell-cell communication from spatially resolved transcriptomic data at single-cell resolution with subgraph-based attentional graph neural network","archived":false,"fork":false,"pushed_at":"2024-09-06T04:10:04.000Z","size":103887,"stargazers_count":21,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-21T04:31:21.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JiangBioLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-21T09:22:58.000Z","updated_at":"2024-12-18T03:51:49.000Z","dependencies_parsed_at":"2024-12-21T04:40:53.680Z","dependency_job_id":null,"html_url":"https://github.com/JiangBioLab/DeepTalk","commit_stats":null,"previous_names":["jiangbiolab/deeptalk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JiangBioLab/DeepTalk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiangBioLab%2FDeepTalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiangBioLab%2FDeepTalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiangBioLab%2FDeepTalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiangBioLab%2FDeepTalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JiangBioLab","download_url":"https://codeload.github.com/JiangBioLab/DeepTalk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiangBioLab%2FDeepTalk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745941,"owners_count":24813531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-28T11:00:32.565Z","updated_at":"2025-08-23T07:32:12.606Z","avatar_url":"https://github.com/JiangBioLab.png","language":"Jupyter Notebook","funding_links":[],"categories":["Uncategorized","Preprocessing Tools"],"sub_categories":["Uncategorized","Clinical Trial"],"readme":"### **DeepTalk**\n\n#### **Deciphering cell-cell communication from spatially resolved transcriptomic data at single-cell resolution with subgraph-based attentional graph neural network**\n\n\n![Fig1](https://github.com/JiangBioLab/DeepTalk/assets/72069543/c8ce230a-85dd-443b-b9e7-e24ef2f3ae9f)\n\n\nThe inference of cell-cell communication (CCC) is crucial for a better understanding of complex cellular behavior and regulatory mechanisms in biological systems. However, current computational methods still encounter substantial constraints in inferring spatially resolved CCC at the single-cell level, hampered by their focus on cell-type-centric communications and struggles with handling the limitations of spatial transcriptomics (ST) data. To address this issue, we present a versatile method, called DeepTalk, to infer spatial CCC at single-cell resolution by integrating single-cell RNA sequencing (scRNA-seq) data and ST data. DeepTalk utilizes graph attention network (GAT) to integrate scRNA-seq and ST data, which enables accurate cell-type identification for single-cell ST data and deconvolution for spot-based ST data. Then, DeepTalk can capture the connections among cells at multiple levels using subgraph-based GAT, and further achieve spatially resolved CCC inference at single-cell resolution. Application of DeepTalk to diverse datasets from different platforms demonstrates its promising performance and robustness in discovering meaningful spatial CCCs, which can provide a novel avenue for the exploration and interpretation of various biological processes.\n\n### How to install DeepTalk\n\nTo install DeepTalk, make sure you have [PyTorch](https://pytorch.org/) and [scanpy](https://scanpy.readthedocs.io/en/stable/) installed. If you need more details on the dependences, look at the `environment.yml` file.\n\n- set up conda environment for DeepTalk\n\n```\n  conda env create -n deeptalk-env python=3.8.0\n```\n\n  install DeepTalk from shell:\n\n```\n  conda activate deeptalk-env\n  pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html\n  pip install torch_cluster==1.5.9 torch_scatter==2.0.7 torch_sparse==0.6.10 torch_spline_conv==1.2.1 -f https://data.pyg.org/whl/torch-1.8.0%2Bcu111.html\n  pip install orderedset\n  pip install gensim==3.8.3\n  pip install DeepTalk_ST\n```\n\n- To start using DeepTalk, import DeepTalk in your jupyter notebooks or/and scripts\n\n```\n  import DeepTalk_ST as dt\n```\n\n### How to run DeepTalk for cell type identification\n\nLoad your spatial data and your single cell data (which should be in [AnnData](https://anndata.readthedocs.io/en/latest/) format), and pre-process them using dt.pp_adatas`:\n\n```\n  ad_st = sc.read_h5ad(path)\n  ad_sc = sc.read_h5ad(path)\n  dt.pp_adatas(ad_sc, ad_st, genes=None)\n```\n\nThe function `pp_adatas` finds the common genes between adata_sc, adata_sp, and saves them in two `adatas.uns` for mapping and analysis later. Also, it subsets the intersected genes to a set of training genes passed by `genes`. If `genes=None`, DeepTalk maps using all genes shared by the two datasets. Once the datasets are pre-processed we can map:\n\n```\n  ad_map = dt.map_cells_to_space(ad_sc, ad_st)\n```\n\nThe returned AnnData,`ad_map`, is a cell-by-voxel structure where `ad_map.X[i, j]` gives the probability for cell `i` to be in voxel `j`. This structure can be used to project gene expression from the single cell data to space, which is achieved via `dt.project_genes`.\n\n```\n  ad_ge = dt.project_genes(ad_map, ad_sc)\n```\n\nThe returned `ad_ge` is a voxel-by-gene AnnData, similar to spatial data `ad_st`, but where gene expression has been projected from the single cells. \n\n### How to run DeepTalk for cell-cell communication inference\n\nGenerating Training Files for Deep Learning using `ad_ge` :\n\n```\n  dt.File_Train(st_data, pathways, lrpairs_train, meta_data, species, LR_train, outdir =  Test_dir)\n```\n```\n  dt.data_for_train(st_data, data_dir, LR_pre)\n```\n\nUse subgraph-based graph attention network to construct CCC networks for the ligand-receptor pairs with a spatial distance constraint:\n\n```\n  dt.Train(data_name,data_path, outdir, pretrained_embeddings, n_epochs = 50, ft_n_epochs=10)\n```\nGenerating Predicting Files for Deep Learning using `ad_ge` :\n```\n  dt.File_Pre(st_data, pathways, lrpairs_pre, meta_data, species, LR_Pre, outdir)\n```\n```\n  dt.data_for_pre(st_data, data_dir, LR_pre)\n```\nPredict CCC networks for ligand-receptor pair.\n```\n  dt.run_predict(data_name, data_path, outdir, pretrained_embeddings, model_path)\n```\n\n## Documentation\n\nSee detailed documentation and examples at [https://deeptalk.readthedocs.io/en/latest/index.html](https://deeptalk.readthedocs.io/en/latest/index.html).\n\n## Contact\n\nFeel free to submit an issue or contact us at [wenyiyang22@163.com](mailto:wenyiyang22@163.com) for problems about the package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJiangBioLab%2FDeepTalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJiangBioLab%2FDeepTalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJiangBioLab%2FDeepTalk/lists"}