proteobench.modules.quant.benchmarking module#

Benchmarking functionality for quantification modules.

proteobench.modules.quant.benchmarking.handle_benchmarking_error(error_type: Type[Exception], error_message: str)[source]#

Decorator to handle benchmarking errors with custom error messages.

Parameters:
  • error_type (Type[Exception]) – The type of exception to catch

  • error_message (str) – The error message to raise if the exception occurs

proteobench.modules.quant.benchmarking.run_benchmarking(input_file: str, input_format: str, user_input: dict, all_datapoints: DataFrame | None, parse_settings_dir: str, module_id: str, precursor_column_name: str, default_cutoff_min_prec: int = 3, add_datapoint_func=None, input_file_secondary: str = None) Tuple[DataFrame, DataFrame, DataFrame][source]#

Run the benchmarking workflow.

Parameters:
  • input_file (str) – Path to the workflow output file.

  • input_format (str) – Format of the workflow output file.

  • user_input (dict) – User-provided parameters for plotting.

  • all_datapoints (Optional[pd.DataFrame]) – DataFrame containing all data points from the repo.

  • parse_settings_dir (str) – Directory containing parse settings.

  • module_id (str) – Module identifier for configuration.

  • precursor_column_name (str) – Name of the precursor column.

  • default_cutoff_min_prec (int, optional) – Minimum number of runs a precursor ion must be identified in. Defaults to 3.

  • add_datapoint_func (callable, optional) – Function to add the current datapoint to all datapoints. If None, the datapoint won’t be added.

  • input_file_secondary (str, optional) – Path to a secondary input file (used for some formats like AlphaDIA).

Returns:

A tuple containing the intermediate data structure, all data points, and the input DataFrame.

Return type:

Tuple[DataFrame, DataFrame, DataFrame]

proteobench.modules.quant.benchmarking.run_benchmarking_with_timing(input_file: str, input_format: str, user_input: dict, all_datapoints: DataFrame | None, parse_settings_dir: str, module_id: str, precursor_column_name: str, default_cutoff_min_prec: int = 3, add_datapoint_func=None, input_file_secondary: str = None) Tuple[DataFrame, DataFrame, DataFrame, Dict[str, float]][source]#

Run the benchmarking workflow with timing information.

Parameters:
  • input_file (str) – Path to the workflow output file.

  • input_format (str) – Format of the workflow output file.

  • user_input (dict) – User-provided parameters for plotting.

  • all_datapoints (Optional[pd.DataFrame]) – DataFrame containing all data points from the repo.

  • parse_settings_dir (str) – Directory containing parse settings.

  • module_id (str) – Module identifier for configuration.

  • precursor_column_name (str) – Name of the precursor column.

  • default_cutoff_min_prec (int, optional) – Minimum number of runs a precursor ion must be identified in. Defaults to 3.

  • add_datapoint_func (callable, optional) – Function to add the current datapoint to all datapoints. If None, the datapoint won’t be added.

  • input_file_secondary (str, optional) – Path to a secondary input file (used for some formats like AlphaDIA).

Returns:

A tuple containing the intermediate data structure, all data points, the input DataFrame, and a dictionary of timing information.

Return type:

Tuple[DataFrame, DataFrame, DataFrame, Dict[str, float]]