Hi there,
I want to store some RD Molecule objects in an arbitrary database along
with some other arrays, numbers ect. Now I looked at the DBase Folders
as well as the DB command line tools in the DbCLI Project, but I just
don't get an overview, so here's the question:
I have the plenty of database Modules and SQL based servers installed
(not fixed to one particular as I will have to learn them anyway :-) )
and what I now want to do is simply store a RD Mol (precisely: a
PropertyMol, Greg) object in a column.
What I tried:
''''''''''''''''''''''''''''''''''''''''
#!/usr/bin/python
from rdkit import Chem
import sys,time
import pg
import cPickle
from Chem.PropertyMol import *
dbname='mydb'
tablename='test2'
db=pg.DB(dbname)
mol=Chem.MolFromSmiles('CC(O)CCCN')
pkl=cPickle.dumps(mol)
test={}
test['mol']=pkl
db.insert('test2', test)
''''''''''''''''''''''''''''''''''''''''''''''
The error I get complains about the special characters
in the pickled Mol :-(
Storing the binString didn't work either.
Which dattatype does work?
Second Trial:
Using the RDKit DbCLI modules directly, but how?
Didn't get it working
Any help/explanation/pointers would be fine
Cheers, Markus
PS:
I also tried to use the shelve module and use the smiles as key and the
mol as value -> no Problem.