Thyra converts imaging mass spectrometry data into one open format. It reads the files your instrument writes (Bruker, Waters, PHI, or imzML from any vendor) and saves them in SpatialData, which analysis and viewing tools can read. It keeps ion mobility (TIMS 1/K0) and MS/MS (PASEF, iprm-PASEF) data, not only the spectra. You do not need to know how to program.
Documentation | Install | Your first conversion | Tutorial | Technical reference
A sagittal mouse brain section converted with Thyra: the total ion current and two ion images. MALDI-MSI data from 10.5281/zenodo.18326569, CC-BY-4.0.
Quick start
uv tool install --python 3.13 thyra # or: pip install thyra (Python 3.12 to 3.14)
thyra-example-data example_data/synthetic_brain.imzML # makes a small example dataset
thyra example_data/synthetic_brain.imzML example_data/synthetic_brain.zarr
New to the terminal or to uv? The Install page walks you through every step. To try Thyra with nothing installed, open the notebook in Google Colab. The Tutorial also converts the published example dataset (10.5281/zenodo.18326569).
What you can convert
| Your instrument | Point Thyra at |
|---|---|
| Bruker timsTOF or solariX | the folder ending in .d |
| Bruker rapifleX | the acquisition folder |
| Waters (MassLynx) | the folder ending in .raw |
| PHI nanoTOF (ToF-SIMS) | the file ending in .raw |
| Any instrument that exports imzML | the .imzML file, with its .ibd file next to it |
| mzPeak (experimental) | the .mzpeak file |
imzML with a mobility array is read too. In continuous mode, as TIMSImaging
writes it, the mobility is kept as its own table. In processed mode, as
TIMSCONVERT writes it, add --mobility-grid for that table.
Thyra reads timsTOF and Waters data on Windows and Linux; everything else also works on macOS. Shimadzu support is in development: until then, export imzML from IMAGEREVEAL MS.
PHI mosaic, MS/MS and depth-profiling acquisitions have so far been tested only on synthetic files. If you have real data in those modes, please get in touch.
What you get
One folder ending in .zarr, holding:
- the spectrum of every pixel, on one shared m/z axis
- an image of the total ion current (TIC)
- the optical image of the slide, when the acquisition has one
- ion mobility and MS/MS data, when the acquisition has them (below)
- a validated description of the acquisition, ready for METASPACE
Thyra handles datasets larger than your computer's memory, slides with several regions, and 3D data.
Ion mobility and MS/MS
Thyra keeps the extra dimensions of Bruker timsTOF data instead of dropping them.
- By default each spectrum is added up over mobility, so every tool can
read the main table. The table also carries a mass-mobility heatmap of the
whole image,
uns["mobility_heatmap"]. {table}_mobilityhas one column for each (m/z, 1/K0) pair. It is written by itself from continuous imzML with a mobility array, and from Bruker TDF and processed imzML with--mobility-grid.var["ccs"]holds each pair's collision cross section (CCS) in square angstroms, for an assumed charge of 1;uns["ccs"]records the assumptions.{table}_msmssplits PASEF and iprm-PASEF MS/MS by precursor: one block of fragment columns per precursor, so every fragment has its own image.
Two ions at one m/z, told apart by mobility:
import numpy as np
import spatialdata as sd
sdata = sd.read_zarr("output/sample.zarr")
mob = sdata.tables["msi_dataset_z0_mobility"]
mz, k0 = mob.var["mz"].to_numpy(), mob.var["mobility"].to_numpy()
near = np.abs(mz - 600.25) < 0.01
low = np.asarray(mob.X[:, near & (k0 < 1.3)].sum(axis=1)).ravel() # one value per pixel
high = np.asarray(mob.X[:, near & (k0 >= 1.3)].sum(axis=1)).ravel()
Tools should recognise these tables by their columns ("mobility" in var.columns, "precursor_mz" in var.columns), not by their names. The
Ion mobility and MS/MS guide
walks through both, and the output format describes the
mobility
and MS/MS
tables in full.
For tool developers
lists the rules a tool can rely on, and what may change.
Waters Synapt and Cyclic IMS runs with ion mobility on keep their drift times; older Synapt G1 mobility runs are refused. CCS is computed from 1/K0 only, never from a drift time.
From Python
from thyra import convert_msi
import spatialdata as sd
convert_msi("data/sample.imzML", "output/sample.zarr")
sdata = sd.read_zarr("output/sample.zarr")
table = sdata.tables["msi_dataset_z0"] # one row per pixel, one column per m/z bin
The acquisition description has its own commands:
thyra metadata raw_data.d # describe a dataset without converting it
thyra validate output.zarr # check a result against the schema
thyra export-metaspace output.zarr --merge sample.json # METASPACE submission file
Every option, format and output detail is in the Technical reference.
Development
git clone https://github.com/M4i-Imaging-Mass-Spectrometry/thyra.git
cd thyra
uv sync
uv run pre-commit install
uv run pytest
CI runs the same hooks on every pull request. Installing them locally shows you a failure before you push.
Contributing
See CONTRIBUTING.md for guidelines.
License
MIT -- see LICENSE.
Citation
If you use Thyra, please cite:
Visvikis, T.; Hendriks, T. F. E.; Vierdag, W.-M.; Marconato, L.; Heeren, R. M. A.; Cuypers, E. Thyra: bridging mass spectrometry imaging and SpatialData for unified multimodal analysis. Nat. Methods 2026. doi:10.1038/s41592-026-03305-5
If your work relies on how Thyra reads vendor files or keeps memory bounded while converting, please also cite:
Visvikis, T.; Vierdag, W.-M.; Marconato, L.; Birmpili, A.; Heeren, R. M. A.; Cuypers, E. Native, Memory-Bounded Conversion of Mass Spectrometry Imaging Data into the SpatialData Ecosystem. J. Am. Soc. Mass Spectrom. 2026, 37 (10), 2379-2387. doi:10.1021/jasms.6c00169
BibTeX for both is in CITATION.bib. GitHub's "Cite this repository" button reads CITATION.cff, which shows the Nature Methods paper and lists the JASMS paper under its references.
Papers
| Paper | Published | DOI |
|---|---|---|
| Thyra: bridging mass spectrometry imaging and SpatialData for unified multimodal analysis (Nat. Methods) | 2026-10 | 10.1038/s41592-026-03305-5 |
| Native, Memory-Bounded Conversion of Mass Spectrometry Imaging Data into the SpatialData Ecosystem (J. Am. Soc. Mass Spectrom.) | 2026-09 | 10.1021/jasms.6c00169 |
| Thyra: Bridging Mass Spectrometry Imaging and SpatialData for Unified Multi-Modal Analysis (bioRxiv preprint) | 2026-01 | 10.64898/2026.01.26.700792 |
Ion mobility and MS/MS support came after the JASMS paper and the preprint. If you use them, please also name the Thyra version you used.
Acknowledgments
- Built with SpatialData ecosystem
- Powered by Zarr for efficient storage
- Uses pyimzML for ImzML parsing
Visual identity
Logomark and logotype designed by Nepsis Scriptorium.
Metadata
Release files for thyra 4.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thyra-4.6.2.tar.gz | 12.2 MB | With provenance | Details for thyra-4.6.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thyra-4.6.2-py3-none-any.whl | Python 3 | none | any | Details for thyra-4.6.2-py3-none-any.whl |
Total release size: 24.5 MB
Release files / thyra-4.6.2.tar.gz
| Download URL | thyra-4.6.2.tar.gz |
|---|---|
| Size | 12.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49c8dd23a86355d6397bd6c2782a838880b8a8a04a769c1407985754061b0554
|
|
BLAKE2b-256 checksum How to use checksums |
8d5220ea7adcd407e6e3bd0cf1cadb9b40767d47b0b29a1cc2cede02fdc63a6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / thyra-4.6.2-py3-none-any.whl
| Download URL | thyra-4.6.2-py3-none-any.whl |
|---|---|
| Size | 12.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b183b2afc110b718c1b0ed425852eddca03ba2d5fab6b794cd900b347ff44b2
|
|
BLAKE2b-256 checksum How to use checksums |
d3297c1ab2105bc7029fe71dc2e6ce2e6e25173e502eb38851d37d2b48898c50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for thyra 4.6.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for thyra-4.6.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA 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.