Re: [AMBER] mmP(G)BSA correlation time

From: <psu4.uic.edu>
Date: Thu, 29 Aug 2013 22:19:56 -0500

Hi Jason,

   Thanks for your prompt reply. So we try to use the python API script in
AmberTools 13 :

#################################### Here is the python script, *
python_API.py, * ######################

import os

import sys

sys.path.append(os.path.join(os.getenv('AMBERHOME'),'bin'))

from MMPBSA_mods import API as MMPBSA_API

import matplotlib.pyplot as plt

import numpy as np

data = MMPBSA_API.load_mmpbsa_info('_MMPBSA_info')

total = data['gb']['complex']['TOTAL'].copy()

data = MMPBSA_API.load_mmpbsa_info('_MMPBSA_info')

total_mut = data.mutant['gb']['complex']['TOTAL'].copy()

total -= total.mean()

total /= total.std()

total2 = total.copy() / len(total)

acor = np.correlate(total, total2, 'full')

total_mut -= total_mut.mean()

total_mut /= total_mut.std()

total2_mut = total_mut.copy() / len(total_mut)

acor_mut = np.correlate(total_mut, total2_mut, 'full')

xdata = np.arrange(0, len(total))

plt.plot(xdata, acor[len(acor)//2:], xdata, acor_mut[len(acor)//2:])

plt.show()

#################################################################3

 We have set up $AMBERHOME correctly and installed *python*,
*numpy*<http://www.numpy.org/>,
and *matplotlib* <http://matplotlib.org/index.html>

login2$ python

Python 2.7.2 |EPD 7.2-2 (64-bit)| (default, Jul 3 2011, 15:17:51)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2

Type "packages", "demo" or "enthought" for more information.

>>> import numpy

>>> print numpy.__version__

1.6.1

>>> import matplotlib

>>> print matplotlib.__version__

1.1.0


   Then we do *"./python_API.py" *in the directory where "_MMPBSA_info",
related _MMPBSA* and topology files are. After waiting for about an
hour, the following error messages will keep popping out:

./python_API.py: line 7: syntax error near unexpected token `os.path.join'
./python_API.py: line 7:
`sys.path.append(os.path.join(os.getenv(’AMBERHOME’), ’bin’))'

  However, the script does generate two files: os and sys*. *Interestingly,
if we open the "sys" file in the image software, it shows our Linux
terminal (as attached). * *We do have X11 forwarding set up correctly by
"ssh -X" and other images can be generated correctly in xmgrace remotely.

  Could you kindly offer some comments? Thanks.


  Cheers,

  Henry




On Wed, Aug 28, 2013 at 6:59 AM, Jason Swails <jason.swails.gmail.com>wrote:

> On Tue, Aug 27, 2013 at 7:57 PM, <psu4.uic.edu> wrote:
>
> > Dear Amber,
> >
> > We have a question about calculating correlation time of mmP(G)BSA dG
> > values. After consulting the amberTools 13 manual, old mailing
> > list<http://archive.ambermd.org/200712/0070.html>and the manuscripts
> > using the statistical inefficiency method (J. Chem.
> > Phys. 120, 2618 (2004); doi: 10.1063/1.1638996 & J Comput Chem 31:
> > 837–846, 2010 ), we assume the following way is correct to calculate
> > correlation time of dG in mmP(G)BSA?
> >
> > 1. Run MD simulation and save the trajectory in every picosecond (ps).
> >
> > 2. Calculate mmP(G)BSA dGbind using every ps snapshot from the MD
> > trajectory. Save the .csv file during mmP(G)BSA (Activate -eo flag).
> >
> > 3. Write a script to calculate the dGbind correlation time using dGbind
> > of each snapshot from the .csv file by the statistical inefficiency
> method.
> >
> > * statistical inefficiency method: correlation time= (block length) *
> > (the variance of the block average of X) / (the variance of the
> > distribution (X))
> >
>
> This way will work, but there is an easier method if you plan to use Python
> to analyze your data (with, e.g., numpy, scipy, pandas, etc.). See pages
> 376--377 of the AmberTools 13 manual where it describes using the Python
> API giving an example where the autocorrelation function is printed.
>
> The binding energy can be computed pretty easily by just subtracting the
> receptor and ligand TOTALs from the complex TOTAL (numpy arrays follow
> standard vector add/subtract rules). This approach prevents you from
> having to write a separate script to parse the CSV file. The example in
> the manual demonstrates how you would calculate the normalized
> autocorrelation function (which can also be used to estimate the
> statistical inefficiency in which the function becomes zero within some
> range of tolerance) and plots the resulting autocorrelation function with
> matplotlib, but you can adapt it for your own purposes.
>
> HTH,
> Jason
>
> --
> Jason M. Swails
> BioMaPS,
> Rutgers University
> Postdoctoral Researcher
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber

Received on Thu Aug 29 2013 - 20:30:02 PDT
Custom Search