Skip to main content

Thyra

Tests PyPI Python 3.12+ License: MIT Code style: black Docs Open in Colab

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. You do not need to know how to program.

Documentation | Install | Your first conversion | Tutorial | Technical reference

The total ion current and two ion images of a sagittal mouse brain section, converted with Thyra

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

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 from Bruker timsTOF, when the acquisition has them
  • 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.

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

@software{thyra2024,
  title = {Thyra: Modern Mass Spectrometry Imaging Data Conversion},
  author = {Visvikis, Theodoros},
  year = {2024},
  url = {https://github.com/M4i-Imaging-Mass-Spectrometry/thyra}
}

Acknowledgments

Visual identity

Logomark and logotype designed by Nepsis Scriptorium.

Instagram @nepsis.scriptorium Email nepsisscriptorium@gmail.com

Metadata

Release files for thyra 4.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thyra 4.2.0
File Size Uploaded
thyra-4.2.0.tar.gz 11.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for thyra 4.2.0
File Interpreter ABI Platform
thyra-4.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.0 MB

Release files / thyra-4.2.0.tar.gz

Download URL thyra-4.2.0.tar.gz
Size 11.9 MB
Tags Source
SHA-256 checksum
How to use checksums
da74e4654256f177edb3ebbe033485d74be66316a0602485a2853d46b612e59c
BLAKE2b-256 checksum
How to use checksums
7d7a7a702a89014d226ab1b4ad5d17c6de4274a578e27f1b4b1e2e4d0d12a22e
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 Sep 28, 2026.

Transparency log

Release files / thyra-4.2.0-py3-none-any.whl

Download URL thyra-4.2.0-py3-none-any.whl
Size 12.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c336163d37406d74c3729ffebc0aef3787a2a196dc536b6ed172c7cd39bf38cd
BLAKE2b-256 checksum
How to use checksums
ef617864458a48b7f8fa5ae883e6f2dae6ef55175b13b59bd46ef33a3e2fed33
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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

4.5.0

2 release files

4.4.0

2 release files

4.3.4

2 release files

4.3.3

2 release files

4.3.2

2 release files

4.3.1

2 release files

4.3.0

2 release files

This release

4.2.0 This release

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.23.3

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.5

2 release files

3.7.4

2 release files

3.7.3

2 release files

3.7.2

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.27.3

2 release files

1.27.2

2 release files

1.27.1

2 release files

1.27.0

2 release files

1.26.0

2 release files

1.25.4

2 release files

1.25.3

2 release files

1.25.2

2 release files

1.25.1

2 release files

1.25.0

2 release files

1.23.0

2 release files

1.20.3

2 release files

1.20.2

2 release files

1.20.1

2 release files

1.20.0

2 release files

1.19.0

2 release files

1.18.2

2 release files

1.18.1

2 release files

1.18.0

2 release files

1.17.2

2 release files

1.15.1

2 release files

1.15.0

2 release files

1.14.1

2 release files

1.14.0

2 release files

1.13.0

2 release files

1.12.1

2 release files

1.12.0

2 release files

1.11.1

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page