RIAssigner.data.MatchMSData
Classes
Class to handle data from filetypes which can be imported |
Functions
|
Read key from spectrum and convert to float or return 0.0. |
|
Assign RI value to Spectrum object |
Module Contents
- class RIAssigner.data.MatchMSData.MatchMSData(filename: str, filetype: str, rt_unit: str)[source]
Bases:
RIAssigner.data.Data.DataClass to handle data from filetypes which can be imported using ‘matchms’.
- write(filename: str) None[source]
Write data to back to the spectra file
- Parameters:
filename (str) – Path to filename under which to store the data.
- _write_RIs_to_spectra() None[source]
Write the RI values stored in the object to the spectra metadata.
- property retention_times: Iterable[RIAssigner.data.Data.Data.RetentionTimeType][source]
Get retention times in seconds.
- property retention_indices: Iterable[RIAssigner.data.Data.Data.RetentionIndexType][source]
Get retention indices.
- property comment: Iterable[RIAssigner.data.Data.Data.CommentFieldType][source]
Get comments.
- RIAssigner.data.MatchMSData.safe_read_key(spectrum: matchms.Spectrum, key: str) float[source]
Read key from spectrum and convert to float or return 0.0. Tries to read the given key from the spectrum metadata and convert it to a float. In case an exception is thrown or the key is not present, returns 0.0.
- Parameters:
spectrum – Spectrum from which to read the key.
key – Key to be read from the spectrum metadata.
- Return type:
Either the key’s value converted to float or 0.0.
- RIAssigner.data.MatchMSData._assign_ri_value(spectrum: matchms.Spectrum, key: str, value: RIAssigner.data.Data.Data.RetentionIndexType) None[source]
Assign RI value to Spectrum object
- Parameters:
spectrum (Spectrum) – Spectrum to add RI to
value (Data.RetentionIndexType) – RI to be added to Spectrum