Dear Greg.
Thank you for your advice.
I think your idea is nice!
Thank you for your time and consideration.

Takayuki





2013/6/9 Greg Landrum <greg.land...@gmail.com>

> Dear Takayuki,
>
> On Sat, Jun 8, 2013 at 10:05 AM, Taka Seri <serit...@gmail.com> wrote:
>
>>
>> I want to know how to get bond order of molecules.
>>
>> GetBondType method can get bond-type "SINGLE, DOUBLE, TRIPLE,,,," , but
>> can't get bond order.
>>
>> Are there any idea to solve it ?
>>
>
> Unfortunately, from python it's not that easy at the moment. There is a
> C++ function getBondTypeAsDouble() but it's not usable from python in
> current releases. I will add it for the next release. In the meantime, you
> would need to use something like:
>
> In [3]: bos={Chem.BondType.SINGLE:1.0,
>    ...: Chem.BondType.DOUBLE:2.0,
>    ...: Chem.BondType.TRIPLE:3.0,
>    ...: Chem.BondType.AROMATIC:1.5,
>    ...: Chem.BondType.UNSPECIFIED:0.0}
>
> In [4]: m = Chem.MolFromSmiles('Cc1ccccc1')
>
> In [5]: bos[m.GetBondWithIdx(0).GetBondType()]
> Out[5]: 1.0
>
> In [6]: bos[m.GetBondWithIdx(1).GetBondType()]
> Out[6]: 1.5
>
> Hope this helps,
> -greg
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to