Thyra¶
Thyra (from Greek thyra, meaning "door" or "portal") converts Mass Spectrometry Imaging (MSI) data into the standardized SpatialData/Zarr format -- your portal to spatial omics analysis workflows.
Why Thyra?¶
Mass spectrometry imaging produces rich spatial-molecular data, but every vendor stores it differently. Downstream tools -- napari, squidpy, scanpy -- expect a common format. Thyra bridges that gap:
.imzML ──┐ ┌── napari visualisation
.d ──┼── thyra ──> .zarr ──┼── squidpy / scanpy analysis
.raw ──┘ (SpatialData) └── custom Python workflows
The output is a single SpatialData/Zarr directory containing intensity matrices, TIC images, optical images, pixel geometries, and full metadata -- ready for any tool in the scverse ecosystem.
Features¶
| Feature | Description | |
|---|---|---|
| Formats | Multiple inputs | ImzML, Bruker (.d timsTOF + Rapiflex), Waters (.raw) |
| Output | SpatialData/Zarr | Cloud-ready, chunked, standardised |
| Scale | Memory efficient | Streaming mode for 100+ GB datasets |
| Optics | Optical alignment | Automatic MSI-to-microscopy registration (Bruker) |
| Regions | Multi-region | Handles slides with multiple tissue sections |
| Resampling | Physics-aware | Instrument-specific mass axis resampling (on by default) |
| 3D | Volume support | Process as 3D volume or separate 2D slices |
| Platform | Cross-platform | Windows, macOS, Linux |
Quick Start¶
Install¶
Convert¶
Explore the output¶
import spatialdata as sd
sdata = sd.read_zarr("output.zarr")
# Intensity matrix (pixels x m/z bins)
table = sdata.tables["msi_dataset_z0"]
print(f"Shape: {table.shape}")
print(f"m/z range: {table.var['mz'].min():.1f} -- {table.var['mz'].max():.1f}")
# TIC image
import numpy as np
tic = np.asarray(sdata.images["msi_dataset_z0_tic"])[0]
What is in the output?
See Output Format for the full structure: tables, TIC images, optical images, pixel shapes, regions, and metadata.
Supported Formats¶
Input¶
| Format | Extension | Instruments |
|---|---|---|
| ImzML | .imzML |
Any vendor exporting to open standard |
| Bruker | .d |
timsTOF fleX, Rapiflex MALDI-TOF |
| Waters | .raw |
MassLynx imaging (DESI, MALDI) |
Output¶
| Format | Description |
|---|---|
| SpatialData/Zarr | The scverse standard for spatial omics -- cloud-ready, chunked, with coordinate transforms |
Next Steps¶
- Getting Started -- installation, first conversion, common workflows
- CLI Reference -- every command-line option explained
- Output Format -- what the .zarr contains and how to use it
- API Reference -- Python API documentation