On 2013-11-07 10:43, Noel O'Boyle wrote:
> AFAIK, all OBMol's are self-consistent.
>

Note that we checked a test series of about 2000 molecules for the bond 
orders generated by OB (by looking at the screen in Avogadro). 
Approximately 10% was incorrect (I have a list). Someone said a new 
algorithm for generating BO was being implemented, but I haven't seen an 
update on this.

> I'm guessing this is not the answer you are looking for. Perhaps the
> following is (taken from my notes at
> https://gist.github.com/baoilleach/4232459):
>
> """
> In the Open Babel world, the "valence" methods of an atom refer to the
> number of bonds, rather than the sum of BOs (which is actual valence).
>
> GetValence() -> Num explicit bonds
> GetImplicitValence() -> Num explicit bonds plus num implicit bonds
> (i.e. total number of bonds) (_impval property on OBAtom)
> GetHvyAtomValence() -> Num explicit bonds to non-H atoms
>
> To find the number of implicit Hs, GetImplicitValence() - GetValence()
>
> BOSum() -> The sum of the BOs of explicit bonds (otherwise known as
> ExplicitValence)
>
> To find the actual valence: BOSum() + GetImplicitHydrogenCount()
> """
>
> - Noel
>
> On 7 November 2013 09:23, Rafel Israels <rafelisra...@googlemail.com> wrote:
>> Hello,
>>
>> what would be the correct method to check the consistency of bonds in a
>> molecule ?
>>
>> My first try (below) is wrong: e.g. Aspirin fails this test and if I
>> understand correctly the reason seems that I compare total number of bonds
>> (i.e. counting double bonds twice) with maximum/expected number of
>> neighbors, which (for me unexpected but probably correct) considers
>> hybridization and equals 3 for SP2-carbons ?
>>
>> Is there something like atom->GetImplicitBOSum() and/or what would be the
>> correct implementation to check basic chemistry rules ?
>>
>> regards,
>>
>> Rafel
>>
>>
>>    FOR_ATOMS_OF_MOL(atom, obMol)
>>      if (atom->BOSum() > atom->GetImplicitValence())
>>        return false;
>>    return true;
>>
>>
>>
>> ------------------------------------------------------------------------------
>> November Webinars for C, C++, Fortran Developers
>> Accelerate application performance with scalable programming models. Explore
>> techniques for threading, error checking, porting, and tuning. Get the most
>> from the latest Intel processors and coprocessors. See abstracts and
>> register
>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205.
sp...@xray.bmc.uu.se    http://folding.bmc.uu.se

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to