GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - yanisZirem/ionScell: IonScell is a Python pipeline, Jupyter/Colab workflow and GUI for end-to-end analysis of single-cell Mass Spectrometry Imaging (MSI) data, from raw imzML files to biological insight. It integrates Cells isolation , Cells spectra extraction, quality control, soft clustering, cells population analysis and more , in a reproducible modular workflow.

BranchesTags
Open more actions menu

Latest commit

 

History

46 Commits
46 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
LICENCE
LICENCE
 
 
README.md
README.md
 
 
ionScell_notebook.ipynb
ionScell_notebook.ipynb
 
 
ionscell_pipeline.py
ionscell_pipeline.py
 
 
logo.png
logo.png
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

IonScell logo

Single-Cell Mass Spectrometry Imaging

DOI

Open In Colab


Overview

IonScell is a Python pipeline for Single-Cell Mass Spectrometry Imaging (SCMSI). It processes raw imzML files acquired on MALDI, DESI, SpiderMass-imaging or other MSI platforms and performs the full analytical workflow, from data loading, single cells isolation, cells populations analysis through soft clustering and quality control, to lipid/metabolite annotation and export.

IonScell is available in two complementary formats in this repository:

Format Best for
Jupyter Notebook (ionScell_notebook.ipynb) Step-by-step exploratory analysis, publication figures
Python class (ionscell_pipeline.py) Integration into existing pipelines, scripting

