You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use the retrosynthetic notebook and I managed to get everything except the "apply_template" where I got the following error:
NameError Traceback (most recent call last) in <cell line: 2>()
1 prod_1 = rxn_example.split('>>')[1]
----> 2 pred_reactants = apply_template(tplt_example, prod_1)
3
4 # This is the result of applying the template.
5 visualize_mols(pred_reactants[0])
/content/utils.py in apply_template(tmplt, reacts)
47
48 def apply_template(tmplt, reacts):
---> 49 rxn = rdChemReactions.ReactionFromSmarts(tmplt)
50 reactants = [Chem.MolFromSmiles(x) for x in reacts.split('.')]
51 products = rxn.RunReactants(reactants)
NameError: name 'rdChemReactions' is not defined
in the utils.py the function is the following:
def apply_template(tmplt, reacts):
rxn = rdChemReactions.ReactionFromSmarts(tmplt)
reactants = [Chem.MolFromSmiles(x) for x in reacts.split('.')]
products = rxn.RunReactants(reactants)
return products
the rdChemReactions is properly imported I think (I tried manually/separated as well) but what I am able to run it properly only if the input is something like this "'C:1O.[N:3]>>C:1[N:3]'" not the product of the previous function.
Hi,
I try to use the retrosynthetic notebook and I managed to get everything except the "apply_template" where I got the following error:
NameError Traceback (most recent call last)
in <cell line: 2>()
1 prod_1 = rxn_example.split('>>')[1]
----> 2 pred_reactants = apply_template(tplt_example, prod_1)
3
4 # This is the result of applying the template.
5 visualize_mols(pred_reactants[0])
/content/utils.py in apply_template(tmplt, reacts)
47
48 def apply_template(tmplt, reacts):
---> 49 rxn = rdChemReactions.ReactionFromSmarts(tmplt)
50 reactants = [Chem.MolFromSmiles(x) for x in reacts.split('.')]
51 products = rxn.RunReactants(reactants)
NameError: name 'rdChemReactions' is not defined
in the utils.py the function is the following:
def apply_template(tmplt, reacts):
rxn = rdChemReactions.ReactionFromSmarts(tmplt)
reactants = [Chem.MolFromSmiles(x) for x in reacts.split('.')]
products = rxn.RunReactants(reactants)
return products
the rdChemReactions is properly imported I think (I tried manually/separated as well) but what I am able to run it properly only if the input is something like this "'C:1O.[N:3]>>C:1[N:3]'" not the product of the previous function.
https://www.rdkit.org/docs/source/rdkit.Chem.rdChemReactions.html
The notebook is amazing and I am looking forward to use it.
Thanks
The text was updated successfully, but these errors were encountered: