Greg,

I got a weird case. With the following code,

>>> from rdkit import Chem
>>> from rdkit.Chem import Descriptors
>>> m
=Chem.MolFromInchi('InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)')
>>> Descriptors.MolWt(m)
9.072
>>> em = Chem.EditableMol(m)
>>> em.RemoveBond(8,7)
>>> nm = em.GetMol()
>>> frags = Chem.GetMolFrags(nm,asMols=True)
>>> [Descriptors.MolWt(x) for x in frags]
[5.04, 6.048]

It seems the mass of the original molecule is 9.072, while the summation of
masses of its fragments is 5.04+6.048 > 9.072. I don't think it is caused
by the precision problem. Could you please let me know how to remove the
"extra" mass?

Thanks.

Yingfeng


On Fri, May 31, 2013 at 8:58 AM, Yingfeng Wang <[email protected]> wrote:

> Greg,
>
> Thank you very much.
>
> Yingfeng
>
>
> On Fri, May 31, 2013 at 4:14 AM, Greg Landrum <[email protected]>wrote:
>
>>
>> On Fri, May 31, 2013 at 7:53 AM, Yingfeng Wang <[email protected]>wrote:
>>
>>>
>>> I think I need to add masses of all atoms for getting the mass of the
>>> whole fragment. Am I right?
>>>
>>
>> It's better to just use the built in functionality:
>>
>> In [2]: m = Chem.MolFromSmiles('c1ccccc1')
>>
>> In [3]: from rdkit.Chem import Descriptors
>>
>> In [4]: Descriptors.MolWt(m)
>> Out[4]: 78.11399999999999
>>
>>  -greg
>>
>
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to