mioXpektron.utils

Utility exports for the Xpektron toolkit.

mioXpektron.utils.import_data(file_path, mz_min=None, mz_max=None, group_patterns=None, group_fn=None)[source]

Import ToF-SIMS data from a spectrum file.

Parameters:
  • file_path (str) – Path to the ToF-SIMS data file. Supports tab-delimited .txt exports with m/z + Intensity columns and CSV exports with mz + corrected_intensity or intensity columns.

  • mz_min (float, optional) – Minimum m/z value to be imported (inclusive).

  • mz_max (float, optional) – Maximum m/z value to be imported (inclusive).

  • group_patterns (dict[str, str], optional) – Mapping of {regex_pattern: group_label}. Patterns are tested against the sample name (filename without extension) in order; the first match determines the group. Defaults to {'_CC...': 'Cancer', '_CT...': 'Control'}.

  • group_fn (callable, optional) – A function (sample_name: str) -> str that returns the group label directly. When provided this takes priority over group_patterns.

Returns:

  • mz (np.ndarray) – Mass-to-charge ratio values.

  • intensity (np.ndarray) – Intensity values.

  • sample_name (str) – Sample name extracted from file name.

  • group (str) – Group label derived from the filename.

Return type:

Tuple[ndarray, ndarray, str, str]

Modules

analysis

Comprehensive analysis for Cancer vs Control ToF-SIMS-like intensity tables.

file_management

main

High-level utilities for parallel peak extraction and alignment.