rdkit / RDKitjs-legacy

Obsolete codebase, please do not use.
BSD 3-Clause "New" or "Revised" License
32 stars 12 forks source link

cannot create molecule from pickle #15

Closed thegodone closed 9 years ago

thegodone commented 9 years ago

implementation of molfrompickle done but issue to convert the moltobinary back to molecule using this function. 4879a123391bb0267453975de77825d39c929e3e

we try to reproduce this python code

The RDKit pickle format is fairly compact and it is much, much faster to build a molecule from a pickle than from a Mol file or SMILES string, so storing molecules you will be working with repeatedly as pickles can be a good idea.

The raw binary data that is encapsulated in a pickle can also be directly obtained from a molecule:

binStr = m.ToBinary() This can be used to reconstruct molecules using the Chem.Mol constructor:

m2 = Chem.Mol(binStr) Chem.MolToSmiles(m2) 'c1ccncc1' len(binStr) 123 len(pkl) 475

thegodone commented 9 years ago

the issue is on Chem.Mol function

thegodone commented 9 years ago

solve commited