RIAssigner.data.MatchMSData =========================== .. py:module:: RIAssigner.data.MatchMSData Classes ------- .. autoapisummary:: RIAssigner.data.MatchMSData.MatchMSData Functions --------- .. autoapisummary:: RIAssigner.data.MatchMSData.safe_read_key RIAssigner.data.MatchMSData._assign_ri_value Module Contents --------------- .. py:class:: MatchMSData(filename: str, filetype: str, rt_unit: str) Bases: :py:obj:`RIAssigner.data.Data.Data` Class to handle data from filetypes which can be imported using 'matchms'. .. py:method:: _read() Load data into object and initialize properties. .. py:method:: write(filename: str) -> None Write data to back to the spectra file :param filename: Path to filename under which to store the data. :type filename: str .. py:method:: _write_RIs_to_spectra() -> None Write the RI values stored in the object to the spectra metadata. .. py:method:: _read_retention_times() -> None Read retention times from spectrum metadata. .. py:method:: _read_retention_indices() -> None Read retention indices from spectrum metadata. .. py:method:: _sort_spectra_by_rt() -> None Sort objects (peaks) in spectra list by their retention times. .. py:method:: __eq__(o: object) -> bool Comparison operator `==`. :param o: Object to compare with. :type o: object :returns: State of equality. :rtype: bool .. py:property:: retention_times :type: Iterable[RIAssigner.data.Data.Data.RetentionTimeType] Get retention times in seconds. .. py:property:: retention_indices :type: Iterable[RIAssigner.data.Data.Data.RetentionIndexType] Get retention indices. .. py:property:: comment :type: Iterable[RIAssigner.data.Data.Data.CommentFieldType] Get comments. .. py:property:: spectra_metadata :type: Tuple[numpy.array, List[str]] .. py:function:: safe_read_key(spectrum: matchms.Spectrum, key: str) -> float 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. :param spectrum: Spectrum from which to read the key. :param key: Key to be read from the spectrum metadata. :rtype: Either the key's value converted to float or 0.0. .. py:function:: _assign_ri_value(spectrum: matchms.Spectrum, key: str, value: RIAssigner.data.Data.Data.RetentionIndexType) -> None Assign RI value to Spectrum object :param spectrum: Spectrum to add RI to :type spectrum: Spectrum :param value: RI to be added to Spectrum :type value: Data.RetentionIndexType