markovmodel / PyEMMA

🚂 Python API for Emma's Markov Model Algorithms 🚂
http://pyemma.org
GNU Lesser General Public License v3.0
306 stars 119 forks source link

Is it possible to use pyemma.msm.its on the dtrajs after using TICA on the features? #1608

Open hima111997 opened 1 year ago

hima111997 commented 1 year ago

Is it possible to use pyemma.msm.its on the dtrajs after using TICA on the features?

def sample_k_centers_after_tica(n, data):        
    cl_original = pyemma.coordinates.cluster_kmeans(data= data, k=n, stride=1, max_iter=40)
    its = pyemma.msm.its(cl_original.dtrajs, lags=[1, 2, 5, 10, 20, 50], nits=5, errors='bayes',n_jobs=1)
    fig, axes = plt.subplots(1, 1, figsize=(12, 3))
    pyemma.plots.plot_implied_timescales(its, ax=axes, units='100 ps')
    axes.set_title(f'ITS figure at K={n}')
    fig.tight_layout()

lags = [1, 10,20]
clusters = [100,200,300]
for l in lags:
    tica = pyemma.coordinates.tica(data, dim=3, lag=l, kinetic_map=False)
    for c in clusters:    
        sample_k_centers_after_tica(c, tica)

and if it is possible, which lag should i use? the l variable in the for loop or the lag time after which the ITS converges?