Hi there RDKitters,
I have an rdkit enabled database - with a table which contains a "mol"
column (called rdkitmol).
I am using the python database driver psycopg2 to access this table from a
python program.
My question is: Is there a way how to use the "mol" object in the DB as an
rdkit mol in python directly?
I was thinking I could do something like:
cur.execute("SELECT rdkitmol FROM molecule LIMIT 5;")
> for t in cur:
> print t[0]
> print Descriptors.MolWt(t[0])
But this doesn't work as t[0] is not of the correct type (i.e.
rdkit.Chem.rdchem.Mol).
Of course, I could use the rdkitmol smiles to create an
rdkit.Chem.rdchem.Mol instance in python (e.g. Chem.MolFromSmiles) but I
was wondering if there was a more efficient way to do this as presumably
the "mol" column stores an instance of the rdkit.Chem.rdchem.Mol already.
Or am I off? Can someone elucidate on the underlying datatype?
Hope you had a good holiday Greg!
Thanks,
-
Jean-Paul Ebejer
Early Stage Researcher
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss