Hi Markus,

On Thu, Feb 23, 2017 at 1:41 AM, Markus Metz <metm...@gmail.com> wrote:

>
> According to the example it is possible to use the option
> labelByIndex=True in ReplaceCore.
> Converting the sidechains from mol to smiles with isomericSmiles=True
> labels the sidechains with 1 and 5.
> Where do these numbers come from?
>

They are the indices of the atoms in the core.


> I included the atom indices in the mol drawing but the core atoms are 1
> and 8. (please see attached jupyter file). What am I missing?
>

The code where you assign the atom map numbers so that you can see the
indices:


matches = m1.GetSubstructMatch(core)
print(matches)

for i, atom_idx in enumerate(matches, 1):
    m1.GetAtomWithIdx(atom_idx).SetProp('molAtomMapNumber', str(atom_idx))


is using the indices in m1. You want the indices in the core:


for i, atom_idx in enumerate(matches, 1):
    m1.GetAtomWithIdx(atom_idx).SetProp('molAtomMapNumber', str(i))


(Note: you can also do SetIntProp() and skip the conversion of i to a
string).

Best,
-greg
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to