Skip to main content

stDCL

Recent advances in spatial transcriptomics have enabled simultaneous preservation of high-throughput gene expression profiles and spatial context, enabling the high-resolution exploration of distinct regional characterization in brain tissue. However, the intricate spatial structure of brain poses challenges in capturing spatial heterogeneity effectively and deciphering internal regulatory mechanisms accurately. Here, we develop stDCL, a dual graph contrastive learning method to identify spatial domains from spatial transcriptomics data. stDCL adaptively incorporates gene expression data and spatial information via a graph embedding autoencoder, thereby preserving critical information within latent embedding representations. Then, we propose dual graph contrastive learning to train the model, ensuring that the latent embedding representation closely resembles the actual spatial distribution and exhibits cluster similarity. Benchmarking stDCL against other state-of-the-art clustering methods using cerebral cortex datasets demonstrates its superior accuracy and effectiveness in identifying spatial domains. Our analysis of the imputation matrices generated by stDCL reveals its capability to reconstruct spatial hierarchical structures and refine differential expression assessments. Furthermore, we illustrate the central role of stDCL in elucidating gene regulation, spatial heterogeneity, and developmental patterns in the brain. Additionally, stDCL can also be instrumental in annotating disease-associated cellular phenotypes in Alzheimer's disease, unraveling the regulatory mechanisms.

System Requirements

Hardware requirements

stDCL package requires only a standard computer with enough RAM to support the in-memory operations.

Software requirements

OS Requirements

This package is supported for Linux. The package has been tested on the following systems:

  • Linux: Ubuntu 18.04

Python Dependencies

stDCL mainly depends on the Python scientific stack.

numpy
scipy
torch
scikit-learn
pandas
scanpy

For specific setting, please see requirements or environment.

Installation Guide:

Install from PyPi

$ conda create -n stDCL_env python=3.8.15
$ conda activate stDCL_env
$ pip install -r requirements.txt
$ pip install stDCL

Install from Conda

$ conda env create -f environment.yaml

Usage

stDCL is a dual graph contrastive learning method for identifing spatial domains, which can be used to:

We also provide step-by-step tutorials to analyze spatial transcriptomic datasets.

Data Availability

The real data sets we used can be download in data.

License

This project is covered under the MIT License.

Metadata

Release files for stDCL 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stDCL 1.0.1
File Size Uploaded Provenance Actions
stDCL-1.0.1.tar.gz 8.1 kB Without provenance Details for stDCL-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stDCL 1.0.1
File Interpreter ABI Platform Actions
stDCL-1.0.1-py3-none-any.whl Python 3 none any Details for stDCL-1.0.1-py3-none-any.whl

Total release size: 17.6 kB

Release files / stDCL-1.0.1.tar.gz

Download URL stDCL-1.0.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d216cc7efbaf85979e43523fde57a5872623e30face0adfb7c014ddeafec20ce
BLAKE2b-256 checksum
How to use checksums
6b571bb849305ba8d6477ca5ee36d58452d4e8405f2a2ae7e09ebc95402f7380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.9 tqdm/4.41.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

Release files / stDCL-1.0.1-py3-none-any.whl

Download URL stDCL-1.0.1-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c492c13cb36c8f688fccb748febb914641ef397b46d8660e5c43a99775271afe
BLAKE2b-256 checksum
How to use checksums
8992a4814b425321a79287ae676a42bf6e46825a957de5108167549341a09221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.9 tqdm/4.41.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

Security for stDCL 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page