Skip to main content

S3-CIMA

Supervised Spatial Single-Cell Image Analysis for identification of disease associated cell type composition in the tissue microenvironment

alt text

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

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

Source distribution (sdist)

Source distribution for s3cima 0.1.17
File Size Uploaded Provenance
s3cima-0.1.17.tar.gz 29.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 61.4 kB

Release files / s3cima-0.1.17.tar.gz

Download URL s3cima-0.1.17.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6995e0db374446af89479484e1771b5970851a05266faa54d88ef525dfde444f
BLAKE2b-256 checksum
How to use checksums
22c79123b04df9e58da26f973cd56ff0dfc896d621811f981381982292c143be
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.17-py3-none-any.whl

Download URL s3cima-0.1.17-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ba55ef51f3e1c610721f5c1ab7cb4f7195e82986cc3497c03f0bd923d677cfd
BLAKE2b-256 checksum
How to use checksums
6d17535b54e1028dd153d93dc79b7c412537aa74933347d74ee7cd7d073f60bf
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.17

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.

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