In [1]:
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
# try it your self
# make sure to click 'Cell', then 'Run All' to initilize pytraj.
# enter the command or modify below code and then Shift-Enter to run.
import pytraj as pt
In [2]:
%matplotlib inline
In [3]:
!ls ./data
In [4]:
traj = pt.iterload('lysozyme.mdcrd', 'lysozyme.prmtop')
In [5]:
print(traj)
In [6]:
pt.radgyr(traj)
Out[6]:
In [7]:
# supported limited progress bar
data = pt.compute('''
molsurf @CA
multidihedral resrange 3-10
vector :2 :9
distance :3 :7
''', traj)
In [8]:
# calulate lysozyme S2 order paramter
# select H (backbone) indices. Need to provide corresponding Topology and mask
h = pt.select_atoms(traj.top, '@H')
n = h - 1
# create atom pairs
nh = list(zip(n, h))
print(nh[:10])
# calulate S2
S2 = pt.NH_order_parameters(traj, nh)
In [9]:
# plot
from matplotlib import pyplot as plt
plt.plot(S2)
Out[9]:
In [11]:
import pytraj as pt
import nglview as nv
traj = pt.load(nv.datafiles.TRR, top=nv.datafiles.PDB)
view = nv.show_pytraj(traj)
view