We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using a custom build of RDKit 2021.03 on Mac.
It looks like RDKit reactions don't preserve bond properties from the reactants. Is this intentional?
from rdkit import Chem from rdkit.Chem import rdChemReactions rxn = rdChemReactions.ReactionFromSmarts('[O:1]>>[N:1]') mol = Chem.MolFromSmiles('CCO') mol.GetAtomWithIdx(0).SetIntProp('demo', 1) reactant_bond = mol.GetBondBetweenAtoms(0, 1) reactant_bond.SetIntProp('demo', 1) product_groups = rxn.RunReactants([mol]) product = product_groups[0][0] mapping = {int(a.GetProp('react_atom_idx')): a.GetIdx() for a in product.GetAtoms()} product_bond = product.GetBondBetweenAtoms(mapping[0], mapping[1]) print(product_bond.GetPropsAsDict())
This shows no properties on the bond, and only the mapping properties on the atoms.
The text was updated successfully, but these errors were encountered:
Somebody from sdgr will fix this, as long as we agree that it is a bug.
Sorry, something went wrong.
Sorry I forgot to reply to this earlier: I agree that this is a bug.
Dibs!
In c++ land there is a function that might be useful:
void RDProps::updateProps(const RDProps &source, bool preserveExisting = false) { d_props.update(source.getDict(), preserveExisting); }
To copy properties from one thing to another ala:
new_bond.updateProps(old_bond);
Fixes #4114 (#4207)
d1574a2
* copy props for reactant/null query bonds * add test
6a92cab
ricrogz
Successfully merging a pull request may close this issue.
I'm using a custom build of RDKit 2021.03 on Mac.
It looks like RDKit reactions don't preserve bond properties from the reactants. Is this intentional?
This shows no properties on the bond, and only the mapping properties on the atoms.
The text was updated successfully, but these errors were encountered: