On 22/03/2013 01:37, Craig James wrote:
> Am I confused, or is this just wrong?  These two SMILES should be the
> identical molecule:
>
>    c1ncccc1
>    c1[n]cccc1
>
> The first uses valence rules to deduce that there is no H on the
> nitrogen.  The second specifically says the same thing.  Both should
> thus be the identical molecule.  However...
>
>    $ echo "[n]1ccccc1" | obabel -i smi -o can
>    c1ccc[n]c1
>
>    $ echo "n1ccccc1" | obabel -i smi -o can
>    c1cccnc1
>
> If you print out the SDF, you can see the problem: the first form of the
> SMILES with the [n] is marked as a radical:
>
>     $ echo "[n]1ccccc1" | obabel -i smi -o sdf
>     ...
>     M  RAD  1   1   2
>     M  END
>     $$$$
>
> Am I missing something, or should this be filed as a bug?

I think this is a bug and it is caused by the call to 
OBAtomTyper::CorrectAromaticNitrogens() in line 259 of typer.cpp. This 
ancient function is labelled
   //! \deprecated Currently unused for anything significant.
but it erroneously changes the ImplicitValence of the [n] from 2 to 3.
Removing the call fixes the bug. I will commit this change and hope it 
doesn't mess up anything else.

Maybe a proposed simplification of the valence system 
http://forums.openbabel.org/ImplicitH-failures-td2990439.html
should be looked at again.

Chris

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to