poli.objective_repository.foldx_stability.register.FoldXStabilityBlackBox

poli.objective_repository.foldx_stability.register.FoldXStabilityBlackBox#

class poli.objective_repository.foldx_stability.register.FoldXStabilityBlackBox(wildtype_pdb_path: Union[Path, List[Path]], experiment_id: Optional[str] = None, tmp_folder: Optional[Path] = None, eager_repair: bool = False, verbose: bool = False, batch_size: int = 1, parallelize: bool = False, num_workers: Optional[int] = None, evaluation_budget: int = inf, force_isolation: bool = False)#

A black box implementation for evaluating the stability of protein structures using FoldX.

Parameters
  • wildtype_pdb_path (Union[Path, List[Path]]) – The path(s) to the wildtype PDB file(s).

  • experiment_id (str, optional) – The ID of the experiment (default is None).

  • tmp_folder (Path, optional) – The path to the temporary folder (default is None).

  • eager_repair (bool, optional) – Whether to eagerly repair the protein structures (default is False).

  • verbose (bool, optional) – Whether to print the output from FoldX (default is False).

  • batch_size (int, optional) – The batch size for parallel processing (default is None).

  • parallelize (bool, optional) – Whether to parallelize the computation (default is False).

  • num_workers (int, optional) – The number of workers for parallel processing (default is None).

  • evaluation_budget (int, optional) – The maximum number of function evaluations. Default is infinity.

_black_box(x, context)#

Runs the given input x and pdb files provided in the context through FoldX and returns the total stability score.

Notes

We expect the user to have FoldX v5.0 installed and compiled. More specifically, we expect a binary file called foldx to be in the path ~/foldx/foldx.

__init__(wildtype_pdb_path: Union[Path, List[Path]], experiment_id: Optional[str] = None, tmp_folder: Optional[Path] = None, eager_repair: bool = False, verbose: bool = False, batch_size: int = 1, parallelize: bool = False, num_workers: Optional[int] = None, evaluation_budget: int = inf, force_isolation: bool = False)#

Initialize the AbstractBlackBox object.

Parameters
  • batch_size (int, optional) – The batch size for parallel execution, by default None.

  • parallelize (bool, optional) – Flag indicating whether to parallelize the execution, by default False.

  • num_workers (int, optional) – The number of workers for parallel execution, by default we use half the available CPUs.

  • evaluation_budget (int, optional) – The maximum number of evaluations allowed for the black box function, by default float(“inf”).

Methods

__init__(wildtype_pdb_path[, experiment_id, ...])

Initialize the AbstractBlackBox object.

reset_evaluation_budget()

Resets the evaluation budget by setting the number of evaluations made to 0.

set_observer(observer)

Set the observer object for recording observations during evaluation.

terminate()

Terminate the black box optimization problem.