DeepTalk-ST


NameDeepTalk-ST JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/xiaoshaziydy/DeepTalk
SummaryCell-cell communication prediction for ST data
upload_time2023-12-22 11:53:34
maintainer
docs_urlNone
authorWenyiYang
requires_python>=3.6
licenseMIT License
keywords cell-cell communicaiton spatial transcriptomics deep learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### **DeepTalk**

#### **Deciphering cell-cell communication from spatially resolved transcriptomic data at single-cell resolution with subgraph-based attentional graph neural network**


![Figure1-1-1](https://github.com/JiangBioLab/DeepTalk/assets/72069543/80649e9d-8c44-4b98-af39-2cafed58bb31)

Recent advances in spatial transcriptomics (ST) and single-cell RNA sequencing (scRNA-seq) have revolutionized the study of cell-cell communication (CCC) regarding tissue homeostasis, development, and disease. However, deciphering the spatially resolved CCC at the single-cell resolution remains a significant challenge, impeding a comprehensive understanding of intercellular dynamics and biochemical processes. Here, we introduce DeepTalk, a deep learning model that harnesses cell-specific gene expression data and spatial distances to predict spatially resolved CCC at the single-cell resolution. DeepTalk utilizes graph attention network (GAT) to efficiently integrate the scRNA-seq and ST data, enabling accurate cell type identification for single-cell ST data and deconvolution for spot-based ST data. Additionally, leveraging subgraph-based GAT, DeepTalk effectively captures the connections among cells at multiple levels, yielding outstanding accuracy in predicting spatial CCC at the single-cell resolution. Extensive evaluations using diverse publicly available datasets validate the exceptional performance and robustness of DeepTalk in identifying spatial CCC. Furthermore, DeepTalk discovers meaningful CCC patterns under various conditions, enabling the exploration of context-specific cell cooperation and signaling.

### How to install DeepTalk

To 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.

- set up conda environment for DeepTalk

```
  conda env create -f environment.yml
```

  install DeepTalk_ST from shell:

```
    conda activate deeptalk-env
    pip install DeepTalk_ST
```

- To start using DeepTalk, import DeepTalk in your jupyter notebooks or/and scripts

```
    import DeepTalk as dt
```

### How to run DeepTalk for cell type identification

Load 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`:

```
    ad_st = sc.read_h5ad(path)
    ad_sc = sc.read_h5ad(path)
    dt.pp_adatas(ad_sc, ad_st, genes=None)
```

The 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:

```
    ad_map = dt.map_cells_to_space(ad_sc, ad_st)
```

The 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`.

```
    ad_ge = dt.project_genes(ad_map, ad_sc)
```

The 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. 

### How to run DeepTalk for cell-cell communication inference

Generating Training Files for Deep Learning using `ad_ge` :

```
dt.File_Train(data_name, LR_train, outdir =  Test_dir)
```
```
dt.data_for_train(data_dir, data_name, LR_train)
```
Generating Predicting Files for Deep Learning using `ad_ge` :
```
dt.CCC_LR_pre(data_name,ligand, receptor, cell_pair, outdir)
```
```
dt.data_for_test(data_dir, data_name, LR_test)
```
Use subgraph-based graph attention network to construct CCC networks for the ligand-receptor pairs with a spatial distance constraint:

```
dt.Train(data_name,data_path, outdir, pretrained_embeddings, n_epochs = 50, ft_n_epochs=10)
```
```
dt.run_predict(data_name, data_path, outdir, pretrained_embeddings, model_path)
```

## Documentation

See detailed documentation and examples at [https://deeptalk.readthedocs.io/en/latest/index.html](https://deeptalk.readthedocs.io/en/latest/index.html).

## Contact

Feel free to submit an issue or contact us at [wenyiyang22@163.com](mailto:wenyiyang22@163.com) for problems about the package.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xiaoshaziydy/DeepTalk",
    "name": "DeepTalk-ST",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "cell-cell communicaiton,spatial transcriptomics,deep learning",
    "author": "WenyiYang",
    "author_email": "wenyiyang22@163.com",
    "download_url": "https://files.pythonhosted.org/packages/a5/59/024290f506195b902562b98526b9e31366f5bc9c30691f291e7c0ffd9117/DeepTalk_ST-0.0.2.tar.gz",
    "platform": null,
    "description": "### **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![Figure1-1-1](https://github.com/JiangBioLab/DeepTalk/assets/72069543/80649e9d-8c44-4b98-af39-2cafed58bb31)\n\nRecent advances in spatial transcriptomics (ST) and single-cell RNA sequencing (scRNA-seq) have revolutionized the study of cell-cell communication (CCC) regarding tissue homeostasis, development, and disease. However, deciphering the spatially resolved CCC at the single-cell resolution remains a significant challenge, impeding a comprehensive understanding of intercellular dynamics and biochemical processes. Here, we introduce DeepTalk, a deep learning model that harnesses cell-specific gene expression data and spatial distances to predict spatially resolved CCC at the single-cell resolution. DeepTalk utilizes graph attention network (GAT) to efficiently integrate the scRNA-seq and ST data, enabling accurate cell type identification for single-cell ST data and deconvolution for spot-based ST data. Additionally, leveraging subgraph-based GAT, DeepTalk effectively captures the connections among cells at multiple levels, yielding outstanding accuracy in predicting spatial CCC at the single-cell resolution. Extensive evaluations using diverse publicly available datasets validate the exceptional performance and robustness of DeepTalk in identifying spatial CCC. Furthermore, DeepTalk discovers meaningful CCC patterns under various conditions, enabling the exploration of context-specific cell cooperation and signaling.\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 -f environment.yml\n```\n\n  install DeepTalk_ST from shell:\n\n```\n    conda activate deeptalk-env\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 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```\ndt.File_Train(data_name, LR_train, outdir =  Test_dir)\n```\n```\ndt.data_for_train(data_dir, data_name, LR_train)\n```\nGenerating Predicting Files for Deep Learning using `ad_ge` :\n```\ndt.CCC_LR_pre(data_name,ligand, receptor, cell_pair, outdir)\n```\n```\ndt.data_for_test(data_dir, data_name, LR_test)\n```\nUse subgraph-based graph attention network to construct CCC networks for the ligand-receptor pairs with a spatial distance constraint:\n\n```\ndt.Train(data_name,data_path, outdir, pretrained_embeddings, n_epochs = 50, ft_n_epochs=10)\n```\n```\ndt.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",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Cell-cell communication prediction for ST data",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/xiaoshaziydy/DeepTalk"
    },
    "split_keywords": [
        "cell-cell communicaiton",
        "spatial transcriptomics",
        "deep learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65cb63ee608230dc0580206e5ade712ea259fdb70c68f2140bf4255af19b32d7",
                "md5": "78303693051a32f878ad5b26221f41f0",
                "sha256": "1a57be38205110b532b401dc64c06887b7977f96f09928d5741afbcbabd5d6b8"
            },
            "downloads": -1,
            "filename": "DeepTalk_ST-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "78303693051a32f878ad5b26221f41f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 131665,
            "upload_time": "2023-12-22T11:53:31",
            "upload_time_iso_8601": "2023-12-22T11:53:31.272390Z",
            "url": "https://files.pythonhosted.org/packages/65/cb/63ee608230dc0580206e5ade712ea259fdb70c68f2140bf4255af19b32d7/DeepTalk_ST-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a559024290f506195b902562b98526b9e31366f5bc9c30691f291e7c0ffd9117",
                "md5": "5d1e105e7b7b76a2d1353d45d558ab94",
                "sha256": "1789f0d0551dbf2f4c833df39296390e8149ab389cb2d98135f9ce3430fd0bdb"
            },
            "downloads": -1,
            "filename": "DeepTalk_ST-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5d1e105e7b7b76a2d1353d45d558ab94",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 106812,
            "upload_time": "2023-12-22T11:53:34",
            "upload_time_iso_8601": "2023-12-22T11:53:34.014259Z",
            "url": "https://files.pythonhosted.org/packages/a5/59/024290f506195b902562b98526b9e31366f5bc9c30691f291e7c0ffd9117/DeepTalk_ST-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-22 11:53:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xiaoshaziydy",
    "github_project": "DeepTalk",
    "github_not_found": true,
    "lcname": "deeptalk-st"
}
        
Elapsed time: 0.16215s