[gmx-developers] How to extract stored data in AnalysisData object?

Yunlong Liu yliu120 at jh.edu
Sun Oct 19 08:57:25 CEST 2014


Hi Teemu,

Thank you so much for your instructions.
I had simply implemented by creating a vector and a counter earlier. 
When calling analyzing the frame once, the counter will increase one. I 
know this is very silly. I will use your suggestions to improve the 
object-oriented style of my code. Thanks again.

Yunlong
On 10/19/14 12:43 AM, Teemu Murtola wrote:
> Hi,
>
> and sorry for a bit late reply.
>
> On Sun, Oct 12, 2014 at 10:27 PM, Yunlong Liu <yliu120 at jh.edu 
> <mailto:yliu120 at jh.edu>> wrote:
>
>     I would like to have access to the data stored in the AnalysisData
>     object after running a single pass over all the frames in the
>     trajectory. I don't know how to do it and where to find the stored
>     data.
>
>
> There are two alternatives:
>
>   * If you really need random access to all the data after it has been
>     produced, you can call requestStorage(-1) on the object, and the
>     access the data using getDataFrame().
>   * If you only need to process the data in a manner that can be done
>     on-the-fly (e.g., accumulating them from each frame in some way),
>     you can create a class that implements the
>     AnalysisDataModuleSerial interface and use addModule() in the
>     AnalysisData object to add your module to the processing chain of
>     the data. The functions in your class will be called for each
>     frame after the data has been entered. If your analysis needs
>     access to earlier frames, you can also call requestStorage(N) to
>     get access to N last frames within these callbacks.
>
> Best regards,
> Teemu
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20141019/f870aa43/attachment.html>


More information about the gromacs.org_gmx-developers mailing list