The IonScell Desktop GUI is distributed separately โ€” download it here:
๐Ÿ“ฅ [https://nextcloud.univ-lille.fr/index.php/s/wefM34McLdbjsnX]


Test Datasets

All datasets used to develop and validate IonScell are publicly available on Zenodo:

Single-cell MALDI-MSI datasets of breast cancer and glioblastoma cell lines for ionScell validation
Zirem Y., Ledoux L., Defrance J., Lagache L., Fournier I., Salzet M. โ€” PRISM U1192
DOI

The repository contains MALDI-MSI acquisitions (Bruker rapifleX, 10 ยตm, m/z 350โ€“1100, centroid imzML/ibd) of cytospin-deposited human cell lines in both positive and negative ionisation modes:

  • AU565 โ€” HER2-positive breast cancer
  • MDA-MB-231 โ€” triple-negative breast cancer
  • MCF7 โ€” luminal breast cancer
  • NCH82 โ€” glioblastoma
  • AU565 + NCH82 โญ โ€” binary mixed population (pos + neg)
  • AU565 + MCF7 + MDA-MB-231 โ€” ternary mixed population (pos + neg)

๐Ÿ’ก Start with au565_nch82_neg or au565_nch82_pos โ€” the binary mixed cell datasets are the smallest files (~57 MB and ~180 MB combined) and are ideal for a first run. They demonstrate IonScell's ability to resolve molecularly distinct cell populations via soft clustering.


Key Features

  • Flexible m/z binning โ€” Fixed (0.1 Da) or adaptive (instrument-matched ppm resolution)
  • Adaptive TIC thresholding โ€” 8 algorithms (GMM, Otsu, Triangle, Li, Yen, โ€ฆ) with automatic selection
  • Cell segmentation โ€” Watershed and DFS algorithms with size filtering in pixels or ยตm
  • Soft clustering โ€” Gaussian Mixture Models (GMM) and Fuzzy C-Means (FCM) with probabilistic membership
  • Quality control โ€” SNR, sparsity, dynamic range, spectral entropy, number of detected peaks
  • Clone quality assessment โ€” Confidence scores, within-clone CV, between-clone separability
  • Differential analysis โ€” Kruskal-Wallis or ANOVA with BH FDR correction, volcano plots, Z-score heatmaps
  • Ion spatial mapping โ€” Single-ion and multi-ion overlay with cell contours
  • Lipid annotation โ€” Embedded LIPID MAPS / HMDB database, no internet required, adduct-aware
  • Export โ€” CSV (metadata + spectra), imzML

Installation

1. Clone the repository

git clone https://github.com/yanisZirem/ionScell.git
cd ionScell

2. Create a dedicated environment (recommended)

conda create -n ionscell python=3.10 -y
conda activate ionscell

3. Install dependencies

pip install -r requirements.txt

Optional (for Fuzzy C-Means):

pip install scikit-fuzzy

Quick Start

Option A โ€” Jupyter Notebook (local)

jupyter notebook ionScell_notebook.ipynb

Option B โ€” Google Colab (no installation required)

Click the badge to open the notebook directly in Colab:

Open In Colab

Step 0 of the notebook auto-detects Colab, installs all dependencies, and lets you upload your data or download the test dataset directly from Zenodo.

Option C โ€” Python script

from ionscell_pipeline import SCMSIPipeline, LipidAnnotator

pipe = SCMSIPipeline()
pipe.load_imzml("data/au565_nch82_neg.imzML")
pipe.build_datacube(mz_min=350, mz_max=1100, mz_bin=0.1, normalization="TIC")

thresh, _ = pipe.auto_TIC_threshold(method='auto')
pipe.watershed_or_dfs_from_mask(TIC_threshold=thresh, method='watershed',
                                 min_cell_size=4, pixel_size_um=10)

pipe.extract_cell_spectra(agg='mean')
pipe.compute_spectral_quality_metrics()
pipe.filter_low_quality_cells(snr_threshold=2.0)

pipe.compute_soft_clustering(n_clusters=None, max_clusters=8)
pipe.assess_clone_quality()

pipe.show_umap_with_quality_overlay()
pipe.overlay_clusters_on_image_plotly()
pipe.plot_clone_spectra_with_uncertainty()

top_markers, _ = pipe.run_differential_analysis(method='kruskal')
ann_df, enrichment = pipe.annotate_ions(mode='neg', ppm_tolerance=10.0)

pipe.export_cells_to_csv("results/cells.csv")

Option D โ€” Desktop GUI (no Python required)

๐Ÿ“ฅ Download IonScell GUI โ€” extract and launch ionScell.exe.
See docs/user_manual_interface.md for the full guide.


Pipeline Architecture

imzML file
    โ”‚
    โ–ผ
load_imzml()
    โ”‚
    โ–ผ
make_mz_axis() / build_adaptive_mz_axis()
    โ”‚
    โ–ผ
build_datacube()             โ† normalization: TIC / RMS / MEDIAN
    โ”‚
    โ–ผ
auto_TIC_threshold()         โ† 8 algorithms, automatic selection
    โ”‚
    โ–ผ
watershed_or_dfs_from_mask() โ† Watershed or DFS
    โ”‚                           โ† size filtering (px or ยตm)
    โ”œโ”€โ”€ remove_cells()          โ† manual artefact removal
    โ”‚
    โ–ผ
extract_cell_spectra()       โ† mean / median / sum per cell
    โ”‚
    โ–ผ
compute_spectral_quality_metrics()
filter_low_quality_cells()
    โ”‚
    โ–ผ
compute_soft_clustering()        โ† GMM (auto k via BIC/silhouette)
  or compute_fuzzy_cmeans()      โ† FCM
    โ”‚
    โ–ผ
assess_clone_quality()
    โ”‚
    โ”œโ”€โ”€ show_umap_with_quality_overlay()
    โ”œโ”€โ”€ overlay_clusters_on_image_plotly()
    โ”œโ”€โ”€ plot_clone_spectra_with_uncertainty()
    โ”œโ”€โ”€ show_mz_distribution_in_cells_plotly()
    โ”œโ”€โ”€ plot_multi_ion_overlay()
    โ”œโ”€โ”€ plot_distribution_by_clone()
    โ”‚
    โ–ผ
run_differential_analysis()  โ† Kruskal-Wallis / ANOVA + BH FDR
    โ”‚
    โ–ผ
annotate_ions()              โ† LipidAnnotator (embedded DB)
    โ”‚
    โ–ผ
export_cells_to_csv()
export_cells_to_imzML()

API Reference

SCMSIPipeline

Data loading & cube building

Method Description
load_imzml(path) Load imzML file
make_mz_axis(mz_min, mz_max, mz_bin) Fixed-grid m/z axis
build_adaptive_mz_axis(...) Instrument-matched adaptive binning
build_datacube(mz_min, mz_max, normalization) Build 3D data cube

Thresholding & segmentation

Method Description
auto_TIC_threshold(method) Adaptive TIC threshold (8 methods + auto)
watershed_or_dfs_from_mask(...) Cell segmentation
remove_cells(remove_ids) Remove artefact cells

Spectral extraction & QC

Method Description
extract_cell_spectra(agg) One spectrum per cell
compute_spectral_quality_metrics() SNR, entropy, sparsity, โ€ฆ
filter_low_quality_cells(...) Flag/remove low-quality cells

Clustering

Method Description
compute_soft_clustering(n_clusters) GMM soft clustering
compute_fuzzy_cmeans(max_clusters) Fuzzy C-Means
assess_clone_quality() Quality report per clone

Clone management

Method Description
remove_clone(clone_id) Remove entire clone
combine_clones(clone_ids) Merge clones
remove_clusters(clusters_to_remove) Remove by cluster ID

Visualisation

Method Description
show_TIC_plotly() TIC heatmap
show_umap_with_quality_overlay() UMAP coloured by clone + confidence
overlay_clusters_on_image_plotly() Spatial clone map
plot_cell_contours_by_clone() Contours on white/TIC background
plot_clone_spectra_with_uncertainty() Mean spectra ยฑ SD
plot_global_spectrum() Global mean spectrum
show_mz_distribution_in_cells_plotly(mz_value) Single-ion map
plot_multi_ion_overlay(mz_list) Multi-ion RGB overlay
plot_distribution_by_clone(mz_value) Violin/box plots

Analysis & export

Method Description
run_differential_analysis(method) Statistical DA + volcano + heatmap
annotate_ions(mode, ppm_tolerance) Lipid/metabolite annotation
export_cells_to_csv(path) Export to CSV
export_cells_to_imzML(path) Export to imzML

LipidAnnotator

ann = LipidAnnotator(mode='pos', ppm_tolerance=5.0)
hits = ann.annotate_peak(800.56)
df   = ann.annotate_peak_list(mz_array)
results, enrichment = ann.annotate_clones(pipeline)
df   = ann.search("ceramide")

Positive adducts: [M+H]+, [M+Na]+, [M+K]+, [M+NH4]+, [M+Li]+, [M+H-H2O]+, [M+2H]2+
Negative adducts: [M-H]-, [M+Cl]-, [M+FA-H]-, [M+Ac-H]-, [M-H-H2O]-, [M+Br]-, [M-2H]2-


Repository Structure

ionScell/
โ”œโ”€โ”€ ionscell_pipeline.py          โ† SCMSIPipeline + LipidAnnotator class
โ”œโ”€โ”€ ionScell_notebook.ipynb       โ† Jupyter notebook (imports class)
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ logo.png
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ user_manual_jupyter.md    โ† Jupyter + Google Colab user manual
    โ””โ”€โ”€ user_manual_interface.md  โ† Desktop GUI user manual

Supported Instruments & Formats

Instrument Format Notes
MALDI-TOF/TOF imzML Continuous or processed mode
MALDI-Orbitrap imzML Use adaptive binning for best annotation
DESI-MS imzML
SIMS imzML

Citation

IonScell is currently under submission to a journal.

If you use the test datasets, please cite:

Zirem Y., Ledoux L., Defrance J., Lagache L., Fournier I., Salzet M.
Single-cell MALDI-MSI datasets of breast cancer and glioblastoma cell lines for ionScell validation, Zenodo, 2026.
DOI


License

MIT License โ€” see LICENSE for details.


Contact

๐Ÿ“ฌ [email protected] โ€” [email protected]
๐Ÿ› Issues & feature requests: github.com/yanisZirem/ionScell/issues

About

IonScell is a Python pipeline, Jupyter/Colab workflow and GUI for end-to-end analysis of single-cell Mass Spectrometry Imaging (MSI) data, from raw imzML files to biological insight. It integrates Cells isolation , Cells spectra extraction, quality control, soft clustering, cells population analysis and more , in a reproducible modular workflow.

nextcloud.univ-lille.fr/index.php/s/wefM34McLdbjsnX

Topics

bioinformaticscancer-researchdata-visualizationmachine-learningmaldi-msimass-spectrometrysingle-cellspatial-analysis

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.