Thyra (from Greek thyra, meaning "door" or "portal") -- a modern Python library for converting Mass Spectrometry Imaging (MSI) data into the standardized SpatialData/Zarr format, serving as your portal to spatial omics analysis workflows.
Read the documentation | Getting Started | CLI Reference | API Reference
- Multiple Input Formats: ImzML, Bruker (.d directories), Waters (.raw directories)
- SpatialData Output: Modern, cloud-ready format with Zarr backend
- Memory Efficient: Handles large datasets (100+ GB) through streaming processing
- Optical Alignment: Automatic MSI-to-optical image registration for Bruker data
- Multi-Region Support: Handles slides with multiple tissue sections
- Resampling: Physics-aware mass axis resampling (enabled by default)
- 3D Support: Process volume data or treat as 2D slices
- Cross-Platform: Windows, macOS, and Linux
pip install thyra# Basic conversion (resampling enabled by default)
thyra input.imzML output.zarr
# Bruker data with verbose logging
thyra data.d output.zarr -v DEBUG
# Disable resampling
thyra input.imzML output.zarr --no-resamplefrom thyra import convert_msi
success = convert_msi("data/sample.imzML", "output/sample.zarr")import spatialdata as sd
sdata = sd.read_zarr("output/sample.zarr")
msi_table = sdata.tables["msi_dataset_z0"]
print(f"Shape: {msi_table.shape}") # (pixels, m/z bins)
print(f"m/z range: {msi_table.var['mz'].min():.1f} -- {msi_table.var['mz'].max():.1f}")Full documentation: M4i-Imaging-Mass-Spectrometry.github.io/thyra
- Getting Started -- installation, first conversion, common workflows
- CLI Reference -- all command-line options
- Output Format -- understanding the zarr structure
- API Reference -- Python API documentation
| Input | Extension | Status |
|---|---|---|
| ImzML | .imzML |
Full support |
| Bruker | .d |
Full support (timsTOF + Rapiflex) |
| Waters | .raw |
Full support |
Output: SpatialData/Zarr -- cloud-ready, efficient, standardized
git clone https://github.com/M4i-Imaging-Mass-Spectrometry/thyra.git
cd thyra
poetry install
poetry run pre-commit install
poetry run pytestSee CONTRIBUTING.md for guidelines.
MIT -- see LICENSE.
@software{thyra2024,
title = {Thyra: Modern Mass Spectrometry Imaging Data Conversion},
author = {Visvikis, Theodoros},
year = {2024},
url = {https://github.com/M4i-Imaging-Mass-Spectrometry/thyra}
}- Built with SpatialData ecosystem
- Powered by Zarr for efficient storage
- Uses pyimzML for ImzML parsing