def sitagliptin_replacement() -> GoalDirectedBenchmark: # Find a molecule dissimilar to sitagliptin, but with the same properties smiles = "Fc1cc(c(F)cc1F)CC(N)CC(=O)N3Cc2nnc(n2CC3)C(F)(F)F" sitagliptin = Chem.MolFromSmiles(smiles) target_logp = logP(sitagliptin) target_tpsa = tpsa(sitagliptin) similarity = TanimotoScoringFunction(smiles, fp_type="ECFP4", score_modifier=GaussianModifier( mu=0, sigma=0.1)) lp = RdkitScoringFunction(descriptor=logP, score_modifier=GaussianModifier(mu=target_logp, sigma=0.2)) tp = RdkitScoringFunction(descriptor=tpsa, score_modifier=GaussianModifier(mu=target_tpsa, sigma=5)) isomers = IsomerScoringFunction("C16H15F6N5O") specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark( name="Sitagliptin MPO", objective=GeometricMeanScoringFunction([similarity, lp, tp, isomers]), contribution_specification=specification, )
def score_mol(self, mol: Chem.Mol) -> float: mw = mol_weight(mol) lp = logP(mol) hbd = num_H_donors(mol) mol_tpsa = tpsa(mol) o1 = self.tpsa_mingauss(mol_tpsa) o2 = self.tpsa_maxgauss(mol_tpsa) o3 = self.hbd_gauss(hbd) o4 = self.logP_gauss(lp) o5 = self.molW_gauss(mw) return 0.2 * (o1 + o2 + o3 + o4 + o5)
def smarts_with_other_target(smarts: str, other_molecule: str) -> ScoringFunction: smarts_scoring_function = SMARTSScoringFunction(target=smarts) other_mol = Chem.MolFromSmiles(other_molecule) target_logp = logP(other_mol) target_tpsa = tpsa(other_mol) target_bertz = bertz(other_mol) lp = RdkitScoringFunction(descriptor=logP, score_modifier=GaussianModifier(mu=target_logp, sigma=0.2)) tp = RdkitScoringFunction(descriptor=tpsa, score_modifier=GaussianModifier(mu=target_tpsa, sigma=5)) bz = RdkitScoringFunction(descriptor=bertz, score_modifier=GaussianModifier(mu=target_bertz, sigma=30)) return GeometricMeanScoringFunction([smarts_scoring_function, lp, tp, bz])