Dear Shaozhen,
You may try:
from rdkit.Chem import AllChem
from rdkit import Chem
m1 = Chem.MolFromSmarts('[*:1]-[C;H0;+0:2](-[*:3])=[O;H0;+0:4]')
AllChem.Compute2DCoords(m1)
m1.UpdatePropertyCache()
fp1 = AllChem.GetMorganFingerprint(m1,2)
print (fp1)
I hope this works for you.
Best regards,
Omar
On Tue, May 12, 2020 at 1:34 PM 丁邵珍 <[email protected]> wrote:
> Dear Developers:
> I want to calculate the Morgan Fingerprint of a molecule smart, so I ran
> the code shown below.
>
> from rdkit.Chem import AllChem
> from rdkit import Chem
> m1 = Chem.MolFromSmarts('[*:1]-[C;H0;+0:2](-[*:3])=[O;H0;+0:4]')
> print (m1)
> fp1 = AllChem.GetMorganFingerprint(m1,2)
> print (fp1)
>
> However, it raised error.
> Could you help me to solve this issue?
> The version of rdkit installed in my computer is 2019.03.01.
>
> Thanks a lot
> Best wishes.
> shaozhen
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss