Hi,
The pickling is due to Python way of serialising objects.
For example, in a user created object there is a way to define what
information and actions should be run during serialisation and
de-serialisation by overriding the __setstate__() and __getstate__()
functions of the object.
This is a common problem with Python especially if you are dealing with the
various parallel computation packages, that exchange messages across python
processes via pickled messages.
Regards,
Christos
Christos Kannas
Researcher
Ph.D Student
Mob (UK): +44 (0) 7447700937
Mob (Cyprus): +357 99530608
[image: View Christos Kannas's profile on LinkedIn]
<http://cy.linkedin.com/in/christoskannas>
On 12 March 2015 at 16:13, Matthew Lardy <[email protected]> wrote:
> Hi Christos,
>
> Thanks, presently I iterate over all of the tags and copy them over.
> That's really ugly and is identical to your suggestion. I was hopeful that
> there was a more elegant way of doing things but I guess not. The pickling
> thing really caught me by surprise. I can't tell you how many hours I
> burned until I realized that was the problem.
>
> Thanks for the quick response!
> Matthew
>
>
> On Thu, Mar 12, 2015 at 8:46 AM, Christos Kannas <[email protected]>
> wrote:
>
>> Hi Mathew,
>>
>> In order to store the tags and the data associated with them prior to
>> writing the molecule to SDF/SMILES file you have to use SetProps(props)
>> e.g. outfile.SetProps(props), where props is a list of the tags names your
>> molecules have.
>>
>> In regards to when you pickle molecules you loose that extra
>> information,you can convert your molecules to PropertyMol, e.g. from
>> rdkit.Chem.PropertyMol import PropertyMol pmol = PropertyMol(mol)
>>
>> Hope the information above helps a bit.
>>
>> Regards,
>>
>> Christos
>>
>> Christos Kannas
>>
>> Researcher
>> Ph.D Student
>>
>> [image: View Christos Kannas's profile on LinkedIn]
>> <http://cy.linkedin.com/in/christoskannas>
>>
>> On 12 March 2015 at 15:33, Matthew Lardy <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I've noticed some strangeness between the Java and Python wrappers that
>>> I have spent some time battling. If I load a SD file, via the
>>> SDMolSupplier and then write out the file with SDWriter I lose all of the
>>> tags for the molecules. Also if I pickle an SD file, reload it and then
>>> iterate over it the tags are missing again. Is this the expected
>>> behaviour, or I am doing something wrong?
>>>
>>> Thanks in advance!
>>> Matthew
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Dive into the World of Parallel Programming The Go Parallel Website,
>>> sponsored
>>> by Intel and developed in partnership with Slashdot Media, is your hub
>>> for all
>>> things parallel software development, from weekly thought leadership
>>> blogs to
>>> news, videos, case studies, tutorials and more. Take a look and join the
>>> conversation now. http://goparallel.sourceforge.net/
>>> _______________________________________________
>>> Rdkit-discuss mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>>
>>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss