thyra 4.4.0__tar.gz → 4.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {thyra-4.4.0 → thyra-4.5.0}/PKG-INFO +70 -6
- {thyra-4.4.0 → thyra-4.5.0}/README.md +68 -4
- {thyra-4.4.0 → thyra-4.5.0}/pyproject.toml +6 -69
- {thyra-4.4.0 → thyra-4.5.0}/thyra/__init__.py +12 -3
- {thyra-4.4.0 → thyra-4.5.0}/thyra/__main__.py +157 -30
- {thyra-4.4.0 → thyra-4.5.0}/thyra/convert.py +80 -17
- thyra-4.5.0/thyra/converters/spatialdata/acquisition_frame.py +130 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/base_spatialdata_converter.py +163 -22
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/csc_assembly.py +9 -110
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/fused_passes.py +16 -3
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/mobility_heatmap.py +225 -59
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/mobility_table.py +149 -30
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/msms_table.py +45 -14
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/optical_image.py +30 -4
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/root_attrs.py +56 -10
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/sibling_tables.py +184 -51
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/streaming_converter.py +26 -5
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/uns_assembler.py +81 -17
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/base_reader.py +39 -4
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/mobility.py +90 -7
- thyra-4.5.0/thyra/mass_axis_plan.py +695 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/constants.py +36 -1
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/bruker_extractor.py +9 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/imzml_extractor.py +9 -1
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/imzml_header_extractor.py +3 -1
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/waters_extractor.py +25 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/__init__.py +8 -4
- thyra-4.5.0/thyra/metadata/schema/axis_fingerprint.py +30 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/builder.py +51 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/cli.py +15 -3
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/models.py +151 -17
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/msi_metadata.linkml.yaml +28 -2
- thyra-4.4.0/thyra/metadata/schema/msi_metadata_schema_v0_10.json → thyra-4.5.0/thyra/metadata/schema/msi_metadata_schema_v0_14.json +111 -6
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/validate.py +77 -5
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/vocab.py +32 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/types.py +12 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/preview.py +30 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/rapiflex/rapiflex_reader.py +95 -2
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/solarix/solarix_reader.py +17 -4
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/sdk_functions.py +2 -1
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/timstof_reader.py +151 -29
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/imzml/header.py +56 -12
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/imzml/imzml_reader.py +83 -2
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/mzpeak/mzpeak_reader.py +107 -45
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/instrument.py +20 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/masslynx_lib.py +92 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/waters_reader.py +346 -5
- thyra-4.5.0/thyra/regions.py +93 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/__init__.py +2 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/axis_planner.py +84 -24
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/binning.py +174 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/gaps.py +9 -7
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/instrument_detectors.py +9 -2
- thyra-4.5.0/thyra/resampling/interpolation.py +460 -0
- thyra-4.5.0/thyra/resampling/memory_guard.py +127 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mobility_grid.py +47 -2
- thyra-4.5.0/thyra/resampling/plan.py +385 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/strategies/tic_preserving.py +23 -4
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/tic.py +4 -1
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/types.py +12 -3
- thyra-4.4.0/thyra/resampling/interpolation.py +0 -172
- {thyra-4.4.0 → thyra-4.5.0}/.gitignore +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/LICENSE +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/alignment/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/alignment/affine.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/alignment/teaching_points.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/config.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/_chunking.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/converters/spatialdata/converter.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/base_converter.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/base_extractor.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/conversion_state.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/drop_tally.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/frames.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/mass_axis.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/msms.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/core/registry.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/errors.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/document.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/mzpeak_extractor.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/phi_extractor.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/extractors/solarix_extractor.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/ontology/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/ontology/_ims.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/ontology/_ms.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/ontology/_uo.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/ontology/cache.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/ontology/dump_obo_files.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/personal_data.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/generate.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/metaspace.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/schema/store_io.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/uns_compat.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/metadata/validator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/py.typed +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/base_bruker_reader.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/folder_structure.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/mis_parser.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/rapiflex/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/solarix/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/dll/LICENCE-BRUKER.txt +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/dll/README.md +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/dll/timsdata.dll +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/dll/timsdata.so +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/dll_manager.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/timstof/sdk/platform_detector.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/bruker/vendor_db.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/imzml/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/imzml/_pyimzml_compat.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/imzml/mobility_array.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/mzpeak/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/mzpeak/chunk_decoding.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/phi/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/phi/event_stream.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/phi/mass_axis.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/phi/phi_header.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/phi/phi_reader.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/imaging_grid.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/lib/MLReader.dll +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/lib/MassLynxRaw.dll +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/lib/libMLReader.so +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/readers/waters/lib/libMassLynxRaw.so +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/common_axis.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/constants.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/data_characteristics.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/decision_tree.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/base_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/fticr_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/linear_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/linear_tof_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/orbitrap_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/reflector_tof_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/mass_axis/tof_generator.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/strategies/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/strategies/base.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/resampling/strategies/nearest_neighbor.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/tools/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/tools/check_ontology.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/tools/make_example_data.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/utils/__init__.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/utils/bruker_exceptions.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/utils/imzml_coordinate_base.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/utils/logging_config.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/utils/pyimzml_direct.py +0 -0
- {thyra-4.4.0 → thyra-4.5.0}/thyra/utils/windows_paths.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: thyra
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.5.0
|
|
4
4
|
Summary: A modern Python library for converting Mass Spectrometry Imaging (MSI) data into SpatialData/Zarr format - your portal to spatial omics
|
|
5
5
|
Project-URL: Homepage, https://github.com/M4i-Imaging-Mass-Spectrometry/thyra
|
|
6
6
|
Project-URL: Repository, https://github.com/M4i-Imaging-Mass-Spectrometry/thyra
|
|
@@ -14,7 +14,7 @@ Author-email: Theodoros Visvikis <t.visvikis@maastrichtuniversity.nl>
|
|
|
14
14
|
Maintainer-email: Theodoros Visvikis <t.visvikis@maastrichtuniversity.nl>
|
|
15
15
|
License-Expression: MIT
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Keywords: bioinformatics,bruker,data-conversion,imaging,imzml,mass-spectrometry,msi,omics,scientific-computing,spatial-omics,spatialdata,zarr
|
|
17
|
+
Keywords: bioinformatics,bruker,data-conversion,imaging,imzml,ion-mobility,mass-spectrometry,msi,msms,omics,pasef,scientific-computing,spatial-omics,spatialdata,tims,timstof,zarr
|
|
18
18
|
Classifier: Development Status :: 4 - Beta
|
|
19
19
|
Classifier: Environment :: Console
|
|
20
20
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -67,8 +67,9 @@ Description-Content-Type: text/markdown
|
|
|
67
67
|
**Thyra converts imaging mass spectrometry data into one open format.** It
|
|
68
68
|
reads the files your instrument writes (Bruker, Waters, PHI, or imzML from any
|
|
69
69
|
vendor) and saves them in [SpatialData](https://spatialdata.scverse.org/),
|
|
70
|
-
which analysis and viewing tools can read.
|
|
71
|
-
|
|
70
|
+
which analysis and viewing tools can read. It keeps ion mobility (TIMS 1/K0)
|
|
71
|
+
and MS/MS (PASEF, iprm-PASEF) data, not only the spectra. You do not need to
|
|
72
|
+
know how to program.
|
|
72
73
|
|
|
73
74
|
**[Documentation](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra)** | [Install](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/install/) | [Your first conversion](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/getting-started/) | [Tutorial](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/tutorial/) | [Technical reference](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/technical-reference/)
|
|
74
75
|
|
|
@@ -106,6 +107,10 @@ also converts the published example dataset
|
|
|
106
107
|
| Any instrument that exports imzML | the `.imzML` file, with its `.ibd` file next to it |
|
|
107
108
|
| mzPeak (experimental) | the `.mzpeak` file |
|
|
108
109
|
|
|
110
|
+
imzML with a mobility array is read too. In continuous mode, as TIMSImaging
|
|
111
|
+
writes it, the mobility is kept as its own table. In processed mode, as
|
|
112
|
+
TIMSCONVERT writes it, add `--mobility-grid` for that table.
|
|
113
|
+
|
|
109
114
|
Thyra reads timsTOF and Waters data on Windows and Linux; everything else
|
|
110
115
|
also works on macOS. Shimadzu support is in development: until then, export
|
|
111
116
|
imzML from IMAGEREVEAL MS.
|
|
@@ -121,12 +126,57 @@ One folder ending in `.zarr`, holding:
|
|
|
121
126
|
- the spectrum of every pixel, on one shared m/z axis
|
|
122
127
|
- an image of the total ion current (TIC)
|
|
123
128
|
- the optical image of the slide, when the acquisition has one
|
|
124
|
-
- ion mobility and MS/MS data
|
|
129
|
+
- ion mobility and MS/MS data, when the acquisition has them (below)
|
|
125
130
|
- a validated description of the acquisition, ready for METASPACE
|
|
126
131
|
|
|
127
132
|
Thyra handles datasets larger than your computer's memory, slides with
|
|
128
133
|
several regions, and 3D data.
|
|
129
134
|
|
|
135
|
+
## Ion mobility and MS/MS
|
|
136
|
+
|
|
137
|
+
Thyra keeps the extra dimensions of Bruker timsTOF data instead of dropping
|
|
138
|
+
them.
|
|
139
|
+
|
|
140
|
+
- **By default** each spectrum is added up over mobility, so every tool can
|
|
141
|
+
read the main table. The table also carries a mass-mobility heatmap of the
|
|
142
|
+
whole image, `uns["mobility_heatmap"]`.
|
|
143
|
+
- **`{table}_mobility`** has one column for each (m/z, 1/K0) pair. It is
|
|
144
|
+
written by itself from continuous imzML with a mobility array, and from
|
|
145
|
+
Bruker TDF and processed imzML with `--mobility-grid`. `var["ccs"]`
|
|
146
|
+
holds each pair's collision cross section (CCS) in square angstroms, for
|
|
147
|
+
an assumed charge of 1; `uns["ccs"]` records the assumptions.
|
|
148
|
+
- **`{table}_msms`** splits PASEF and iprm-PASEF MS/MS by precursor: one
|
|
149
|
+
block of fragment columns per precursor, so every fragment has its own
|
|
150
|
+
image.
|
|
151
|
+
|
|
152
|
+
Two ions at one m/z, told apart by mobility:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
import numpy as np
|
|
156
|
+
import spatialdata as sd
|
|
157
|
+
|
|
158
|
+
sdata = sd.read_zarr("output/sample.zarr")
|
|
159
|
+
mob = sdata.tables["msi_dataset_z0_mobility"]
|
|
160
|
+
mz, k0 = mob.var["mz"].to_numpy(), mob.var["mobility"].to_numpy()
|
|
161
|
+
near = np.abs(mz - 600.25) < 0.01
|
|
162
|
+
low = np.asarray(mob.X[:, near & (k0 < 1.3)].sum(axis=1)).ravel() # one value per pixel
|
|
163
|
+
high = np.asarray(mob.X[:, near & (k0 >= 1.3)].sum(axis=1)).ravel()
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Tools should recognise these tables by their columns (`"mobility" in
|
|
167
|
+
var.columns`, `"precursor_mz" in var.columns`), not by their names. The
|
|
168
|
+
[Ion mobility and MS/MS guide](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/ion-mobility-and-msms/)
|
|
169
|
+
walks through both, and the output format describes the
|
|
170
|
+
[mobility](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/output-format/#ion-mobility)
|
|
171
|
+
and [MS/MS](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/output-format/#demultiplexed-msms-table)
|
|
172
|
+
tables in full.
|
|
173
|
+
[For tool developers](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/for-tool-developers/)
|
|
174
|
+
lists the rules a tool can rely on, and what may change.
|
|
175
|
+
|
|
176
|
+
Waters Synapt runs with ion mobility on keep their drift times; older
|
|
177
|
+
Synapt G1 mobility runs are refused. CCS is computed from 1/K0 only, never
|
|
178
|
+
from a drift time.
|
|
179
|
+
|
|
130
180
|
## From Python
|
|
131
181
|
|
|
132
182
|
```python
|
|
@@ -177,7 +227,8 @@ If you use Thyra, please cite the paper:
|
|
|
177
227
|
|
|
178
228
|
> Visvikis, T.; Vierdag, W.-M.; Marconato, L.; Birmpili, A.; Heeren, R. M. A.;
|
|
179
229
|
> Cuypers, E. Native, Memory-Bounded Conversion of Mass Spectrometry Imaging
|
|
180
|
-
> Data into the SpatialData Ecosystem. *J. Am. Soc. Mass Spectrom.* **2026
|
|
230
|
+
> Data into the SpatialData Ecosystem. *J. Am. Soc. Mass Spectrom.* **2026**,
|
|
231
|
+
> *37* (10), 2379-2387.
|
|
181
232
|
> [doi:10.1021/jasms.6c00169](https://doi.org/10.1021/jasms.6c00169)
|
|
182
233
|
|
|
183
234
|
```bibtex
|
|
@@ -186,6 +237,9 @@ If you use Thyra, please cite the paper:
|
|
|
186
237
|
author = {Visvikis, Theodoros and Vierdag, Wouter-Michiel and Marconato, Luca and Birmpili, Angeliki and Heeren, Ron M. A. and Cuypers, Eva},
|
|
187
238
|
journal = {Journal of the American Society for Mass Spectrometry},
|
|
188
239
|
year = {2026},
|
|
240
|
+
volume = {37},
|
|
241
|
+
number = {10},
|
|
242
|
+
pages = {2379--2387},
|
|
189
243
|
doi = {10.1021/jasms.6c00169}
|
|
190
244
|
}
|
|
191
245
|
```
|
|
@@ -202,6 +256,16 @@ repository" button reads. To cite the software itself:
|
|
|
202
256
|
}
|
|
203
257
|
```
|
|
204
258
|
|
|
259
|
+
### Papers
|
|
260
|
+
|
|
261
|
+
| Paper | Published | DOI |
|
|
262
|
+
|---|---|---|
|
|
263
|
+
| Native, Memory-Bounded Conversion of Mass Spectrometry Imaging Data into the SpatialData Ecosystem (*J. Am. Soc. Mass Spectrom.*) | 2026-09 | [10.1021/jasms.6c00169](https://doi.org/10.1021/jasms.6c00169) |
|
|
264
|
+
| Thyra: Bridging Mass Spectrometry Imaging and SpatialData for Unified Multi-Modal Analysis (bioRxiv preprint) | 2026-01 | [10.64898/2026.01.26.700792](https://doi.org/10.64898/2026.01.26.700792) |
|
|
265
|
+
|
|
266
|
+
Ion mobility and MS/MS support came after both papers. If you use them,
|
|
267
|
+
please also name the Thyra version you used.
|
|
268
|
+
|
|
205
269
|
## Acknowledgments
|
|
206
270
|
|
|
207
271
|
- Built with [SpatialData](https://spatialdata.scverse.org/) ecosystem
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
**Thyra converts imaging mass spectrometry data into one open format.** It
|
|
14
14
|
reads the files your instrument writes (Bruker, Waters, PHI, or imzML from any
|
|
15
15
|
vendor) and saves them in [SpatialData](https://spatialdata.scverse.org/),
|
|
16
|
-
which analysis and viewing tools can read.
|
|
17
|
-
|
|
16
|
+
which analysis and viewing tools can read. It keeps ion mobility (TIMS 1/K0)
|
|
17
|
+
and MS/MS (PASEF, iprm-PASEF) data, not only the spectra. You do not need to
|
|
18
|
+
know how to program.
|
|
18
19
|
|
|
19
20
|
**[Documentation](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra)** | [Install](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/install/) | [Your first conversion](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/getting-started/) | [Tutorial](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/tutorial/) | [Technical reference](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/technical-reference/)
|
|
20
21
|
|
|
@@ -52,6 +53,10 @@ also converts the published example dataset
|
|
|
52
53
|
| Any instrument that exports imzML | the `.imzML` file, with its `.ibd` file next to it |
|
|
53
54
|
| mzPeak (experimental) | the `.mzpeak` file |
|
|
54
55
|
|
|
56
|
+
imzML with a mobility array is read too. In continuous mode, as TIMSImaging
|
|
57
|
+
writes it, the mobility is kept as its own table. In processed mode, as
|
|
58
|
+
TIMSCONVERT writes it, add `--mobility-grid` for that table.
|
|
59
|
+
|
|
55
60
|
Thyra reads timsTOF and Waters data on Windows and Linux; everything else
|
|
56
61
|
also works on macOS. Shimadzu support is in development: until then, export
|
|
57
62
|
imzML from IMAGEREVEAL MS.
|
|
@@ -67,12 +72,57 @@ One folder ending in `.zarr`, holding:
|
|
|
67
72
|
- the spectrum of every pixel, on one shared m/z axis
|
|
68
73
|
- an image of the total ion current (TIC)
|
|
69
74
|
- the optical image of the slide, when the acquisition has one
|
|
70
|
-
- ion mobility and MS/MS data
|
|
75
|
+
- ion mobility and MS/MS data, when the acquisition has them (below)
|
|
71
76
|
- a validated description of the acquisition, ready for METASPACE
|
|
72
77
|
|
|
73
78
|
Thyra handles datasets larger than your computer's memory, slides with
|
|
74
79
|
several regions, and 3D data.
|
|
75
80
|
|
|
81
|
+
## Ion mobility and MS/MS
|
|
82
|
+
|
|
83
|
+
Thyra keeps the extra dimensions of Bruker timsTOF data instead of dropping
|
|
84
|
+
them.
|
|
85
|
+
|
|
86
|
+
- **By default** each spectrum is added up over mobility, so every tool can
|
|
87
|
+
read the main table. The table also carries a mass-mobility heatmap of the
|
|
88
|
+
whole image, `uns["mobility_heatmap"]`.
|
|
89
|
+
- **`{table}_mobility`** has one column for each (m/z, 1/K0) pair. It is
|
|
90
|
+
written by itself from continuous imzML with a mobility array, and from
|
|
91
|
+
Bruker TDF and processed imzML with `--mobility-grid`. `var["ccs"]`
|
|
92
|
+
holds each pair's collision cross section (CCS) in square angstroms, for
|
|
93
|
+
an assumed charge of 1; `uns["ccs"]` records the assumptions.
|
|
94
|
+
- **`{table}_msms`** splits PASEF and iprm-PASEF MS/MS by precursor: one
|
|
95
|
+
block of fragment columns per precursor, so every fragment has its own
|
|
96
|
+
image.
|
|
97
|
+
|
|
98
|
+
Two ions at one m/z, told apart by mobility:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
import numpy as np
|
|
102
|
+
import spatialdata as sd
|
|
103
|
+
|
|
104
|
+
sdata = sd.read_zarr("output/sample.zarr")
|
|
105
|
+
mob = sdata.tables["msi_dataset_z0_mobility"]
|
|
106
|
+
mz, k0 = mob.var["mz"].to_numpy(), mob.var["mobility"].to_numpy()
|
|
107
|
+
near = np.abs(mz - 600.25) < 0.01
|
|
108
|
+
low = np.asarray(mob.X[:, near & (k0 < 1.3)].sum(axis=1)).ravel() # one value per pixel
|
|
109
|
+
high = np.asarray(mob.X[:, near & (k0 >= 1.3)].sum(axis=1)).ravel()
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Tools should recognise these tables by their columns (`"mobility" in
|
|
113
|
+
var.columns`, `"precursor_mz" in var.columns`), not by their names. The
|
|
114
|
+
[Ion mobility and MS/MS guide](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/ion-mobility-and-msms/)
|
|
115
|
+
walks through both, and the output format describes the
|
|
116
|
+
[mobility](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/output-format/#ion-mobility)
|
|
117
|
+
and [MS/MS](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/output-format/#demultiplexed-msms-table)
|
|
118
|
+
tables in full.
|
|
119
|
+
[For tool developers](https://M4i-Imaging-Mass-Spectrometry.github.io/thyra/for-tool-developers/)
|
|
120
|
+
lists the rules a tool can rely on, and what may change.
|
|
121
|
+
|
|
122
|
+
Waters Synapt runs with ion mobility on keep their drift times; older
|
|
123
|
+
Synapt G1 mobility runs are refused. CCS is computed from 1/K0 only, never
|
|
124
|
+
from a drift time.
|
|
125
|
+
|
|
76
126
|
## From Python
|
|
77
127
|
|
|
78
128
|
```python
|
|
@@ -123,7 +173,8 @@ If you use Thyra, please cite the paper:
|
|
|
123
173
|
|
|
124
174
|
> Visvikis, T.; Vierdag, W.-M.; Marconato, L.; Birmpili, A.; Heeren, R. M. A.;
|
|
125
175
|
> Cuypers, E. Native, Memory-Bounded Conversion of Mass Spectrometry Imaging
|
|
126
|
-
> Data into the SpatialData Ecosystem. *J. Am. Soc. Mass Spectrom.* **2026
|
|
176
|
+
> Data into the SpatialData Ecosystem. *J. Am. Soc. Mass Spectrom.* **2026**,
|
|
177
|
+
> *37* (10), 2379-2387.
|
|
127
178
|
> [doi:10.1021/jasms.6c00169](https://doi.org/10.1021/jasms.6c00169)
|
|
128
179
|
|
|
129
180
|
```bibtex
|
|
@@ -132,6 +183,9 @@ If you use Thyra, please cite the paper:
|
|
|
132
183
|
author = {Visvikis, Theodoros and Vierdag, Wouter-Michiel and Marconato, Luca and Birmpili, Angeliki and Heeren, Ron M. A. and Cuypers, Eva},
|
|
133
184
|
journal = {Journal of the American Society for Mass Spectrometry},
|
|
134
185
|
year = {2026},
|
|
186
|
+
volume = {37},
|
|
187
|
+
number = {10},
|
|
188
|
+
pages = {2379--2387},
|
|
135
189
|
doi = {10.1021/jasms.6c00169}
|
|
136
190
|
}
|
|
137
191
|
```
|
|
@@ -148,6 +202,16 @@ repository" button reads. To cite the software itself:
|
|
|
148
202
|
}
|
|
149
203
|
```
|
|
150
204
|
|
|
205
|
+
### Papers
|
|
206
|
+
|
|
207
|
+
| Paper | Published | DOI |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| Native, Memory-Bounded Conversion of Mass Spectrometry Imaging Data into the SpatialData Ecosystem (*J. Am. Soc. Mass Spectrom.*) | 2026-09 | [10.1021/jasms.6c00169](https://doi.org/10.1021/jasms.6c00169) |
|
|
210
|
+
| Thyra: Bridging Mass Spectrometry Imaging and SpatialData for Unified Multi-Modal Analysis (bioRxiv preprint) | 2026-01 | [10.64898/2026.01.26.700792](https://doi.org/10.64898/2026.01.26.700792) |
|
|
211
|
+
|
|
212
|
+
Ion mobility and MS/MS support came after both papers. If you use them,
|
|
213
|
+
please also name the Thyra version you used.
|
|
214
|
+
|
|
151
215
|
## Acknowledgments
|
|
152
216
|
|
|
153
217
|
- Built with [SpatialData](https://spatialdata.scverse.org/) ecosystem
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "thyra"
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.5.0"
|
|
8
8
|
description = "A modern Python library for converting Mass Spectrometry Imaging (MSI) data into SpatialData/Zarr format - your portal to spatial omics"
|
|
9
9
|
authors = [{ name = "Theodoros Visvikis", email = "t.visvikis@maastrichtuniversity.nl" }]
|
|
10
10
|
maintainers = [{ name = "Theodoros Visvikis", email = "t.visvikis@maastrichtuniversity.nl" }]
|
|
@@ -22,6 +22,11 @@ keywords = [
|
|
|
22
22
|
"msi",
|
|
23
23
|
"imzml",
|
|
24
24
|
"bruker",
|
|
25
|
+
"timstof",
|
|
26
|
+
"ion-mobility",
|
|
27
|
+
"tims",
|
|
28
|
+
"msms",
|
|
29
|
+
"pasef",
|
|
25
30
|
"spatial-omics",
|
|
26
31
|
"data-conversion",
|
|
27
32
|
"scientific-computing",
|
|
@@ -311,13 +316,6 @@ dev = [
|
|
|
311
316
|
"flake8>=6.0.0",
|
|
312
317
|
"mypy>=1.0.0",
|
|
313
318
|
"pydocstyle>=6.3.0",
|
|
314
|
-
# This once capped `click <8.2`, and the note here said that dev-only cap
|
|
315
|
-
# was what held the lockfile's click at 8.1.8. Both halves are stale:
|
|
316
|
-
# 10.6.1, the locked version, requires `click>=8.1.0,<9.0.0`, and uv.lock
|
|
317
|
-
# resolves click 8.4.2. So the lockfile no longer exercises the floor of
|
|
318
|
-
# the `>=8.1, <9` range [project] publishes -- see the click comment above
|
|
319
|
-
# for which versions were verified by hand instead.
|
|
320
|
-
"python-semantic-release",
|
|
321
319
|
"python-dotenv>=1.1.1,<2",
|
|
322
320
|
"pre-commit>=3.0.0",
|
|
323
321
|
"bandit[toml]>=1.7.0",
|
|
@@ -356,67 +354,6 @@ filterwarnings = [
|
|
|
356
354
|
"ignore::UserWarning:spatialdata.models.models:1053"
|
|
357
355
|
]
|
|
358
356
|
|
|
359
|
-
# =============================================================
|
|
360
|
-
# === SEMANTIC RELEASE CONFIGURATION ===
|
|
361
|
-
# =============================================================
|
|
362
|
-
[tool.semantic_release]
|
|
363
|
-
version_toml = ["pyproject.toml:project.version"]
|
|
364
|
-
version_variables = [
|
|
365
|
-
"thyra/__init__.py:__version__",
|
|
366
|
-
]
|
|
367
|
-
# `uv lock` runs here rather than as a workflow step because the build
|
|
368
|
-
# command is the only hook that executes AFTER semantic-release stamps the
|
|
369
|
-
# new version into pyproject.toml and BEFORE it makes the release commit.
|
|
370
|
-
# Without it, the lockfile's own `[[package]] name = "thyra"` entry keeps
|
|
371
|
-
# the previous version. The release commit lands on main without a test run
|
|
372
|
-
# (a GITHUB_TOKEN push starts no workflows), so nothing notices until the
|
|
373
|
-
# first branch cut after the release fails every CI job at
|
|
374
|
-
# `uv sync --locked` with "The lockfile at `uv.lock` needs to be updated" --
|
|
375
|
-
# see the one-off repair on PR #177 after v3.5.0. Regenerating the lockfile
|
|
376
|
-
# is only half the fix: `assets` below is what carries it into the release
|
|
377
|
-
# commit. uv reaches this command's PATH via the same SHA-pinned setup-uv
|
|
378
|
-
# step the test workflow uses (see release.yml).
|
|
379
|
-
build_command = "uv lock && pip install build && python -m build"
|
|
380
|
-
# Extra files to include in the release commit beyond the version-stamped
|
|
381
|
-
# ones above.
|
|
382
|
-
assets = ["uv.lock"]
|
|
383
|
-
# There is deliberately no `upload_to_vcs_release` here. It used to sit at this
|
|
384
|
-
# level and had never had any effect, for three independent reasons: it is a
|
|
385
|
-
# field of PublishConfig, so it belongs under [tool.semantic_release.publish] and
|
|
386
|
-
# is silently dropped here (RawConfig sets no `extra` policy, so pydantic ignores
|
|
387
|
-
# unknown keys); its default is already true; and it is acted on only by
|
|
388
|
-
# `semantic-release publish`, which calls hvcs_client.upload_dists, while
|
|
389
|
-
# release.yml only ever runs `semantic-release version`, which never does.
|
|
390
|
-
# Verified against python-semantic-release 10.6.2. The visible consequence was
|
|
391
|
-
# that the releases for v3.23.0-v3.23.2 each carry exactly one asset, uv.lock,
|
|
392
|
-
# and no wheel or sdist.
|
|
393
|
-
#
|
|
394
|
-
# The dist this build_command produces is not lost, though. release.yml uploads
|
|
395
|
-
# it as a workflow artifact and the publish job takes it from there, which is
|
|
396
|
-
# what makes one build per release. If you want it on the GitHub Release as well,
|
|
397
|
-
# that is an upload step in release.yml, not this key.
|
|
398
|
-
|
|
399
|
-
[tool.semantic_release.branches.main]
|
|
400
|
-
match = "main"
|
|
401
|
-
prerelease = false
|
|
402
|
-
|
|
403
|
-
[tool.semantic_release.changelog]
|
|
404
|
-
template_dir = "templates"
|
|
405
|
-
changelog_file = "CHANGELOG.md"
|
|
406
|
-
exclude_commit_patterns = [
|
|
407
|
-
"chore*",
|
|
408
|
-
"ci*",
|
|
409
|
-
]
|
|
410
|
-
|
|
411
|
-
[tool.semantic_release.commit_parser_options]
|
|
412
|
-
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
|
|
413
|
-
minor_tags = ["feat"]
|
|
414
|
-
patch_tags = ["fix", "perf"]
|
|
415
|
-
|
|
416
|
-
[tool.semantic_release.remote_settings]
|
|
417
|
-
name = "origin"
|
|
418
|
-
token = { env = "GITHUB_TOKEN" }
|
|
419
|
-
|
|
420
357
|
# =============================================================
|
|
421
358
|
# === CODE QUALITY TOOL CONFIGURATIONS ===
|
|
422
359
|
# =============================================================
|
|
@@ -21,8 +21,8 @@ The public names below resolve on first attribute access (:pep:`562`), so
|
|
|
21
21
|
still cost what they always did -- paid by the caller who asks for them.
|
|
22
22
|
|
|
23
23
|
``__version__`` stays an ordinary module attribute rather than joining
|
|
24
|
-
them. It is what
|
|
25
|
-
(``
|
|
24
|
+
them. It is what release-please rewrites in the release pull request
|
|
25
|
+
(the ``python`` release type in ``release-please-config.json``), and
|
|
26
26
|
``thyra.metadata.schema.builder`` reads it through ``from thyra import
|
|
27
27
|
__version__`` while building a document -- which is only affordable
|
|
28
28
|
because reaching this module is now free.
|
|
@@ -51,8 +51,11 @@ from typing import TYPE_CHECKING, Any, List
|
|
|
51
51
|
if TYPE_CHECKING: # pragma: no cover - for type checkers, not at runtime
|
|
52
52
|
from .convert import convert_msi
|
|
53
53
|
from .converters.spatialdata.converter import SpatialDataConverter
|
|
54
|
+
from .mass_axis_plan import plan_mass_axis
|
|
54
55
|
from .metadata.document import read_metadata_document
|
|
55
56
|
from .preview import MsiPreview, preview_msi
|
|
57
|
+
from .regions import list_regions
|
|
58
|
+
from .resampling.plan import MassAxisPlan
|
|
56
59
|
|
|
57
60
|
# Suppress remaining dependency warnings
|
|
58
61
|
warnings.filterwarnings("ignore", category=FutureWarning, module="dask")
|
|
@@ -67,13 +70,16 @@ warnings.filterwarnings(
|
|
|
67
70
|
category=FutureWarning,
|
|
68
71
|
)
|
|
69
72
|
|
|
70
|
-
__version__ = "4.
|
|
73
|
+
__version__ = "4.5.0"
|
|
71
74
|
|
|
72
75
|
#: Public name -> the module that defines it, imported on first access.
|
|
73
76
|
_LAZY_ATTRS = {
|
|
77
|
+
"MassAxisPlan": ".resampling.plan",
|
|
74
78
|
"MsiPreview": ".preview",
|
|
75
79
|
"SpatialDataConverter": ".converters.spatialdata.converter",
|
|
76
80
|
"convert_msi": ".convert",
|
|
81
|
+
"list_regions": ".regions",
|
|
82
|
+
"plan_mass_axis": ".mass_axis_plan",
|
|
77
83
|
"preview_msi": ".preview",
|
|
78
84
|
"read_metadata_document": ".metadata.document",
|
|
79
85
|
}
|
|
@@ -88,7 +94,10 @@ __all__ = [
|
|
|
88
94
|
"__version__",
|
|
89
95
|
"convert_msi",
|
|
90
96
|
"preview_msi",
|
|
97
|
+
"list_regions",
|
|
98
|
+
"plan_mass_axis",
|
|
91
99
|
"read_metadata_document",
|
|
100
|
+
"MassAxisPlan",
|
|
92
101
|
"MsiPreview",
|
|
93
102
|
"SpatialDataConverter",
|
|
94
103
|
]
|