Skip to main content

A modern Python library for converting Mass Spectrometry Imaging (MSI) data into SpatialData/Zarr format - your portal to spatial omics

Project description

Thyra

Tests PyPI Python 3.11+ License: MIT Code style: black Docs

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

Features

  • 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

Installation

pip install thyra

Quick Start

Command Line

# 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-resample

Python API

from thyra import convert_msi

success = convert_msi("data/sample.imzML", "output/sample.zarr")

Working with the Output

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}")

Documentation

Full documentation: M4i-Imaging-Mass-Spectrometry.github.io/thyra

Supported Formats

Input Extension Status
ImzML .imzML Full support
Bruker .d Full support (timsTOF + Rapiflex)
Waters .raw Full support

Output: SpatialData/Zarr -- cloud-ready, efficient, standardized

Development

git clone https://github.com/M4i-Imaging-Mass-Spectrometry/thyra.git
cd thyra
poetry install
poetry run pre-commit install
poetry run pytest

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thyra-1.25.3.tar.gz (11.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thyra-1.25.3-py3-none-any.whl (11.7 MB view details)

Uploaded Python 3

File details

Details for the file thyra-1.25.3.tar.gz.

File metadata

  • Download URL: thyra-1.25.3.tar.gz
  • Upload date:
  • Size: 11.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thyra-1.25.3.tar.gz
Algorithm Hash digest
SHA256 4c866f3295e577d1b99570e30580b972f7df336593e715584b598afb8dd52f16
MD5 7e7cc6eb26a9279f626e58bdbbfefee4
BLAKE2b-256 6604ad320ddaed93e1ade6e64d5c71b10df3a17d95b5a5023706848695337e5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for thyra-1.25.3.tar.gz:

Publisher: release.yml on M4i-Imaging-Mass-Spectrometry/thyra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thyra-1.25.3-py3-none-any.whl.

File metadata

  • Download URL: thyra-1.25.3-py3-none-any.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thyra-1.25.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2822392e3a05d6f8dd872d21457ffd18718486d6573b8ab3d817d712aa80de59
MD5 fb5f5263401dbb0ab46e8139939946b5
BLAKE2b-256 cd12457133679928f064b4b91272b0b36b0d23c6fd58e9f1c07a36f080fc7421

See more details on using hashes here.

Provenance

The following attestation bundles were made for thyra-1.25.3-py3-none-any.whl:

Publisher: release.yml on M4i-Imaging-Mass-Spectrometry/thyra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page