Thanks for making this work accessible. When I've tried to use this code, I sometimes run into issues during desp.search.
File "script.py", line 23, in <module> result, route, searcher = desp.search( File ".../desp/desp/desp/DESP.py", line 135, in search result = searcher.run_search()
File ".../desp/desp/search/desp_search.py", line 231, in run_search _ = self.expand_fwd(best_node, self.search_graph)
File ".../desp/desp/search/desp_search.py", line 119, in expand_fwd predictions = self.fwd_model.predict(
File ".../desp/desp/inference/forward_predictor.py", line 171, in predict output = run_bimolecular_reaction(
File ".../desp/desp/inference/utils.py", line 149, in run_bimolecular_reaction reactants = rdchiralReactants(".".join(reactants))
File ".../desp-env/lib/python3.10/site-packages/rdchiral/initialization.py", line 101, in __init__ self.reactants = initialize_reactants_from_smiles(reactant_smiles)
File ".../desp-env/lib/python3.10/site-packages/rdchiral/initialization.py", line 181, in initialize_reactants_from_smiles
Chem.AssignStereochemistry(reactants, flagPossibleStereoCenters=True)
Boost.Python.ArgumentError: Python argument types in rdkit.Chem.rdmolops.AssignStereochemistry(NoneType) did not match
C++ signature: AssignStereochemistry(RDKit::ROMol {lvalue} mol, bool cleanIt=False, bool force=False, bool flagPossibleStereoCenters=False)
I believe the cause is that a small number of the SMILES keys in canon_building_block_mol2idx_no_isotope.json are invalid, making Chem.MolFromSmiles and similar functions return None.
['[IH2-2]',
'CCN(CC)c1ccc2c(-c3ccccc3C(=O)NCCCC(NC(=O)COCCOCCN)C(=O)OC(C)(C)C)c3ccc(=[N+2](CC)CC)cc-3oc2c1',
'F[P+](F)(F)(F)(F)F',
'CCc1nc(SCC(=O)NC2C(=O)N(c3ccccc3)[N+2](C)=C2C)[nH]c(=O)c1C#N',
'COc1ccc(Nc2nc(N/N=C/C3=[C+]4=CC=CC=[C+]4=C[C+]4=CC=CC=[C+]=43)nc(Nc3ccccc3)n2)cc1',
'O=C1NC2=[N+2](C=C(c3ccccc3)S2)c2sc3c(c21)CCCC3',
'F[B-2](F)(F)C[NH+]1CCCCC1',
'CCOC(=O)C1=C(CSC2=[N+2](C)C=CN2)NC(=O)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@H](O)C[C@@H](O)CC(=O)O',
'F[P](F)(F)(F)(F)F',
'N#CCC[B-2](F)(F)F',
'F[B-2](F)(F)CCCc1ccccc1',
'Cc1ccc(S(=O)(=O)NC[B-2](F)(F)F)cc1',
'CC(C)(C)OC(=O)NC[B-3](F)(F)F',
'Fc1ccc([B-2](F)(F)F)cc1',
'CC(C)(C)OC(=O)N1CCC(OC[B-2](F)(F)F)CC1',
'CC1=[N+2](C)N(c2ccccc2)C(=O)C1NC(=O)Cn1nnc2sc3c(c2c1=O)CCCC3',
'O=C(Nc1ccccn1)[N+2]1=NNc2ccccc21',
'O[C@@H]1C[C@H]2CC[C@@H](C1)[C+]21CCCC1',
'Oc1ccc([B-2](F)(F)F)cc1',
'Cc1ccc([N-]C(=O)[C@H]2CCC[N+5]2Cc2ccccc2)c(/C(=[N+5]/CC(=O)[O-])c2ccccc2)c1']
I don't know if these were incorrectly constructed or if something else went wrong during the preprocessing.
Thanks for making this work accessible. When I've tried to use this code, I sometimes run into issues during
desp.search.I believe the cause is that a small number of the SMILES keys in
canon_building_block_mol2idx_no_isotope.jsonare invalid, makingChem.MolFromSmilesand similar functions returnNone.I don't know if these were incorrectly constructed or if something else went wrong during the preprocessing.