Hi all,
maybe my question has been already been answered:
when converting from Mol to a canonical SMILES string,
is there a way to obtain the mapping between the atom indexes in the
Mol object and the atom indexes in the SMILES chain?
All the best,
Jean-Marc
--
Dr. Jean-Marc Nuzillard
Institu
Jean-Marc,
This is very non-obvious, but here is how you can do it from python:
>>> from rdkit import Chem
>>> m = Chem.MolFromSmiles("NCCC")
>>> Chem.MolToSmiles(m)
'CCCN'
>>> m.GetProp("_smilesAtomOutputOrder")
'[3,2,1,0,]'
Note that this returns the list as a string which is sub-optim
Hi Jean-Marc,
There is a property of the molecule created when it is read that contains
this information. I forget what it is called, but if you call the
molecule's GetPropNames function you should see something obvious in the
values returned. You can then call GetProp with that property name to
On Dec 18, 2016, at 6:32 PM, Brian Kelley wrote:
> >>> m.GetProp("_smilesAtomOutputOrder")
> '[3,2,1,0,]'
>
> Note that this returns the list as a string which is sub-optimal.
> GetPropsAsDict will convert these to proper python objects, however, this is
> considered a private member so you nee
Thank you Andrew, Brian and David for your answers.
mol.GetProp("_smilesAtomOutputOrder") does the job.
I also expected a.GetProp("molAtomMapNumber") could do it for each atom a.
All the best,
Jean-Marc
Le 18/12/2016 à 19:04, Andrew Dalke a écrit :
> On Dec 18, 2016, at 6:32 PM, Brian Kelley wr
Hi again,
When I run:
#
from rdkit import Chem
molfilename = "lactic2.sdf"
mol = Chem.SDMolSupplier(molfilename, removeHs = False)[0]
Chem.AssignStereochemistry(mol, cleanIt=False, force=False,
flagPossibleStereoCenters=True)
chiralAtoms = [a for a in mol.GetAtoms() if a.HasProp(
Dear Jean-Marc,
as lactic2.sdf is a 3D structure which does not carry any
stereochemistry information in the SDF file, you will need to perceive
stereochemistry from the 3D structure with
Chem.AssignAtomChiralTagsFromStructure(mol)
before calling Chem.AssignStereochemistry().
It looks like a
On Mon, Dec 19, 2016 at 1:00 AM, Paolo Tosco wrote:
>
> It looks like allHsExplicit=True prevents SMILES chirality specifications
> from being output:
>
In [8]: m = Chem.MolFromSmiles('C[C@H](F)(Cl)')
In [9]: Chem.MolToSmiles(m,isomericSmiles=True,allHsExplicit=True)
Out[9]: '[CH3][CH]([F])[Cl
One more piece that might help: the allHsExplicit to MolToSmiles() is there
to make sure that implicit Hs (Hs not actually in the graph) show up in the
output SMILES inside square brackets:
In [12]: m = Chem.MolFromSmiles('CC(O)(Cl)')
In [13]: Chem.MolToSmiles(m,allHsExplicit=True)
Out[13]: '[CH3
9 matches
Mail list logo