def hard_cobimetinib(max_logP=5.0) -> GoalDirectedBenchmark: smiles = 'OC1(CN(C1)C(=O)C1=C(NC2=C(F)C=C(I)C=C2)C(F)=C(F)C=C1)C1CCCCN1' modifier = ClippedScoreModifier(upper_x=0.7) os_tf = TanimotoScoringFunction(smiles, fp_type='FCFP4', score_modifier=modifier) os_ap = TanimotoScoringFunction(smiles, fp_type='ECFP6', score_modifier=MinGaussianModifier( mu=0.75, sigma=0.1)) rot_b = RdkitScoringFunction(descriptor=num_rotatable_bonds, score_modifier=MinGaussianModifier(mu=3, sigma=1)) rings = RdkitScoringFunction(descriptor=num_aromatic_rings, score_modifier=MaxGaussianModifier(mu=3, sigma=1)) t_cns = ArithmeticMeanScoringFunction([ os_tf, os_ap, rot_b, rings, CNS_MPO_ScoringFunction(max_logP=max_logP) ]) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Cobimetinib MPO', objective=t_cns, contribution_specification=specification)
def ranolazine_mpo() -> GoalDirectedBenchmark: """ Make start_pop_ranolazine more polar and add a fluorine """ ranolazine = 'COc1ccccc1OCC(O)CN2CCN(CC(=O)Nc3c(C)cccc3C)CC2' modifier = ClippedScoreModifier(upper_x=0.7) similar_to_ranolazine = TanimotoScoringFunction(ranolazine, fp_type='AP', score_modifier=modifier) logP_under_4 = RdkitScoringFunction(descriptor=logP, score_modifier=MaxGaussianModifier( mu=7, sigma=1)) tpsa_f = RdkitScoringFunction(descriptor=tpsa, score_modifier=MaxGaussianModifier(mu=95, sigma=20)) fluorine = RdkitScoringFunction(descriptor=AtomCounter('F'), score_modifier=GaussianModifier(mu=1, sigma=1.0)) optimize_ranolazine = GeometricMeanScoringFunction( [similar_to_ranolazine, logP_under_4, fluorine, tpsa_f]) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Ranolazine MPO', objective=optimize_ranolazine, contribution_specification=specification, starting_population=[ranolazine])
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 weird_physchem() -> GoalDirectedBenchmark: min_bertz = RdkitScoringFunction(descriptor=bertz, score_modifier=MaxGaussianModifier( mu=1500, sigma=200)) mol_under_400 = RdkitScoringFunction(descriptor=mol_weight, score_modifier=MinGaussianModifier( mu=400, sigma=40)) aroma = RdkitScoringFunction(descriptor=num_aromatic_rings, score_modifier=MinGaussianModifier(mu=3, sigma=1)) fluorine = RdkitScoringFunction(descriptor=AtomCounter('F'), score_modifier=GaussianModifier(mu=6, sigma=1.0)) opt_weird = ArithmeticMeanScoringFunction( [min_bertz, mol_under_400, aroma, fluorine]) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Physchem MPO', objective=opt_weird, contribution_specification=specification)
def start_pop_ranolazine() -> GoalDirectedBenchmark: ranolazine = 'COc1ccccc1OCC(O)CN2CCN(CC(=O)Nc3c(C)cccc3C)CC2' modifier = ClippedScoreModifier(upper_x=0.7) similar_to_ranolazine = TanimotoScoringFunction(ranolazine, fp_type='AP', score_modifier=modifier) logP_under_4 = RdkitScoringFunction(descriptor=logP, score_modifier=MaxGaussianModifier( mu=7, sigma=1)) aroma = RdkitScoringFunction(descriptor=num_aromatic_rings, score_modifier=MinGaussianModifier(mu=1, sigma=1)) fluorine = RdkitScoringFunction(descriptor=AtomCounter('F'), score_modifier=GaussianModifier(mu=1, sigma=1.0)) optimize_ranolazine = ArithmeticMeanScoringFunction( [similar_to_ranolazine, logP_under_4, fluorine, aroma]) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Ranolazine MPO', objective=optimize_ranolazine, contribution_specification=specification, starting_population=[ranolazine])
def hard_fexofenadine( mean_cls=GeometricMeanScoringFunction) -> GoalDirectedBenchmark: """ make fexofenadine less greasy :return: """ smiles = 'CC(C)(C(=O)O)c1ccc(cc1)C(O)CCCN2CCC(CC2)C(O)(c3ccccc3)c4ccccc4' modifier = ClippedScoreModifier(upper_x=0.8) similar_to_fexofenadine = TanimotoScoringFunction(smiles, fp_type='AP', score_modifier=modifier) tpsa_over_90 = RdkitScoringFunction(descriptor=tpsa, score_modifier=MaxGaussianModifier( mu=90, sigma=10)) logP_under_4 = RdkitScoringFunction(descriptor=logP, score_modifier=MinGaussianModifier( mu=4, sigma=1)) optimize_fexofenadine = mean_cls( [similar_to_fexofenadine, tpsa_over_90, logP_under_4]) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Fexofenadine MPO', objective=optimize_fexofenadine, contribution_specification=specification)
def hard_osimertinib( mean_cls=GeometricMeanScoringFunction) -> GoalDirectedBenchmark: smiles = 'COc1cc(N(C)CCN(C)C)c(NC(=O)C=C)cc1Nc2nccc(n2)c3cn(C)c4ccccc34' modifier = ClippedScoreModifier(upper_x=0.8) similar_to_osimertinib = TanimotoScoringFunction(smiles, fp_type='FCFP4', score_modifier=modifier) but_not_too_similar = TanimotoScoringFunction( smiles, fp_type='ECFP6', score_modifier=MinGaussianModifier(mu=0.85, sigma=0.1)) tpsa_over_100 = RdkitScoringFunction(descriptor=tpsa, score_modifier=MaxGaussianModifier( mu=100, sigma=10)) logP_scoring = RdkitScoringFunction(descriptor=logP, score_modifier=MinGaussianModifier( mu=1, sigma=1)) make_osimertinib_great_again = mean_cls([ similar_to_osimertinib, but_not_too_similar, tpsa_over_100, logP_scoring ]) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Osimertinib MPO', objective=make_osimertinib_great_again, contribution_specification=specification)
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])
def sc_qed_benchmark() -> GoalDirectedBenchmark: specification = uniform_specification(1, 10, 100) sa_qed = ScoringFunctionSAWrapper(RdkitScoringFunction(descriptor=qed), SCScoreModifier()) return GoalDirectedBenchmark(name='SC_QED', objective=sa_qed, contribution_specification=specification)
def pioglitazone_mpo() -> GoalDirectedBenchmark: # pioglitazone with same mw but less rotatable bonds smiles = 'O=C1NC(=O)SC1Cc3ccc(OCCc2ncc(cc2)CC)cc3' pioglitazone = Chem.MolFromSmiles(smiles) target_molw = mol_weight(pioglitazone) similarity = TanimotoScoringFunction(smiles, fp_type='ECFP4', score_modifier=GaussianModifier(mu=0, sigma=0.1)) mw = RdkitScoringFunction(descriptor=mol_weight, score_modifier=GaussianModifier(mu=target_molw, sigma=10)) rb = RdkitScoringFunction(descriptor=num_rotatable_bonds, score_modifier=GaussianModifier(mu=2, sigma=0.5)) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Pioglitazone MPO', objective=GeometricMeanScoringFunction([similarity, mw, rb]), contribution_specification=specification)
def tpsa_benchmark(target: float) -> GoalDirectedBenchmark: benchmark_name = f'TPSA (target: {target})' objective = RdkitScoringFunction(descriptor=tpsa, score_modifier=GaussianModifier(mu=target, sigma=20.0)) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name=benchmark_name, objective=objective, contribution_specification=specification)
def amlodipine_rings() -> GoalDirectedBenchmark: # amlodipine with 3 rings amlodipine = TanimotoScoringFunction(r'Clc1ccccc1C2C(=C(/N/C(=C2/C(=O)OCC)COCCN)C)\C(=O)OC', fp_type='ECFP4') rings = RdkitScoringFunction(descriptor=num_rings, score_modifier=GaussianModifier(mu=3, sigma=0.5)) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Amlodipine MPO', objective=GeometricMeanScoringFunction([amlodipine, rings]), contribution_specification=specification)
def perindopril_rings() -> GoalDirectedBenchmark: # perindopril with two aromatic rings perindopril = TanimotoScoringFunction('O=C(OCC)C(NC(C(=O)N1C(C(=O)O)CC2CCCCC12)C)CCC', fp_type='ECFP4') arom_rings = RdkitScoringFunction(descriptor=num_aromatic_rings, score_modifier=GaussianModifier(mu=2, sigma=0.5)) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Perindopril MPO', objective=GeometricMeanScoringFunction([perindopril, arom_rings]), contribution_specification=specification)
def qed_benchmark() -> GoalDirectedBenchmark: specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='QED', objective=RdkitScoringFunction(descriptor=qed), contribution_specification=specification)