mioXpektron.recalibrate.peak_picker

peak_picker.py Identify the most intense point within ±0.5 Da of eight reference m/z values in every calibrated ToF-SIMS spectrum and return the results as a nested Python dictionary.

Author: Julhash Kazi, Lund University, 2025-06-15

Functions

batch_peak_process(files[, tol_da, tol_ppm, ...])

Process multiple spectra and write:

pick_peaks(df[, targets, tol_da, tol_ppm, ...])

Select a representative (m/z, intensity, channel) near each target. - 'max': highest point within window - 'centroid': baseline-subtracted, apex-focused centroid within the local peak - 'centroid_raw': raw intensity-weighted centroid over the local peak support - 'parabolic': pick apex by 'max', then refine m/z by a local quadratic fit using apex±1 bins (falls back to 'max' if not feasible).

mioXpektron.recalibrate.peak_picker.pick_peaks(df, targets=array([1.00782503, 15.02292652, 22.98976928, 38.96370649, 58.065674, 86.096974, 104.107539, 184.073871, 224.105171]), tol_da=0.2, tol_ppm=None, method='centroid', min_points=3, min_intensity=0.0)[source]

Select a representative (m/z, intensity, channel) near each target. - ‘max’: highest point within window - ‘centroid’: baseline-subtracted, apex-focused centroid within the local peak - ‘centroid_raw’: raw intensity-weighted centroid over the local peak support - ‘parabolic’: pick apex by ‘max’, then refine m/z by a local quadratic fit

using apex±1 bins (falls back to ‘max’ if not feasible)

Parameters:
Return type:

List[Dict]

mioXpektron.recalibrate.peak_picker.batch_peak_process(files, tol_da=0.2, tol_ppm=None, method='centroid')[source]
Process multiple spectra and write:
  • peak_summary.tsv (long format, per spectrum x per target)

  • channel_summary_exact.tsv (wide, columns = exact target masses)

  • channel_summary_nominal.tsv (wide, columns = nominal integer m/z)

Returns:

{spectrum: [channels in TARGET_MASSES order]} - calib_channels_dict_nominal:{spectrum: [channels in TARGET_NOMINAL order]}

Return type:

  • calib_channels_dict_exact

Parameters: