In [1]:
import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
from msmbuilder.example_datasets import FsPeptide, MetEnkephalin
from msmbuilder.featurizer import DihedralFeaturizer
fs = FsPeptide().get().trajectories
n_atoms = fs[0].n_atoms
dih_model = DihedralFeaturizer(['phi', 'psi', 'omega', 'chi1', 'chi2', 'chi3', 'chi4'])
fs_dih_feat = dih_model.transform(fs)
In [3]:
import pyemma
tica = pyemma.coordinates.tica(fs_dih_feat,lag=100,dim=10)
In [4]:
np.max(tica.feature_TIC_correlation[:,0]),np.argmax(tica.feature_TIC_correlation[:,0])
Out[4]:
In [5]:
Y = np.vstack(tica.transform(fs_dih_feat))
Y.shape
Out[5]:
In [6]:
plt.plot(sorted(Y[:,0]))
Out[6]:
In [7]:
plt.plot(sorted(Y[:,0])[::1000])
Out[7]:
In [8]:
ind = sorted(range(len(Y)),key=lambda i:Y[i,0])
In [9]:
plt.plot(Y[ind,0][::100])
plt.figure()
plt.plot(Y[ind,1][::100])
Out[9]:
In [10]:
import mdtraj
In [11]:
traj = fs[0]
In [12]:
for f in fs[1:]:
traj = traj+f
In [13]:
frames = traj[ind[::1000]]
frames = frames.superpose(frames,0)
In [14]:
frames.save_pdb('fs_tic1_movie.pdb')