See below.
> On 28 Jul, 2016, at 06:30, Nikhil Maroli <
scin...@gmail.com> wrote:
>
> Dear all,
>
> i want to plot pore radius vs channel co-ordinate
> and pore radius vs time ,i have done up to this,kindly tell me what to do next.
>
> i wanted to get results in table as .dat file
It would help if you told us what values you would like to have in the output file. Python is very flexible and in principle any output format can be written. If you are not overly familiar with Python then I understand that this can be a bit daunting at first so we're more than happy to help. But it does make our life a lot easier (and makes better use of our very limited time) if you are as specific as you can.
Now, given that I have to guess at what you want, I am just giving you a basic example and you can start modifying it to your own ends.
For a start, I don't know if you want to run HOLE on a trajectory or a single structure. I *assume* a trajectory because in the commands below you have your own "ab.gro" and "abc.xtc" for the trajectory analysis but the example PDB_HOLE for the single frame. Thus, I will ignore the single frame analysis – if this is what you want, say so clearly and paste the exact commands that you are using
TRAJECTORY ANALYSIS
I commented out lines that you don't need.
> import numpy as np
> # import os
> import MDAnalysis as mda
> # from MDAnalysis.analysis.hole import HOLE, HOLEtraj
# only need HOLEtraj for trajectory analysis
from MDAnalysis.analysis.hole import HOLEtraj
# don't need exampl file
> # from MDAnalysis.tests.datafiles import PDB_HOLE
> u = mda.Universe('ab.gro','abc.xtc')
# I assume you read the docs and you don't need any other options to run HOLE?
> H = HOLEtraj(u)
But you still need to actuall *run* the trajectory analysis:
H.run()
You can then write it to a file; here I separate each frame with '&' but you can adjust the code to whatever you need:
with open("profiles.xvg", "w") as xvg:
for frame, profile in H:
for _, zeta, radius in profile:
xvg.write("{0} {1}\n".format(zeta, radius))
xvg.write("&\n")
For more details, see the updated notebook at
http://nbviewer.jupyter.org/gist/orbeckst/64c0bd5a037b3e434cc8ee6732030252#Extracting-data-to-a-file
NOTE: the rest is NOT needed and in fact, overwrites your trajectory analysis:
> H = HOLE(PDB_HOLE, executable="~/hole2/exe/hole")
> H.run()
> H.collect()
Hope that helps.
Oliver
--
Oliver Beckstein *
orbe...@gmx.net
skype: orbeckst *
orbe...@gmail.com