Skip to content

CeMOS-Mannheim/spatialShrunkenCentroids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spatialShrunkenCentroids Docker

A Dockerized R application for performing post-hoc feature selection on Mass Spectrometry Imaging (MSI) data using Cardinal::spatialShrunkenCentroids.

Features

  • Post-hoc Feature Selection: Identifies specific m/z values that differentiate spatial clusters.
  • Niivue & M2aia Compatible: Outputs uncompressed (raw) NRRD files that load perfectly in standard volumetric viewers.
  • Cross-Version Support: Poly-compatible with Cardinal 3.4.x (Bioconductor containers) and 3.12.x+.
  • Rich Metadata: Embeds analysis parameters (r, s, AIC, BIC, Sparsity) and timestamps directly into NRRD headers.

Usage

1. Build the Image

docker build -t spatial-shrunken-centroids .

2. Run Analysis

Mount your project directory to /data and provide paths relative to that mount.

docker run --rm -v "C:/path/to/data:/data" spatial-shrunken-centroids \
  --input /data/intensity_nrrds \
  --labels /data/mask.nrrd \
  --output /data/results.nrrd \
  --s 2 \
  --r 1

Arguments

  • --input: Directory containing one .nrrd file per m/z (filenames should be numeric m/z values).
  • --labels: Path to the segmentation mask .nrrd file (labels should be integers, 0 reserved for background).
  • --output: Path for the predicted labels NRRD.
  • --s: Sparsity threshold (higher values = more sparse feature selection).
  • --r: Spatial smoothing radius.

Outputs

  • results.nrrd: The predicted cluster labels (16-bit unsigned integer).
  • probabilities_cluster_*.nrrd: Probability maps for each cluster (32-bit float).
  • importance.csv: Table of features ranked by their importance to each cluster.
  • NRRD Headers: Contains metadata for reproducibility:
    • Cardinal_SSC_r: Radius used.
    • Cardinal_SSC_s: Sparsity used.
    • Cardinal_SSC_Sparsity: Fraction of features removed.
    • Cardinal_SSC_AIC / BIC: Model quality metrics.

Input Format Requirements

  • NRRD Filenames: Files in the --input directory should be named with their m/z value (e.g., 801.45.nrrd).
  • Dimensions: All input NRRDs and the label mask must have identical X, Y (and Z) dimensions.
  • Orientation: Assumes standard MSI orientation (X varies fastest).

Technical Implementation

This tool uses Cardinal::spatialShrunkenCentroids with "adaptive" weights. It is designed to mirror the interface of spatialKmeansDocker to facilitate seamless multi-stage pipelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors