Discussion:
[Rdkit-discuss] How to get a list of available properties from SD file
Malitha Kabir
2017-06-27 09:26:15 UTC
Permalink
Hi,

Thank you very much in advance for kindly looking into this.
My question is in short:
Is there any method that can create a list of available properties from SD
file?

I am describing the scenario here:
You can view a sample SD file from the following github link:
https://github.com/rdkit/rdkit/blob/master/Docs/Book/data/cdk2.sdf

That file contains previously calculated properties (eg: Cluster,
MODEL.SOURCE etc.). I can read the file in RDKit using the following codes:

from rdkit.Chem.rdmolfiles import SDMolSupplier
file1='cdk2.sdf'
data=SDMolSupplier(fileName=file1, sanitize=True, removeHs=False,
strictParsing=True)

I can access the first molecule by using the following code:
m0=data[0]

Now the object m0 (rdkit Mol object) contains all the necessary information
about the molecule including properties.

I need to create a list of previously calculated properties from that file
without seeing the file visually.

Any direction is warmly appreciated. Thank you very much. Have a great day!

-Malitha
Maciek Wójcikowski
2017-06-27 09:45:39 UTC
Permalink
Hi,

There is a method GetPropsAsDict() or GetPropNames() for RDKit molecule.
http://www.rdkit.org/Python_Docs/rdkit.Chem.rdchem.Mol-class.html#GetPropsAsDict
which should do what you want.

----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Malitha Kabir
Hi,
Thank you very much in advance for kindly looking into this.
Is there any method that can create a list of available properties from SD
file?
https://github.com/rdkit/rdkit/blob/master/Docs/Book/data/cdk2.sdf
That file contains previously calculated properties (eg: Cluster,
from rdkit.Chem.rdmolfiles import SDMolSupplier
file1='cdk2.sdf'
data=SDMolSupplier(fileName=file1, sanitize=True, removeHs=False,
strictParsing=True)
m0=data[0]
Now the object m0 (rdkit Mol object) contains all the necessary
information about the molecule including properties.
I need to create a list of previously calculated properties from that file
without seeing the file visually.
Any direction is warmly appreciated. Thank you very much. Have a great day!
-Malitha
------------------------------------------------------------
------------------
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
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Malitha Kabir
2017-06-27 09:58:57 UTC
Permalink
Dear Maciek Wójcikowski,

list(m0.GetPropNames()) returned the object I need.
Thank you very much.

-Malitha
Post by Maciek Wójcikowski
Hi,
There is a method GetPropsAsDict() or GetPropNames() for RDKit molecule.
http://www.rdkit.org/Python_Docs/rdkit.Chem.rdchem.Mol-class.html#
GetPropsAsDict which should do what you want.
----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Malitha Kabir
Hi,
Thank you very much in advance for kindly looking into this.
Is there any method that can create a list of available properties from
SD file?
https://github.com/rdkit/rdkit/blob/master/Docs/Book/data/cdk2.sdf
That file contains previously calculated properties (eg: Cluster,
from rdkit.Chem.rdmolfiles import SDMolSupplier
file1='cdk2.sdf'
data=SDMolSupplier(fileName=file1, sanitize=True, removeHs=False,
strictParsing=True)
m0=data[0]
Now the object m0 (rdkit Mol object) contains all the necessary
information about the molecule including properties.
I need to create a list of previously calculated properties from that
file without seeing the file visually.
Any direction is warmly appreciated. Thank you very much. Have a great day!
-Malitha
------------------------------------------------------------
------------------
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
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Malitha Kabir
2017-06-27 10:05:47 UTC
Permalink
Dear Paolo Tosco,
Thank you very much for offering a concrete coding lesson in your previous
email. This will help me a lot. I have got all the answers.
-Malitha
Post by Malitha Kabir
Dear Maciek Wójcikowski,
list(m0.GetPropNames()) returned the object I need.
Thank you very much.
-Malitha
Post by Maciek Wójcikowski
Hi,
There is a method GetPropsAsDict() or GetPropNames() for RDKit molecule.
http://www.rdkit.org/Python_Docs/rdkit.Chem.rdchem
.Mol-class.html#GetPropsAsDict which should do what you want.
----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Malitha Kabir
Hi,
Thank you very much in advance for kindly looking into this.
Is there any method that can create a list of available properties from
SD file?
https://github.com/rdkit/rdkit/blob/master/Docs/Book/data/cdk2.sdf
That file contains previously calculated properties (eg: Cluster,
from rdkit.Chem.rdmolfiles import SDMolSupplier
file1='cdk2.sdf'
data=SDMolSupplier(fileName=file1, sanitize=True, removeHs=False,
strictParsing=True)
m0=data[0]
Now the object m0 (rdkit Mol object) contains all the necessary
information about the molecule including properties.
I need to create a list of previously calculated properties from that
file without seeing the file visually.
Any direction is warmly appreciated. Thank you very much. Have a great day!
-Malitha
------------------------------------------------------------
------------------
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
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Continue reading on narkive:
Loading...