Hi,

Python is case sensitive, you need to do:
m.SetProp("TRPM4IC50", bb)

I hope this helps,
-greg


On Fri, Apr 7, 2017 at 2:30 AM, François-Régis Chalaoux <
chalaou...@gmail.com> wrote:

> Hi,
>
> when I try to set a new property, existing or not, in an Mol objet I got
> the following message:
>
> I Use rdkit through myChembl.
> rdBase.rdkitVersion
>
> '2015.03.1'
>
>
> ------------------------------
> ma = []
> for m in mols:
>     if m.HasProp("Notebook"):
>         evoid = m.GetProp("Notebook")
>         print evoid
>         print "-------------"
>     if m.HasProp("TRPM4IC50"):
>         b = m.GetProp("TRPM4IC50")
>         bb = b.replace(',','.')
>         Chem.m.setProp("TRPM4IC50", bb)
>         try:
>             if float(bb) < 10:
>                 ma.append(m)
>         except ValueError:
>             print "Could not convert data to an integer."
>
> w = Chem.SDWriter('serie1/serie1_actifs.sdf')
> for j in ma: w.write(j)
>
>
> EV-AR8099-020
> -------------
>
> ---------------------------------------------------------------------------AttributeError
>                             Traceback (most recent call 
> last)<ipython-input-122-e906ae9d4c90> in <module>()      8         b = 
> m.GetProp("TRPM4IC50")      9         bb = b.replace(',','.')---> 10         
> Chem.rdchem.Mol.setProp("TRPM4IC50", bb)     11         try:     12           
>   if float(bb) < 10:
> AttributeError: type object 'Mol' has no attribute 'setProp'
>
> ----------------------------
>
>
> What is the solution to set a property ?
>
> Cheers, FRC.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to