pgfinder.validation =================== .. py:module:: pgfinder.validation .. autoapi-nested-parse:: Functions for validation of data. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: pgfinder.validation.LOGGER Functions --------- .. autoapisummary:: pgfinder.validation.allowed_modifications pgfinder.validation.validate_raw_data_df pgfinder.validation.validate_theo_masses_df pgfinder.validation.validate_rt_window pgfinder.validation.validate_enabled_mod_list pgfinder.validation.validate_user_ppm Module Contents --------------- .. py:data:: LOGGER .. py:function:: allowed_modifications(config_file: str | pathlib.Path = 'config/allowed_modifications.txt') -> list Loads allowable modifications from a csv file as a list. :param config_file: Path to a configuration file. Default 'config/allowed_modifications.txt' :type config_file: str | Path :returns: List of permissible modifications. :rtype: list .. !! processed by numpydoc !! .. py:function:: validate_raw_data_df(raw_data_df: pandas.DataFrame, columns: dict = COLUMNS['pgfinder']) -> None | ValueError Validate that the raw data is a Pandas Dataframe with specific column names and that it has attributes. :param raw_data_df: Data frame to be validated. :type raw_data_df: pd.DataFrame :returns: Error specific to the problem encountered with the data frame if any are encountered. :rtype: None | ValueError :raises ValueError: .. !! processed by numpydoc !! .. py:function:: validate_theo_masses_df(theo_masses_df: pandas.DataFrame) -> None | ValueError Validate that the theoretical masses data is a Pandas Dataframe with specific column names and that it has attributes. :param raw_data_df: Data frame to be validated. :type raw_data_df: pd.DataFrame :returns: Error specific to the problem encountered with the data frame if any are encountered. :rtype: None | ValueError :raises ValueError: .. !! processed by numpydoc !! .. py:function:: validate_rt_window(rt_window: float) -> None | ValueError Validate that rt_window is an float. :param rt_window: Value of rt_window to be validated. :type rt_window: int :returns: If no error nothing is returned, otherwise a ValueError is raised. :rtype: None | ValueError :raises ValueError: .. !! processed by numpydoc !! .. py:function:: validate_enabled_mod_list(enabled_mod_list: list) -> None | ValueError Validate that enabled_mod_list is a list and modifications are allowed. :param enabled_mod_list: Value of enabled_mod_list to be validated. :type enabled_mod_list: int :returns: If no error nothing is returned, otherwise a ValueError is raised. :rtype: None | ValueError :raises ValueError: .. !! processed by numpydoc !! .. py:function:: validate_user_ppm(user_ppm: int) -> None | ValueError Validate that user_ppm is an integer. :param user_ppm: Value of user_ppm to be validated. :type user_ppm: int :returns: If no error nothing is returned, otherwise a ValueError is raised. :rtype: None | ValueError :raises ValueError: .. !! processed by numpydoc !!