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

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.16
File Size Uploaded Provenance
s3cima-0.1.16.tar.gz 26.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 55.6 kB

Release files / s3cima-0.1.16.tar.gz

Download URL s3cima-0.1.16.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
324614b8bf2ea39b4e04cf60606f32303ade4c0a9ecfa17b05ef6cc869b947f0
BLAKE2b-256 checksum
How to use checksums
fdd398bec12c417cb5e4f38a12c21e04bbe26124e90421106b597d9884e0fd28
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.16-py3-none-any.whl

Download URL s3cima-0.1.16-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4efeca3effc886fc57e7de42ea8382c81283b38e066ea0fa2720f35a414bff06
BLAKE2b-256 checksum
How to use checksums
ab629947f8342c8fd7c122fb357e8d3371a880d5d2a9ad9846adddcfdc15d2d4
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.16

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