imspy-core 0.4.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.
Files changed (28) hide show
  1. imspy_core-0.4.0/PKG-INFO +70 -0
  2. imspy_core-0.4.0/README.md +43 -0
  3. imspy_core-0.4.0/pyproject.toml +39 -0
  4. imspy_core-0.4.0/src/imspy_core/__init__.py +75 -0
  5. imspy_core-0.4.0/src/imspy_core/chemistry/__init__.py +37 -0
  6. imspy_core-0.4.0/src/imspy_core/chemistry/amino_acids.py +7 -0
  7. imspy_core-0.4.0/src/imspy_core/chemistry/constants.py +12 -0
  8. imspy_core-0.4.0/src/imspy_core/chemistry/elements.py +6 -0
  9. imspy_core-0.4.0/src/imspy_core/chemistry/mobility.py +82 -0
  10. imspy_core-0.4.0/src/imspy_core/chemistry/sum_formula.py +38 -0
  11. imspy_core-0.4.0/src/imspy_core/chemistry/unimod.py +5 -0
  12. imspy_core-0.4.0/src/imspy_core/chemistry/utility.py +43 -0
  13. imspy_core-0.4.0/src/imspy_core/core/__init__.py +9 -0
  14. imspy_core-0.4.0/src/imspy_core/core/base.py +38 -0
  15. imspy_core-0.4.0/src/imspy_core/data/__init__.py +17 -0
  16. imspy_core-0.4.0/src/imspy_core/data/peptide.py +528 -0
  17. imspy_core-0.4.0/src/imspy_core/data/spectrum.py +586 -0
  18. imspy_core-0.4.0/src/imspy_core/timstof/__init__.py +25 -0
  19. imspy_core-0.4.0/src/imspy_core/timstof/collision.py +31 -0
  20. imspy_core-0.4.0/src/imspy_core/timstof/data.py +429 -0
  21. imspy_core-0.4.0/src/imspy_core/timstof/dda.py +364 -0
  22. imspy_core-0.4.0/src/imspy_core/timstof/dia.py +131 -0
  23. imspy_core-0.4.0/src/imspy_core/timstof/frame.py +604 -0
  24. imspy_core-0.4.0/src/imspy_core/timstof/quadrupole.py +189 -0
  25. imspy_core-0.4.0/src/imspy_core/timstof/slice.py +506 -0
  26. imspy_core-0.4.0/src/imspy_core/utility/__init__.py +21 -0
  27. imspy_core-0.4.0/src/imspy_core/utility/sequence.py +38 -0
  28. imspy_core-0.4.0/src/imspy_core/utility/utilities.py +278 -0
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: imspy-core
3
+ Version: 0.4.0
4
+ Summary: Core data structures and utilities for processing timsTOF ion mobility spectrometry data.
5
+ License-Expression: MIT
6
+ Author: theGreatHerrLebert
7
+ Author-email: davidteschner@googlemail.com
8
+ Requires-Python: >=3.11,<3.14
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: imspy-connector (>=0.3.0)
14
+ Requires-Dist: mendeleev (>=0.7.0)
15
+ Requires-Dist: numba (>=0.53)
16
+ Requires-Dist: numpy (>=1.21)
17
+ Requires-Dist: opentims-bruker-bridge (>=1.1.0)
18
+ Requires-Dist: pandas (>=2.1)
19
+ Requires-Dist: pyarrow (>=13.0)
20
+ Requires-Dist: scipy (>=1.7.1)
21
+ Requires-Dist: tabulate (>=0.9.0)
22
+ Requires-Dist: toml (>=0.10.2)
23
+ Requires-Dist: tqdm (>=4.66)
24
+ Requires-Dist: zstd (>=1.5.6.1)
25
+ Description-Content-Type: text/markdown
26
+
27
+ # imspy-core
28
+
29
+ Core data structures and utilities for processing timsTOF ion mobility spectrometry data.
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ pip install imspy-core
35
+ ```
36
+
37
+ ## Features
38
+
39
+ - **Data Structures**: MzSpectrum, TimsSpectrum, PeptideSequence, and more
40
+ - **Chemistry Utilities**: Elements, amino acids, UNIMOD modifications, CCS/mobility conversions
41
+ - **TimsTOF Readers**: Read DDA and DIA datasets from Bruker timsTOF instruments
42
+ - **Low Dependencies**: Only essential packages (numpy, pandas, scipy, numba)
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ from imspy_core.timstof import TimsDatasetDDA
48
+ from imspy_core.data import PeptideSequence
49
+
50
+ # Read a DDA dataset
51
+ dataset = TimsDatasetDDA("/path/to/data.d")
52
+ frame = dataset.get_tims_frame(1)
53
+ print(frame)
54
+
55
+ # Work with peptides
56
+ peptide = PeptideSequence("PEPTIDEK")
57
+ print(f"Mass: {peptide.mono_isotopic_mass}")
58
+ ```
59
+
60
+ ## Related Packages
61
+
62
+ - **imspy-predictors**: ML-based predictions (CCS, RT, intensity) - requires TensorFlow
63
+ - **imspy-search**: Database search functionality - requires sagepy, mokapot
64
+ - **imspy-simulation**: Simulation tools for timsTOF data
65
+ - **imspy-vis**: Visualization tools - requires Plotly, Matplotlib
66
+
67
+ ## License
68
+
69
+ MIT License - see LICENSE file for details.
70
+
@@ -0,0 +1,43 @@
1
+ # imspy-core
2
+
3
+ Core data structures and utilities for processing timsTOF ion mobility spectrometry data.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install imspy-core
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **Data Structures**: MzSpectrum, TimsSpectrum, PeptideSequence, and more
14
+ - **Chemistry Utilities**: Elements, amino acids, UNIMOD modifications, CCS/mobility conversions
15
+ - **TimsTOF Readers**: Read DDA and DIA datasets from Bruker timsTOF instruments
16
+ - **Low Dependencies**: Only essential packages (numpy, pandas, scipy, numba)
17
+
18
+ ## Quick Start
19
+
20
+ ```python
21
+ from imspy_core.timstof import TimsDatasetDDA
22
+ from imspy_core.data import PeptideSequence
23
+
24
+ # Read a DDA dataset
25
+ dataset = TimsDatasetDDA("/path/to/data.d")
26
+ frame = dataset.get_tims_frame(1)
27
+ print(frame)
28
+
29
+ # Work with peptides
30
+ peptide = PeptideSequence("PEPTIDEK")
31
+ print(f"Mass: {peptide.mono_isotopic_mass}")
32
+ ```
33
+
34
+ ## Related Packages
35
+
36
+ - **imspy-predictors**: ML-based predictions (CCS, RT, intensity) - requires TensorFlow
37
+ - **imspy-search**: Database search functionality - requires sagepy, mokapot
38
+ - **imspy-simulation**: Simulation tools for timsTOF data
39
+ - **imspy-vis**: Visualization tools - requires Plotly, Matplotlib
40
+
41
+ ## License
42
+
43
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,39 @@
1
+ [project]
2
+ name = "imspy-core"
3
+ version = "0.4.0"
4
+ description = "Core data structures and utilities for processing timsTOF ion mobility spectrometry data."
5
+ authors = [
6
+ { name = "theGreatHerrLebert", email = "davidteschner@googlemail.com" }
7
+ ]
8
+ readme = "README.md"
9
+ license = "MIT"
10
+ requires-python = ">=3.11,<3.14"
11
+
12
+ dependencies = [
13
+ "pandas>=2.1",
14
+ "numpy>=1.21",
15
+ "numba>=0.53",
16
+ "scipy>=1.7.1",
17
+ "zstd>=1.5.6.1",
18
+ "tabulate>=0.9.0",
19
+ "tqdm>=4.66",
20
+ "pyarrow>=13.0",
21
+ "mendeleev>=0.7.0",
22
+ "toml>=0.10.2",
23
+ "imspy-connector>=0.3.0",
24
+ "opentims-bruker-bridge>=1.1.0",
25
+ ]
26
+
27
+ [build-system]
28
+ requires = ["poetry-core"]
29
+ build-backend = "poetry.core.masonry.api"
30
+
31
+ [tool.poetry.group.dev.dependencies]
32
+ pytest = "^8.0.0"
33
+ pytest-cov = "^4.1.0"
34
+
35
+ [tool.pytest.ini_options]
36
+ testpaths = ["tests"]
37
+ python_files = ["test_*.py"]
38
+ python_functions = ["test_*"]
39
+ addopts = "-v --tb=short"
@@ -0,0 +1,75 @@
1
+ """
2
+ imspy_core - Core data structures and utilities for processing timsTOF ion mobility spectrometry data.
3
+
4
+ This package provides the foundational components for working with timsTOF data:
5
+ - Data structures for spectra and peptides
6
+ - Chemistry utilities (elements, amino acids, UNIMOD)
7
+ - TimsTOF dataset readers (DDA and DIA)
8
+ - General utilities
9
+
10
+ For ML-based predictions, install imspy-predictors.
11
+ For database search functionality, install imspy-search.
12
+ For simulation tools, install imspy-simulation.
13
+ """
14
+
15
+ __version__ = "0.4.0"
16
+
17
+ # Core base classes
18
+ from imspy_core.core import RustWrapperObject
19
+
20
+ # Data structures
21
+ from imspy_core.data import (
22
+ MzSpectrum, IndexedMzSpectrum, MzSpectrumVectorized, TimsSpectrum,
23
+ PeptideSequence, PeptideIon, PeptideProductIon,
24
+ PeptideProductIonSeries, PeptideProductIonSeriesCollection
25
+ )
26
+
27
+ # Chemistry
28
+ from imspy_core.chemistry import (
29
+ MASS_PROTON, MASS_NEUTRON, MASS_ELECTRON, MASS_WATER,
30
+ AMINO_ACID_MASSES, AMINO_ACIDS,
31
+ UNIMOD_MASSES,
32
+ one_over_k0_to_ccs, ccs_to_one_over_k0,
33
+ SumFormula, calculate_mz
34
+ )
35
+
36
+ # TimsTOF
37
+ from imspy_core.timstof import (
38
+ TimsDataset, AcquisitionMode,
39
+ TimsFrame, TimsFrameVectorized,
40
+ TimsSlice, TimsSliceVectorized,
41
+ TimsDatasetDDA, PrecursorDDA, FragmentDDA,
42
+ TimsDatasetDIA,
43
+ TimsTofQuadrupoleDDA, TimsTofQuadrupoleDIA
44
+ )
45
+
46
+ # Utility
47
+ from imspy_core.utility import (
48
+ re_index_indices, tokenize_unimod_sequence
49
+ )
50
+
51
+ __all__ = [
52
+ # Version
53
+ '__version__',
54
+ # Core
55
+ 'RustWrapperObject',
56
+ # Data
57
+ 'MzSpectrum', 'IndexedMzSpectrum', 'MzSpectrumVectorized', 'TimsSpectrum',
58
+ 'PeptideSequence', 'PeptideIon', 'PeptideProductIon',
59
+ 'PeptideProductIonSeries', 'PeptideProductIonSeriesCollection',
60
+ # Chemistry
61
+ 'MASS_PROTON', 'MASS_NEUTRON', 'MASS_ELECTRON', 'MASS_WATER',
62
+ 'AMINO_ACID_MASSES', 'AMINO_ACIDS',
63
+ 'UNIMOD_MASSES',
64
+ 'one_over_k0_to_ccs', 'ccs_to_one_over_k0',
65
+ 'SumFormula', 'calculate_mz',
66
+ # TimsTOF
67
+ 'TimsDataset', 'AcquisitionMode',
68
+ 'TimsFrame', 'TimsFrameVectorized',
69
+ 'TimsSlice', 'TimsSliceVectorized',
70
+ 'TimsDatasetDDA', 'PrecursorDDA', 'FragmentDDA',
71
+ 'TimsDatasetDIA',
72
+ 'TimsTofQuadrupoleDDA', 'TimsTofQuadrupoleDIA',
73
+ # Utility
74
+ 're_index_indices', 'tokenize_unimod_sequence',
75
+ ]
@@ -0,0 +1,37 @@
1
+ """
2
+ Chemistry module for imspy_core.
3
+
4
+ Contains elements, amino acids, UNIMOD, mobility functions, and sum formulas.
5
+ """
6
+
7
+ from .constants import (
8
+ MASS_PROTON, MASS_NEUTRON, MASS_ELECTRON, MASS_WATER,
9
+ STANDARD_TEMPERATURE, STANDARD_PRESSURE, ELEMENTARY_CHARGE,
10
+ K_BOLTZMANN, AVOGADRO_NUMBER
11
+ )
12
+ from .elements import (
13
+ ELEMENTAL_MONO_ISOTOPIC_MASSES, ELEMENTAL_ISOTOPIC_MASSES,
14
+ ELEMENTAL_ISOTOPIC_ABUNDANCES
15
+ )
16
+ from .amino_acids import AMINO_ACID_MASSES, AMINO_ACIDS, AMINO_ACID_ATOMIC_COMPOSITIONS
17
+ from .unimod import UNIMOD_MASSES, UNIMOD_ATOMIC_COMPOSITIONS
18
+ from .mobility import (
19
+ one_over_k0_to_ccs, ccs_to_one_over_k0,
20
+ ccs_to_one_over_k0_par, one_over_k0_to_ccs_par
21
+ )
22
+ from .sum_formula import SumFormula
23
+ from .utility import calculate_mz, calculate_transmission_dependent_fragment_ion_isotope_distribution
24
+
25
+ __all__ = [
26
+ 'MASS_PROTON', 'MASS_NEUTRON', 'MASS_ELECTRON', 'MASS_WATER',
27
+ 'STANDARD_TEMPERATURE', 'STANDARD_PRESSURE', 'ELEMENTARY_CHARGE',
28
+ 'K_BOLTZMANN', 'AVOGADRO_NUMBER',
29
+ 'ELEMENTAL_MONO_ISOTOPIC_MASSES', 'ELEMENTAL_ISOTOPIC_MASSES',
30
+ 'ELEMENTAL_ISOTOPIC_ABUNDANCES',
31
+ 'AMINO_ACID_MASSES', 'AMINO_ACIDS', 'AMINO_ACID_ATOMIC_COMPOSITIONS',
32
+ 'UNIMOD_MASSES', 'UNIMOD_ATOMIC_COMPOSITIONS',
33
+ 'one_over_k0_to_ccs', 'ccs_to_one_over_k0',
34
+ 'ccs_to_one_over_k0_par', 'one_over_k0_to_ccs_par',
35
+ 'SumFormula',
36
+ 'calculate_mz', 'calculate_transmission_dependent_fragment_ion_isotope_distribution'
37
+ ]
@@ -0,0 +1,7 @@
1
+ import imspy_connector
2
+ ims = imspy_connector.py_amino_acids
3
+
4
+
5
+ AMINO_ACID_MASSES = ims.get_amino_acid_mono_isotopic_masses()
6
+ AMINO_ACIDS = ims.get_amino_acids()
7
+ AMINO_ACID_ATOMIC_COMPOSITIONS = ims.get_amino_acid_atomic_compositions()
@@ -0,0 +1,12 @@
1
+ import imspy_connector
2
+ ims = imspy_connector.py_constants
3
+
4
+ MASS_PROTON = ims.mass_proton()
5
+ MASS_NEUTRON = ims.mass_neutron()
6
+ MASS_ELECTRON = ims.mass_electron()
7
+ MASS_WATER = ims.mass_water()
8
+ STANDARD_TEMPERATURE = ims.standard_temperature()
9
+ STANDARD_PRESSURE = ims.standard_pressure()
10
+ ELEMENTARY_CHARGE = ims.elementary_charge()
11
+ K_BOLTZMANN = ims.k_boltzmann()
12
+ AVOGADRO_NUMBER = ims.avogadro()
@@ -0,0 +1,6 @@
1
+ import imspy_connector
2
+ ims = imspy_connector.py_elements
3
+
4
+ ELEMENTAL_MONO_ISOTOPIC_MASSES = ims.get_elemental_mono_isotopic_weight_map()
5
+ ELEMENTAL_ISOTOPIC_MASSES = ims.get_elemental_isotope_weight_map()
6
+ ELEMENTAL_ISOTOPIC_ABUNDANCES = ims.get_elemental_isotope_abundance_map()
@@ -0,0 +1,82 @@
1
+ import os
2
+ from numpy.typing import NDArray
3
+ import imspy_connector
4
+ ims = imspy_connector.py_chemistry
5
+
6
+
7
+ def one_over_k0_to_ccs(one_over_k0, mz, charge, mass_gas=28.013, temp=31.85, t_diff=273.15):
8
+ """Convert reduced ion mobility (1/k0) to CCS.
9
+
10
+ Args:
11
+ one_over_k0: reduced ion mobility
12
+ mz: mass-over-charge of the ion
13
+ charge: charge state of the ion
14
+ mass_gas: mass of drift gas
15
+ temp: temperature of the drift gas in C°
16
+ t_diff: factor to translate from C° to K
17
+
18
+ Returns:
19
+ float: collision cross-section
20
+ """
21
+ return ims.one_over_reduced_mobility_to_ccs(one_over_k0, mz, charge, mass_gas, temp, t_diff)
22
+
23
+
24
+ def ccs_to_one_over_k0(ccs, mz, charge, mass_gas=28.013, temp=31.85, t_diff=273.15):
25
+ """Convert CCS to reduced ion mobility (1/k0).
26
+
27
+ Args:
28
+ ccs: collision cross-section
29
+ mz: mass-over-charge of the ion
30
+ charge: charge state of the ion
31
+ mass_gas: mass of drift gas
32
+ temp: temperature of the drift gas in C°
33
+ t_diff: factor to translate from C° to K
34
+
35
+ Returns:
36
+ float: reduced ion mobility
37
+ """
38
+ return ims.ccs_to_one_over_reduced_mobility(ccs, mz, charge, mass_gas, temp, t_diff)
39
+
40
+ def ccs_to_one_over_k0_par(ccs: NDArray, mz: NDArray, charge: NDArray, mass_gas: float = 28.013, temp: float = 31.85,
41
+ t_diff: float = 273.15, num_threads: int = -1) -> NDArray:
42
+ """Convert CCS to reduced ion mobility (1/k0) in parallel.
43
+
44
+ Args:
45
+ ccs: collision cross-section
46
+ mz: mass-over-charge of the ion
47
+ charge: charge state of the ion
48
+ mass_gas: mass of drift gas
49
+ temp: temperature of the drift gas in C°
50
+ t_diff: factor to translate from C° to K
51
+ num_threads: number of threads
52
+
53
+ Returns:
54
+ NDArray: reduced ion mobility
55
+ """
56
+
57
+ if num_threads == -1:
58
+ num_threads = os.cpu_count()
59
+
60
+ return ims.ccs_to_one_over_reduced_mobility_par(ccs, mz, charge, mass_gas, temp, t_diff, num_threads)
61
+
62
+ def one_over_k0_to_ccs_par(one_over_k0: NDArray, mz: NDArray, charge: NDArray, mass_gas: float = 28.013, temp: float = 31.85,
63
+ t_diff: float = 273.15, num_threads: int = -1) -> NDArray:
64
+ """Convert reduced ion mobility (1/k0) to CCS in parallel.
65
+
66
+ Args:
67
+ one_over_k0: reduced ion mobility
68
+ mz: mass-over-charge of the ion
69
+ charge: charge state of the ion
70
+ mass_gas: mass of drift gas
71
+ temp: temperature of the drift gas in C°
72
+ t_diff: factor to translate from C° to K
73
+ num_threads: number of threads
74
+
75
+ Returns:
76
+ NDArray: collision cross-section
77
+ """
78
+
79
+ if num_threads == -1:
80
+ num_threads = os.cpu_count()
81
+
82
+ return ims.one_over_reduced_mobility_to_ccs_par(one_over_k0, mz, charge, mass_gas, temp, t_diff, num_threads)
@@ -0,0 +1,38 @@
1
+ import imspy_connector
2
+
3
+ from imspy_core.data.spectrum import MzSpectrum
4
+ from imspy_core.core.base import RustWrapperObject
5
+
6
+ ims = imspy_connector.py_sum_formula
7
+
8
+
9
+ class SumFormula(RustWrapperObject):
10
+ def __init__(self, sum_formula: str):
11
+ self.__ptr = ims.PySumFormula(sum_formula)
12
+
13
+ @property
14
+ def formula(self) -> str:
15
+ return self.__ptr.formula
16
+
17
+ @property
18
+ def formula_dict(self) -> dict:
19
+ return self.__ptr.elements
20
+
21
+ @property
22
+ def monoisotopic_mass(self) -> float:
23
+ return self.__ptr.monoisotopic_mass
24
+
25
+ def __repr__(self):
26
+ return f"SumFormula('{self.formula}')"
27
+
28
+ @classmethod
29
+ def from_py_ptr(cls, py_ptr):
30
+ instance = cls.__new__(cls)
31
+ instance.__ptr = py_ptr
32
+ return instance
33
+
34
+ def get_py_ptr(self):
35
+ return self.__ptr
36
+
37
+ def generate_isotope_distribution(self, charge: int) -> 'MzSpectrum':
38
+ return MzSpectrum.from_py_ptr(self.__ptr.generate_isotope_distribution(charge))
@@ -0,0 +1,5 @@
1
+ import imspy_connector
2
+ ims = imspy_connector.py_unimod
3
+
4
+ UNIMOD_MASSES = ims.get_unimod_masses()
5
+ UNIMOD_ATOMIC_COMPOSITIONS = ims.get_unimod_atomic_compositions()
@@ -0,0 +1,43 @@
1
+ import imspy_connector
2
+
3
+ from imspy_core.data.spectrum import MzSpectrum
4
+
5
+ ims = imspy_connector.py_chemistry
6
+
7
+
8
+ def calculate_mz(mass: float, charge: int) -> float:
9
+ """Calculate m/z value.
10
+
11
+ Args:
12
+ mass (float): Mass.
13
+ charge (int): Charge.
14
+
15
+ Returns:
16
+ float: m/z value.
17
+ """
18
+ return ims.calculate_mz(mass, charge)
19
+
20
+
21
+ def calculate_transmission_dependent_fragment_ion_isotope_distribution(
22
+ target_spec: MzSpectrum,
23
+ complement_spec: MzSpectrum,
24
+ transmitted_isotopes: MzSpectrum,
25
+ max_isotope: int) -> MzSpectrum:
26
+ """Calculate transmission dependent fragment ion isotope distribution.
27
+
28
+ Args:
29
+ target_spec (MzSpectrum): Target spectrum.
30
+ complement_spec (MzSpectrum): Complement spectrum.
31
+ transmitted_isotopes (MzSpectrum): Transmitted isotopes.
32
+ max_isotope (int): Maximum isotope.
33
+
34
+ Returns:
35
+ MzSpectrum: Transmission dependent fragment ion isotope distribution.
36
+ """
37
+ return MzSpectrum.from_py_ptr(
38
+ ims.calculate_transmission_dependent_fragment_ion_isotope_distribution(
39
+ target_spec.get_py_ptr(),
40
+ complement_spec.get_py_ptr(),
41
+ transmitted_isotopes.get_py_ptr(), max_isotope
42
+ )
43
+ )
@@ -0,0 +1,9 @@
1
+ """
2
+ Core module for imspy_core.
3
+
4
+ Contains base classes and utilities used across the package.
5
+ """
6
+
7
+ from .base import RustWrapperObject
8
+
9
+ __all__ = ['RustWrapperObject']
@@ -0,0 +1,38 @@
1
+ """
2
+ Base classes for imspy_core.
3
+
4
+ This module contains base classes used across the package,
5
+ separated to avoid circular imports.
6
+ """
7
+
8
+ from abc import ABC, abstractmethod
9
+
10
+
11
+ class RustWrapperObject(ABC):
12
+ """Abstract base class for Python wrappers around Rust objects.
13
+
14
+ All classes that wrap PyO3 Rust objects should inherit from this
15
+ and implement from_py_ptr and get_py_ptr methods.
16
+ """
17
+
18
+ @classmethod
19
+ @abstractmethod
20
+ def from_py_ptr(cls, obj):
21
+ """Create a Python wrapper from a PyO3 pointer.
22
+
23
+ Args:
24
+ obj: The PyO3 Rust object pointer.
25
+
26
+ Returns:
27
+ An instance of the wrapper class.
28
+ """
29
+ pass
30
+
31
+ @abstractmethod
32
+ def get_py_ptr(self):
33
+ """Get the underlying PyO3 Rust object pointer.
34
+
35
+ Returns:
36
+ The PyO3 Rust object pointer.
37
+ """
38
+ pass
@@ -0,0 +1,17 @@
1
+ """
2
+ Data module for imspy_core.
3
+
4
+ Contains spectrum and peptide data structures.
5
+ """
6
+
7
+ from .spectrum import MzSpectrum, IndexedMzSpectrum, MzSpectrumVectorized, TimsSpectrum
8
+ from .peptide import (
9
+ PeptideSequence, PeptideIon, PeptideProductIon,
10
+ PeptideProductIonSeries, PeptideProductIonSeriesCollection
11
+ )
12
+
13
+ __all__ = [
14
+ 'MzSpectrum', 'IndexedMzSpectrum', 'MzSpectrumVectorized', 'TimsSpectrum',
15
+ 'PeptideSequence', 'PeptideIon', 'PeptideProductIon',
16
+ 'PeptideProductIonSeries', 'PeptideProductIonSeriesCollection'
17
+ ]