I just checked in the bug fix. Here's the new behavior:

In [2]: mol = Chem.MolFromSmiles('N1C=CC=C1')
In [3]: Chem.Kekulize(mol,clearAromaticFlags=True)
In [4]:  tempMol = Chem.EditableMol(mol)
In [5]: idx = tempMol.AddAtom(Chem.Atom(0))
In [6]: tempMol.AddBond(idx,0,Chem.BondType.SINGLE)
Out[6]: 6
In [7]: nm = tempMol.GetMol()
In [8]: print Chem.MolToSmiles(nm)
[*]N1C=CC=C1

-greg



On Tue, Oct 29, 2013 at 5:56 PM, Nicholas Firth <[email protected]>wrote:

> Cheers Greg. I will clean up the mess manually for the time being and
> update the code if needs be.
>
> Best,
> Nick
>
> *Nicholas C. Firth* | PhD Student | Cancer Therapeutics****
>  The Institute of Cancer Research | 15 Cotswold Road | Belmont | Sutton |
> Surrey | SM2 5NG****
>
> *T* 020 8722 4033 | *E* [email protected] | *W* www.icr.ac.uk | *
> Twitter* @ICRnews <https://twitter.com/ICRnews>****
>
> *Facebook* www.facebook.com/theinstituteofcancerresearch****
>
> *Making the discoveries that defeat cancer*
>
>
> On 29 Oct 2013, at 04:19, Greg Landrum <[email protected]> wrote:
>
> There was a typo in my earlier message.
>
> The last example I intended to send was:
> >>> mol = Chem.MolFromSmiles('N1C=CC=C1')
> >>> Chem.Kekulize(mol,clearAromaticFlags=True)
> >>> for atom in mol.GetAtoms():
>      if atom.GetAtomicNum() in (7,15,16) and atom.GetNumExplicitHs()==1:
>         atom.SetNumExplicitHs(0)
> ...
> >>> tempMol = Chem.EditableMol(mol)
> >>> idx = tempMol.AddAtom(Chem.Atom(0))
> >>> tempMol.AddBond(idx,0,Chem.BondType.SINGLE)
> 6
> >>> nm = tempMol.GetMol()
> >>> print Chem.MolToSmiles(nm)
> [*]N1C=CC=C1
>
> The earlier message included a spurious "sanitize=False" argument to the
> Chem.MolFromSmiles() call.
>
> -greg
>
>
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
> 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addressee only. If
> the message is received by anyone other than the addressee, please return
> the message to the sender by replying to it and then delete the message
> from your computer and network.
>

<<image001.gif>>

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to