RIAssigner.data.Data ==================== .. py:module:: RIAssigner.data.Data Classes ------- .. autoapisummary:: RIAssigner.data.Data.Data Module Contents --------------- .. py:class:: Data(filename: str, filetype: str, rt_unit: str) Bases: :py:obj:`abc.ABC` Base class for data managers. .. py:attribute:: RetentionTimeType .. py:attribute:: RetentionIndexType .. py:attribute:: CommentFieldType .. py:attribute:: URegistry .. py:attribute:: _keys_conversions .. py:attribute:: _rt_possible_keys .. py:attribute:: _ri_possible_keys .. py:method:: is_valid(value: Union[RetentionTimeType, RetentionIndexType]) -> bool :staticmethod: Determine whether a retention time value is valid :param rt: Value to check for validity. :type rt: RetentionTimeType :returns: State of validity (True/False). :rtype: bool .. py:method:: can_be_float(rt: Union[pint.Quantity, float, int]) -> bool :staticmethod: Determine whether a value can be converted to a float. This function checks if the provided input is an instance of either Quantity, float, or int. :param rt: Value to check for float conversion. :type rt: Union[Quantity, float, int] :returns: True if the input is an instance of Quantity, float, or int, False otherwise. :rtype: bool .. py:method:: add_possible_rt_keys(keys: List[str]) -> None :classmethod: A method that adds new identifiers to get retention time information. :param keys: A list of new identifiers (keys) to be added to the `_rt_possible_keys`. :type keys: List[str] :returns: None .. py:method:: add_possible_ri_keys(keys: List[str]) -> None :classmethod: A method that adds new identifiers to get retention index information. :param keys: A list of new identifiers (keys) to be added to the `_ri_possible_keys`. :type keys: List[str] :returns: None .. py:method:: get_possible_rt_keys() -> List[str] :classmethod: A method that returns the possible keys to get retention times. :returns: A list of possible keys to get retention times. :rtype: List[str] .. py:method:: get_possible_ri_keys() -> List[str] :classmethod: A method that returns the possible keys to get retention indices. :returns: A list of possible keys to get retention indices. :rtype: List[str] .. py:attribute:: _filename .. py:attribute:: _filetype .. py:attribute:: _rt_unit .. py:attribute:: _unit .. py:method:: write(filename: str) -> None :abstractmethod: Store current content to disk. :param filename: Path to output filename. :type filename: str .. py:property:: filename :type: str Getter for filename property. :returns: Filename of originally loaded data. :rtype: str .. py:property:: retention_times :type: Iterable[RetentionTimeType] :abstractmethod: Getter for `retention_times` property. :returns: RT values contained in data. :rtype: Iterable[RetentionTimeType] .. py:property:: retention_indices :type: Iterable[RetentionIndexType] :abstractmethod: Getter for `retention_indices` property. :returns: RI values stored in data. :rtype: Iterable[RetentionIndexType] .. py:method:: has_retention_indices() -> bool Check if all retention indices in the spectra exist. This method iterates over the retention indices in the spectra. If it encounters a value that is None, it immediately returns False. If it iterates over all retention indices without finding a None value, it returns True. :returns: True if all retention indices exist, False otherwise. :rtype: bool .. py:method:: has_retention_times() -> bool Check if all retention times in the spectra exist. This method iterates over the retention times in the spectra. If it encounters a value that is None, it immediately returns False. If it iterates over all retention times without finding a None value, it returns True. :returns: True if all retention times exist, False otherwise. :rtype: bool .. py:property:: comment :type: Iterable[CommentFieldType] :abstractmethod: Getter for `comment` property. :returns: Comment field values stored in data. :rtype: Iterable[CommentFieldType] .. py:method:: init_ri_from_comment(ri_source: str) -> None Extract RI from comment field. Extracts the RI from the comment field of the data file. The RI is expected to be in the format 'ri_source=RI_value'. The function extracts the RI value and sets it on the retention_index property. :param content_comment: Comment field of the data file. :param ri_source: String that is expected to be in the comment field before the RI value.