Hi Jason,

I hope the following codes will help you a little.

from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import AllChem
size = (120, 120)
m = Chem.MolFromSmiles('C#C')
m2=Chem.rdmolops.AddHs(m)
AllChem.EmbedMolecule(m2, AllChem.ETKDG())
Draw.MolToMPL(m2, size=size)

*** source code link (non specific to your question though)
https://github.com/rdkit/rdkit

Thanks. - malitha


On Fri, Dec 1, 2017 at 6:42 AM, Jason Biggs <jasondbi...@gmail.com> wrote:

>
> m = Chem.MolFromSmiles('C#C')
>
>
> renders fine
>
> [image: Inline image 1]
>
> but adding in the hydrogens, they don't snap to a linear arrangement
>
> m2=Chem.rdmolops.AddHs(m)
>
>
> [image: Inline image 3]
>
>
> This doesn't just affect acetylene, but any terminal alkyne, like
> 'c1ccc(CCC#C)cc1'.
>
> I can write a hack on my end to look for this special case, but where in
> the drawing code does it decide where to place hydrogens?
>
> Jason Biggs
>
>
> ------------------------------------------------------------
> ------------------
> 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
>
>
------------------------------------------------------------------------------
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