SR2P is a stacking based framework for predicting spatial protein expression from spatial transcriptomics RNA profiles in spatial multi omics data.
🌟 Features
Stacking based protein prediction: Integrates multiple base learners and a meta learner for robust inference.
Spatial feature augmentation: Enables spatial neighborhood enhanced prediction for non GNN models.
Flexible model benchmarking: Supports both classical machine learning models and graph neural networks.
Easy to install: Available via pip.
Ready for RNA only data: Can infer protein abundance for spatial transcriptomics datasets without protein measurements.
⏬ Installation
We recommend using a separate Conda environment. Information about Conda and how to install it can be found in the anaconda webpage.
- Create a conda environment and install the SR2P package
conda create -n sr2p_env python=3.9
conda activate sr2p_env
pip install sr2p
The SR2P package has been installed successfully on Operating systems:
- macOS Sequoia 15.3.2
- Ubuntu 22.04
- SUSE Linux Enterprise Server 15 SP5 (Dardel HPC system)
📊 Data Input
SR2P uses .h5ad files, which are AnnData objects commonly used for spatial transcriptomics and spatial multi omics analysis.
spatial_genomics.h5ad (Spatial multi-omics data: RNA + protein)
.X: Feature matrix (spots × features), including RNA expression and protein abundance.obs: Spot metadata- Spatial coordinates: stored in
.obsor.obsm["spatial"]
st_adata.h5ad (Spatial transcriptomics data: RNA only)
.X: Gene expression matrix (spots × genes).obs: Spot metadata- Spatial coordinates: stored in
.obsor.obsm["spatial"]
🔗 Example Data Download
- Download the Spatial Multi-Omics Data Example.
Example datasets used in the tutorial can be organized under:
sr2p_data/
├── human_breast_cancer_rna_protein.h5ad
├── human_tonsil_rna_protein_1.h5ad
├── human_tonsil_rna_protein_2.h5ad
└── human_glioblastoma_rna_protein.h5ad
⚙️ Usage
A complete guide is provided in this tutorial.
🧬 SR2P workflow
A typical SR2P workflow includes:
-
Load spatial multi omics data
-
RNA and protein preprocessing
-
Train and test matrix construction
-
Spatial neighborhood feature construction (optional)
-
Single Model training and prediction (optional)
-
Stacking based integration for final predictions
📌 Supported models
SR2P supports the following model families:
| Model type | Methods |
|---|---|
| Linear model | PLS |
| Gradient boosting | XGBoost, LightGBM, CatBoost |
| Graph neural networks | GAT, GraphSAGE, DGAT |
| Meta learner | ExtraTrees |
📁 Output
SR2P returns predicted protein abundance as a pandas.DataFrame:
- Rows: spatial spots
- Columns: proteins
- Values: predicted protein abundance
Predictions can be exported to CSV for downstream analysis.
License
GNU General Public License v3.0
Metadata
Release files for sr2p 0.1.0
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 |
|---|---|---|---|---|
| sr2p-0.1.0.tar.gz | 40.4 kB | Without provenance | Details for sr2p-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sr2p-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for sr2p-0.1.0-py3-none-any.whl |
Total release size: 92.4 kB
Release files / sr2p-0.1.0.tar.gz
| Download URL | sr2p-0.1.0.tar.gz |
|---|---|
| Size | 40.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39426cdf0b21ae275608fb4cb9bc82296cdf24f9a120b08cca7337a7678165a8
|
|
BLAKE2b-256 checksum How to use checksums |
8138e295e3d7f2da5cd688c9a6f8a2f17e28903ce797bf9a5c46cd8f1c043aa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.18
|
Release files / sr2p-0.1.0-py3-none-any.whl
| Download URL | sr2p-0.1.0-py3-none-any.whl |
|---|---|
| Size | 52.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e25239664099fa86b4a4853b9e6b2de21d76058159dd6b0e0afac9160cd8486
|
|
BLAKE2b-256 checksum How to use checksums |
1de4f5f9beb25e13e2ea41acf88f06e40fab8b9f12893925bfe8280a69a04ae8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.18
|
Security for sr2p 0.1.0
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.