An oracle is an authoritative mechanism that turns an unlabeled data point into an accurate label, at a cost in human time, computation, or money. In drug discovery, AutoDock Vina acts as the oracle: it docks a molecule and returns a docking score. Because docking every compound in a huge library is impractical, active learning uses oracle calls selectively. section 9.2.6 section 9.2.7
A proxy oracle can speed up development by returning scores from compounds that have already been docked. Once strategies are tested, replace the proxy with real docking calls; the active-learning framework stays the same. A deterministic proxy also supports reproducible benchmarking. section 9.2.6
Listing 9.9 Defining the Oracle
def vina_oracle( #A
smiles_list, #B
box, #C
receptor_file, #D
num_poses=5, **kwargs):
params = Chem.SmilesParserParams()
params.removeHs = False
scores = []
for smiles in smiles_list:
mol = Chem.MolFromSmiles(smiles, params)
mol = Chem.AddHs(mol)
has_3d = False
try: has_3d = mol.GetConformer().Is3D()
except: has_3d = False
if not has_3d:
AllChem.EmbedMolecule(mol, randomSeed=42)
AllChem.MMFFOptimizeMolecule(mol)
docking_program = VinaDocking(
receptor_file, box, num_poses=num_poses
)
score = docking_program.dock_mol(mol) #E
scores.append(score)
return scores
def deepdock_oracle(smiles_list, **kwargs): #F
score_column = kwargs.get("score_column", "r_i_docking_score")
score_lookup = (
reference_df
.drop_duplicates(subset="SMILES", keep="first")
.set_index("SMILES")[score_column]
)
missing_smiles = [
smiles for smiles in smiles_list
if smiles not in score_lookup.index
]
if missing_smiles:
raise KeyError(f"{len(missing_smiles)} SMILES not found.")
return score_lookup.loc[smiles_list].to_numpy(dtype=float)The listing shows a Vina oracle that prepares molecules and returns docking scores, alongside a proxy-oracle interface. section 9.2.6

