Spectrum

Overview

class modifinder.classes.Spectrum(incoming_data=None, **kwargs)[source]

A class to represent a spectrum.

Parameters:
  • mz (list) – A list of m/z values.

  • intensity (list) – A list of intensity values.

  • precursor_mz (float) – The precursor m/z value.

  • precursor_charge (int) – The precursor charge.

  • adduct (str) – The adduct.

  • adduct_mass (float) – The adduct mass.

  • ms_level (int) – The ms level, default is 2.

  • instrument (str, optional) – The instrument used.

  • ms_mass_analyzer (str, optional) – The mass analyzer used.

  • ms_dissociation_method (str, optional) – The dissociation method used.

  • spectrum_id (str, optional) – The spectrum id. if not provided, it will be generated.

  • peak_fragment_dict (dict, optional) – A dictionary mapping peaks to fragments

Examples

__init__(incoming_data=None, **kwargs)[source]

Constructor for the Spectrum class.

the spectrum class can be initialized with a dictionary of data or with the individual values.

Parameters:

incoming_data (Input data (optional, default is None).) – The data to initialize the Spectrum object. The data can be a dictionary, a usi, or a Spectrum object.

Methods

update([peaks, peaks_json, mz, intensity, ...])

Update the Spectrum object with the given values.

clear()

Clear the Spectrum object.

normalize_peaks([change_self])

l2 Normalize the intensity of the Spectrum object.