modifinder.Spectrum.update
- Spectrum.update(peaks=None, peaks_json=None, mz=None, intensity=None, precursor_mz=None, precursor_charge=None, _adduct=None, adduct=None, ms_level=None, instrument=None, ms_mass_analyzer=None, ms_dissociation_method=None, spectrum_id=None, normalize_peaks=False, ratio_to_base_peak=None, remove_large_peaks=False, keep_top_k=None, peak_fragments_map: dict | None = None, ignore_adduct_format=False, **kwargs)[source]
- Update the Spectrum object with the given values. - Parameters:
- peaks (list) – A list of peaks in the form of [[mz1, intensity1], [mz2, intensity2], …]. 
- peaks_json (str) – A json string of peaks. 
- 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. 
- ms_level (int) – The ms level. 
- instrument (str) – The instrument used. 
- ms_mass_analyzer (str) – The mass analyzer used. 
- ms_dissociation_method (str) – The dissociation method used. 
- spectrum_id (str) – The spectrum id. 
- normalize_peaks (bool) – If True, the intensity of the peaks will be normalized. 
- ratio_to_base_peak (float) – If None, no filtering is done, if a float number, it removes all the peaks with intensity 
- peak. (less than ratio times the base) – 
- remove_large_peaks (bool) – If True, remove all the peaks that are larger than the precursor m/z value. 
- keep_top_k (int) – If not None, only keep the top k peaks. 
- peak_fragments_map (dict) – A dictionary mapping peaks to fragments 
- ignore_adduct_format (bool) – If True, if the adduct format is not recognized, it will not throw an error. 
- **kwargs – Additional keyword arguments.