Hello,
It doesn't look like user-set properties are copied through with explicitly
mapped atoms in chemical reactions, although implicitly copied atoms do
have their properties transfered. (See example session below.)
Is this the intended behavior? If I were to want all mappable atoms
(implicit & explicit) to have particular properties transfered across the
reaction, how best would I go about doing so (specifically on the C++
level)?
Thanks,
-Rocco
--
from rdkit import Chem
from rdkit.Chem import AllChem
def print_arb_prop(mollist):
for m in range(len(mollist)):
for a in range(mollist[m].GetNumAtoms()):
atom = mollist[m].GetAtomWithIdx(a)
if atom.HasProp("arb_prop"):
print m, a, atom.GetSymbol(), atom.GetIntProp("arb_prop")
mol = Chem.MolFromSmiles("ClCNOCBr")
for a in range(mol.GetNumAtoms()):
mol.GetAtomWithIdx(a).SetIntProp("arb_prop", a*-2 )
print_arb_prop( [mol] )
# 0 0 Cl 0
# 0 1 C -2
# 0 2 N -4
# 0 3 O -6
# 0 4 C -8
# 0 5 Br -10
rxn1 = AllChem.ReactionFromSmarts('[N:3][O:4]>>[N:3].[O:4]')
print_arb_prop( rxn1.RunReactants([mol])[0] )
# 0 1 C -2
# 0 2 Cl 0
# 1 1 C -8
# 1 2 Br -10
rxn2 =
AllChem.ReactionFromSmarts('[Cl:1][C:2][N:3][O:4][C:5]>>[Cl:1][C:2][N:3].[O:4][C:5]')
print_arb_prop( rxn2.RunReactants([mol])[0] )
# 1 2 Br -10
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss