Querying niches on spatial transcriptomics data
Overview
Cells in multicellular organisms coordinate to form functional niches. With spatial transcriptomics (ST) enabling gene expression profiling in spatial contexts, it has become increasingly evident that spatial niches serve as cohesive and recurrent units in physiological and pathological processes. Such recurrence suggests that tissue organization may be built from conserved multicellular patterns and motivates a query-based paradigm for systematically comparing and searching them across datasets. In this work, we defined the niche-query task as identifying spatial structures similar to a given niche of interest (NOI) across ST samples, and developed QueST, a specialized method for solving this task. QueST represents tissues as collections of local multicellular assemblages and learns assemblage representations through contrastive learning, while incorporating adversarial training to reduce sample-specific variation. In simulations and real benchmark datasets, QueST outperformed existing methods repurposed for niche querying, accurately retrieving corresponding spatial structures across heterogeneous tissue contexts and sequencing platforms. Applied to tertiary lymphoid structures (TLSs) in renal and lung cancers, QueST revealed distinct TLS states associated with patient prognosis and uncovered conserved and divergent spatial architectures across cancer types. These results demonstrate that QueST enables systematic, quantitative profiling of spatial niches across samples, providing a powerful tool to dissect spatial tissue architecture in health and disease.
Getting started
Installation
We recommend using a conda environment
conda create -n quest python==3.9.19
Install necessary dependencies first before the installation of QueST
conda activate quest
pip install -r requirements.txt
Finally, QueST is available on PyPI and can be installed via
pip install quest-niche
Usage
See detailed usage on Read the Docs website.
Data Availability
- For reference datasets, please refer to https://cloud.tsinghua.edu.cn/d/9bc9dcf440ba4f989583/
- For pretrained model checkpoints, please refer to https://cloud.tsinghua.edu.cn/d/351d737fd7454e269944/
Metadata
Release files for quest-niche 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quest_niche-0.2.4.tar.gz | 24.7 kB | Without provenance | Details for quest_niche-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quest_niche-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for quest_niche-0.2.4-py3-none-any.whl |
Total release size: 48.8 kB
Release files / quest_niche-0.2.4.tar.gz
| Download URL | quest_niche-0.2.4.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40314f91aeb3d6608e54be0693c5d8a00ff6a0befd332502c23233576f8db287
|
|
BLAKE2b-256 checksum How to use checksums |
9ce39224d79a6046d5fa121c3c856cda0055588b3dd86002b0a078b0f6226ca9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.19
|
Release files / quest_niche-0.2.4-py3-none-any.whl
| Download URL | quest_niche-0.2.4-py3-none-any.whl |
|---|---|
| Size | 24.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98344d88f0f9f88f2feeff58cba9a37fd74a38117e29a6d71127df6e44231a27
|
|
BLAKE2b-256 checksum How to use checksums |
36f1749de6605e21953c0cbf5ac6834e96b933a1aba9e9525ee85b0e6c1430eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.19
|
Security for quest-niche 0.2.4
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.