pyproteonet.metrics.ratios.calculate_ratio_absolute_error
- pyproteonet.metrics.ratios.calculate_ratio_absolute_error(dataset: Dataset, molecule: str, columns: str | List[str], numerator_samples: List[str], denominator_samples: List[str], ground_truth_ratios: Series, calculate_log2_ratio: bool = False, ids: Index | None = None, is_log: bool = False) DataFrame
Calculate the absolute error between the ratios of numerator and denominator samples and a given ground truth for all possible pairs of samples.
- Parameters:
dataset (Dataset) – The dataset to calculate ratios for.
molecule (str) – The molecule type to calculate ratios for.
columns (Union[str, List[str]]) – The value column(s) to calculate ratios for.
numerator_samples (List[str]) – List of samples names to use as nominator when computing ratios.
denominator_samples (List[str]) – List of samples names to use as denominator when computing ratios.
ground_truth_ratios (pd.Series) – Ground truth ratios to compare the calculated ratios to.
calculate_log2_ratio (bool, optional) – Whether to calculate the log2 ratio instead of the ratio. Defaults to False.
ids (Optional[pd.Index], optional) – If given, only consider molecules with these ids. Defaults to None.
is_log (bool, optional) – Whether the given columns are log transformed and need to be transformed back for ratio calculation. Defaults to False.
- Returns:
The calculated absolute errors.
- Return type:
pd.DataFrame