S3-CIMA
Supervised Spatial Single-Cell Image Analysis for identification of disease associated cell type composition in the tissue microenvironment
S3-CIMA implements a weakly supervised CNN model to identify cell subsets whose frequency distinguishes the considered phenotype labels (i.e., disease associated conditions). The model is adopted from the CellCNN model (Arvaniti and Claassen, 2017), comprising a single layer CNN, a pooling layer and a classification or regression output, and using groups of cell expression profiles (multi-cell inputs) as input.
Installation
S3-CIMA is available on PyPI and can be installed using the command:
pip install s3cima
If this does not work, you can clone the repo :
git clone https://github.com/claassenlab/S3-CIMA.git
and run the functions in a conda environment with the following packages :
conda create --name sc3cima
conda activate s3cima
conda install python=3.11 numpy pandas scipy pytorch scikit-learn tqdm matplotlib plotly
Usage
Examples are provided in cima_example.ipynb. Further guidance and documentation to be added soon.
run_scima log file
The model training parameters and outputs is written in a log file including:
• Important parameters such as K, ncell and anchor celltype
• Balanced accuracy score on the train/validation/test set
S3-CIMA graphical output:
For one anchor population, S3-CIMA generates the following structure of plots:
plots
|----- test
| |----- filter_x
| | |----- all_selected_cells.csv
| | |----- cell_type_proportions.png
| | |----- spatial_plot_sample_xxxx.png
| | |----- spatial_plot_sample_xxxy.png
| | |----- ...
| |
| |----- filter_y
| | |----- all_selected_cells.csv
| | |----- cell_type_proportions.png
| | |----- spatial_plot_sample_xxxx.png
| | |----- spatial_plot_sample_xxxy.png
| | |----- ...
| |
| |----- ...
|
|----- train
|----- filter_x
| |----- all_selected_cells.csv
| |----- cell_type_proportions.png
| |----- spatial_plot_sample_xxxx.png
| |----- spatial_plot_sample_xxxy.png
| |----- ...
|
|----- filter_y
| |----- all_selected_cells.csv
| |----- cell_type_proportions.png
| |----- spatial_plot_sample_xxxx.png
| |----- spatial_plot_sample_xxxy.png
| |----- ...
|
|----- ...
The train/test directories correspond to the samples used to train the model and the samples kept aside to test the identified filters on an unseen subset the data. Strong, generalisable filters should identify similar cell types between train/test provided samples are not wildly heterogeneous.
all_selected_cells csv
This csv contains the cell ids of all the cells in the relevant train or test samples that were selected by the filter.
cell_type proportions.png
This plot represents the overall proportion of each cell type in the selected cells.
spatial_plot_sample_xxx.png
For each sample that has at least one selected cell, plots the selected cells in the original spatial dimensions. The number of spatial plots varies per filter - some filters might select cells across samples from one condition, other filters might select cells from another.
Citation
If you use S3-CIMA in your research, please cite our paper:
Sepideh Babaei, Jonathan Christ, Vivek Sehra, Ahmad Makky, Mohammed Zidane, Kilian Wistuba-Hamprecht, Christian M. Schürch, Manfred Claassen, S3-CIMA: Supervised spatial single-cell image analysis for identifying disease-associated cell-type compositions in tissue, Patterns, Volume 4, Issue 9, 2023, 100829, ISSN 2666-3899, https://doi.org/10.1016/j.patter.2023.100829.
License
S3-CIMA is released under the MIT License. See the LICENSE file for more details.
Metadata
Release files for s3cima 0.1.19
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 | |
|---|---|---|---|---|
| s3cima-0.1.19.tar.gz | 29.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| s3cima-0.1.19-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.3 kB
Release files / s3cima-0.1.19.tar.gz
| Download URL | s3cima-0.1.19.tar.gz |
|---|---|
| Size | 29.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a94356e5b28554b66b0d93887b327b516253c9580d681c6757c94f2a3e8be307
|
|
BLAKE2b-256 checksum How to use checksums |
35e9601204103f56b953cca64538216b2bda5aab4277182c07daa6452f7ee8d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.14.3 Darwin/25.3.0
|
Release files / s3cima-0.1.19-py3-none-any.whl
| Download URL | s3cima-0.1.19-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00da73191dff6af3f0a472051567794a9e21be98dc2f05683df673121b37746e
|
|
BLAKE2b-256 checksum How to use checksums |
dd2597c66319b55e1148eb9747eb09962857e9656e648e0e2642c633c20d0a15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.14.3 Darwin/25.3.0
|
Security for s3cima 0.1.19
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.