Re: [Rdkit-discuss] SetProp question
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Axel P. <axe...@gm...> - 2017-04-07 09:53:00
|
It is "SetProp" with a capital "S".
Kind regards,
Axel
On 07.04.2017 11:30, François-Régis Chalaoux 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(',','.')--->
> 10Chem.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
> Rdk...@li...
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
|