Base

This module contains various base classes used in the GB-BI library.

Molecule Base Class

class illumination.base.Molecule(smiles: str, pedigree: Tuple[str, str, str], fitness: float | None = None, niche_index: int | None = None, descriptor: List[float] | None = None, predicted_fitness: int = 0, predicted_uncertainty: int = 0, acquisition_value: float | None = None, sa_score: float = 0.0)[source]

Bases: object

The Molecule dataclass represents a molecule with various attributes used in optimization.

Attributes:

smiles: The SMILES string representation of the molecule. pedigree: The lineage or origin of the molecule. fitness: The fitness score of the molecule. niche_index: The index of the niche the molecule belongs to. descriptor: The list of physicochemical descriptors of the molecule. predicted_fitness: The predicted fitness score from the surrogate model. predicted_uncertainty: The uncertainty associated with the predicted fitness. acquisition_value: The value assigned by the acquisition function. sa_score: The value assigned by the synthetic accessibility estimator.

acquisition_value: float = None
descriptor: List[float] = None
fitness: float = None
niche_index: int = None
pedigree: Tuple[str, str, str]
predicted_fitness: int = 0
predicted_uncertainty: int = 0
sa_score: float = 0.0
smiles: str

Elite Base Class

class illumination.base.Elite(index: int)[source]

Bases: object

The Elite class represents a phenotypic elite molecule in the Bayesian Illumination algorithm. An elite molecule is one that has the highest fitness within its niche. The class manages the storage and update of this elite molecule.

Attributes:

index: The index of the niche that this elite belongs to. molecule: The molecule with the highest fitness in this niche. fitness: The fitness score of the elite molecule.

update(molecule: Molecule) None[source]

Updates the elite molecule if the new molecule has a higher fitness.

Args:

molecule: The new molecule to be considered as the potential elite.