Hello

To change properties of a molecule, it is not necessary to convert to a
RWMol. This is required only if you want to modify the structure.

molsin2[0].GetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT')
molsin2[0].SetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT', str(5))
molsin2[0].GetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT')

The statement Chem.RWMol(mol) instantiates an object that is a copy of the
original molecule.

Chem.RWMol(molsin2[0]).SetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT', str(5))

The object is created and SetProp called for this new object. After that
statement, nothing references the new RWMol object and it therefore will go
to garbage collection. Therefore corresponds to the following code

xx = Chem.RWMol(molsin2[0])
xx.SetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT', str(5))
del xx

I hope this clarifies your question.

Best

Peter



On Mon, 18 Jan 2016 at 4:24 AM chris dalton <[email protected]> wrote:

> Hi,
> I am changing the value of a property in a mol object in a SD supplier and
> I see the results below. I can only change the value of the property when I
> make an 'intermediate' variable. I don't understand why this is the case
> and is there a way I can directly change the value in the molecules in the
> supplier without doing this intermediate step?
>
> thanks
> Chris
>
> Chem.RWMol(molsin2[0]).GetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT')
> '0'
> Chem.RWMol(molsin2[0]).SetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT', str(5))
> Chem.RWMol(molsin2[0]).GetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT')
> '0'
>
> xx = Chem.RWMol(molsin2[0])
> xx.GetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT')
> '0'
> xx.SetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT', str(5))
> xx.GetProp('PUBCHEM_ATOM_DEF_STEREO_COUNT')
> '5'
>
> Chem.RWMol(molsin2[0])
> <rdkit.Chem.rdchem.RWMol object at 0x00000000061A6818>
> >>> xx
> <rdkit.Chem.rdchem.RWMol object at 0x00000000061A6728>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to