2525from poli .core .black_box_information import BlackBoxInformation
2626from poli .core .problem import Problem
2727from poli .core .abstract_problem_factory import AbstractProblemFactory
28+ from poli .core .exceptions import FoldXNotFoundException
2829
2930
3031from poli .core .util .seeding import seed_python_numpy_and_torch
@@ -44,8 +45,6 @@ class FoldXStabilityAndSASABlackBox(AbstractBlackBox):
4445 -----------
4546 wildtype_pdb_path : Union[Path, List[Path]]
4647 The path(s) to the wildtype PDB file(s).
47- alphabet : List[str], optional
48- The alphabet of amino acids. Default is None.
4948 experiment_id : str, optional
5049 The ID of the experiment. Default is None.
5150 tmp_folder : Path, optional
@@ -73,7 +72,6 @@ class FoldXStabilityAndSASABlackBox(AbstractBlackBox):
7372 def __init__ (
7473 self ,
7574 wildtype_pdb_path : Union [Path , List [Path ]],
76- alphabet : List [str ] = None ,
7775 experiment_id : str = None ,
7876 tmp_folder : Path = None ,
7977 eager_repair : bool = False ,
@@ -90,6 +88,10 @@ def __init__(
9088 num_workers = num_workers ,
9189 evaluation_budget = evaluation_budget ,
9290 )
91+ if not (Path .home () / "foldx" / "foldx" ).exists ():
92+ raise FoldXNotFoundException (
93+ "FoldX wasn't found in ~/foldx/foldx. Please install it."
94+ )
9395 if not force_isolation :
9496 try :
9597 from poli .objective_repository .foldx_stability_and_sasa .isolated_function import (
@@ -181,7 +183,6 @@ def get_setup_information(self) -> BlackBoxInformation:
181183 def create (
182184 self ,
183185 wildtype_pdb_path : Union [Path , List [Path ]],
184- alphabet : List [str ] = None ,
185186 experiment_id : str = None ,
186187 tmp_folder : Path = None ,
187188 eager_repair : bool = False ,
@@ -200,9 +201,6 @@ def create(
200201 ----------
201202 wildtype_pdb_path : Union[Path, List[Path]]
202203 Path or list of paths to the wildtype PDB files.
203- alphabet : List[str], optional
204- List of amino acid symbols. By default, we use the
205- 20 amino acids shown in poli.core.util.proteins.defaults.
206204 experiment_id : str, optional
207205 Identifier for the experiment.
208206 tmp_folder : Path, optional
@@ -261,12 +259,8 @@ def create(
261259
262260 # We use the default alphabet if None was provided.
263261 # See ENCODING in foldx_utils.py
264- if alphabet is None :
265- alphabet = self .get_setup_information ().get_alphabet ()
266-
267262 f = FoldXStabilityAndSASABlackBox (
268263 wildtype_pdb_path = wildtype_pdb_path ,
269- alphabet = alphabet ,
270264 experiment_id = experiment_id ,
271265 tmp_folder = tmp_folder ,
272266 eager_repair = eager_repair ,
0 commit comments