Re: [AMBER] pytraj native contacts

From: Wesley Michael Botello-Smith <wmsmith.uci.edu>
Date: Wed, 23 Jan 2019 10:35:02 -0800

I have seen the same thing when using pt.native_contacts...
one option is to use pt.compute() instead.
This gives you back an 'OrderedDict' object which contains the output you
would get for the equivalent cpptraj command

e.g. when i run this on a system i am working on right now, which contains
a ligand in an occluded protein binding pocket:

command='nativecontacts :LIG :WAT distance 2.0 includesolvent series
savenonnative resseries present'
contactData=pt.compute(command,tempTraj)
print contactData.keys()

I get:
[u'Contacts_00000[native]',
 u'Contacts_00000[nonnative]',
 u':3208.H6_:45812.H1',
 u':3208.N3_:80550.H1',
 u':3208.N3_:109463.H2',
 u':3208.N3_:119745.H2',
 u':3208.H6_:119745.H2',
 u':3208.N3_:26790.H1',
 u':3208.N1_:17339.H2',
 u':3208.N3_:82238.H1',
 u':3208.H6_:80550.H2',
 u':3208.N3_:17339.H1',
 u':3208.N3_:127153.H2',
 u':3208.N3_:127913.H1',
 u':3208.N3_:89152.H1',
 u':3208.H6_:89152.H2',
 u':3208.N3_:27137.H2',
 u':3208.N3_:27527.H2',
 u':3208.N1_:89152.H1',
 u':3208.N1_:89152.H2',
 u':3208.N3_:127153.H1',
 u':3208.N3_:85860.H2',
 u':3208.N3_:125323.H1',
 u':3208.N3_:27527.H1',
 u':3208.N3_:35968.H2',
 u':3208.N3_:125418.H1',
 u':3208.N1_:85758.H2',
 u':3208.H6_:34069.H2',
 u':3208.N1_:125323.H1',
 u':3208.N3_:102648.H1',
 u':3208.N3_:77860.H2']

So you could then access the agglomerated native / nonnative contact counts
for each frame or the individual water residue - ligand contact series by
using the appropriate key. E.g. contactData['native'] or
contactData[':3208.N1_:125323.H1']
of course, if you dont care about individual contact series, then you could
just leave those out.
Essentially, the pt.compute() command is running the command you give it
exactly as it would be in cpptraj.
If your after consistency this may be a good way to go.

Hope that helps,
-Dr. Wesley Botello-Smith

On Wed, Jan 23, 2019 at 7:57 AM Rosellen, Martin <
martin.rosellen.16.ucl.ac.uk> wrote:

> Hi,
>
> I want to write a programme in pytraj that returns the contacts with water
> of a given residue. In cpptraj it works fine and identifies 3 contacts:
>
> nativecontacts :42 :WAT writecontacts 42_water_contacts.dat resout
> 42_water_contacts_resout.dat distance 2.0 out 42_water_contacts_out.dat
> includesolvent
>
> I tried to do the same in pytraj but the behaviour of native_contacts is
> not clear to me:
>
> pytraj.native_contacts(traj, mask=':42', mask2=":WAT", distance=2.0,
> include_solvent=True)
>
> This gives me 927 contacts.
>
> I want to further keep the data that gets written out to
> '42_water_contacts.dat' in the cpptraj command, in a variable python
> variable.
>
> best
> Martin
> _______________________________________________
> 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 Wed Jan 23 2019 - 11:00:03 PST
Custom Search