|
From: Tim V. <tim...@gm...> - 2009-03-13 14:24:09
|
Hi, On Fri, Mar 13, 2009 at 9:25 AM, <ern...@ba...> wrote: > Hello, > >>what would be the preferred method of serializing an OBMol object into > memory? > >>Endianness et al. is not an issue, but the whole data structure should be > saved. > >>I assume that instead of storing e.g. a SMILES string and building the > OBMol every time it's needed from that string, reading a readymade OBMol > into memory is faster...? > > maybe I shall clarify my question. :-) > > I filter many matches of OBMols through a SMARTS pattern in PostgreSQL. > Within PostgreSQL, every time a function is called - per table row - it > forgets all that was before. So I have to parse the OBMol _every row_ and > instantiate the SMARTS Pattern _every row_. > > For the SMARTS pattern, there might be a solution of saving a pointer to > in shared memory between calls to avoid init()-ing it every call, but for > the parsing of the OBMols I'm still searching for a clever method to avoid > the parsing and perception steps every time. As parsing and perception can > be done upon saving the OBMol the first time in the database, a means of > storing the OBMol, or at least the essential data structures to recreate > it faster than from a textual format like SMILES, would be great. Is this > RTFM? I have not found any documentation about serializing OBMol, parts of > OBMol or something like the fastest input format yet... I don't think we have an easy way to do this (compared to "pickling" a class in python). However, do you really need the OBMol each time or will something like fingerprints to narrow down your search be? Tim |