A modern Python library for converting Mass Spectrometry Imaging (MSI) data into SpatialData/Zarr format - your portal to spatial omics
Project description
Thyra
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
- Getting Started -- installation, first conversion, common workflows
- CLI Reference -- all command-line options
- Output Format -- understanding the zarr structure
- Coordinate Systems -- the
"global"contract Thyra writes for downstream consumers - API Reference -- Python API documentation
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
- Built with SpatialData ecosystem
- Powered by Zarr for efficient storage
- Uses pyimzML for ImzML parsing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thyra-1.22.0.tar.gz.
File metadata
- Download URL: thyra-1.22.0.tar.gz
- Upload date:
- Size: 11.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a27af5a7911a04477af8543e3b13190be8fe5d1591779fae6e5ffba478469cba
|
|
| MD5 |
fe1f2a3b905ac1f1446169d40342ed2e
|
|
| BLAKE2b-256 |
61bcf84804e3df86b002254a6c66ca6b6d3802de74ad5663813ed62a05803e26
|
Provenance
The following attestation bundles were made for thyra-1.22.0.tar.gz:
Publisher:
release.yml on M4i-Imaging-Mass-Spectrometry/thyra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thyra-1.22.0.tar.gz -
Subject digest:
a27af5a7911a04477af8543e3b13190be8fe5d1591779fae6e5ffba478469cba - Sigstore transparency entry: 1449429762
- Sigstore integration time:
-
Permalink:
M4i-Imaging-Mass-Spectrometry/thyra@36938e7facec910b9be095f60608931001f3e8a9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/M4i-Imaging-Mass-Spectrometry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@36938e7facec910b9be095f60608931001f3e8a9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file thyra-1.22.0-py3-none-any.whl.
File metadata
- Download URL: thyra-1.22.0-py3-none-any.whl
- Upload date:
- Size: 11.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e0bbd5f8a1a9be032ce148ffe7022cef76df43a3d9bce7b230179277dfe0b4
|
|
| MD5 |
219075418244689998d62e90686c5bea
|
|
| BLAKE2b-256 |
64a76965ec35b568f7f815f8fb67eb8cc04a2059bc3a112f38c621a95b0ea247
|
Provenance
The following attestation bundles were made for thyra-1.22.0-py3-none-any.whl:
Publisher:
release.yml on M4i-Imaging-Mass-Spectrometry/thyra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thyra-1.22.0-py3-none-any.whl -
Subject digest:
62e0bbd5f8a1a9be032ce148ffe7022cef76df43a3d9bce7b230179277dfe0b4 - Sigstore transparency entry: 1449429773
- Sigstore integration time:
-
Permalink:
M4i-Imaging-Mass-Spectrometry/thyra@36938e7facec910b9be095f60608931001f3e8a9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/M4i-Imaging-Mass-Spectrometry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@36938e7facec910b9be095f60608931001f3e8a9 -
Trigger Event:
push
-
Statement type: