By analyzing the stationary distribution and the free energy computed over the first two TICA coordinates, the stationary distribution, π, was stored in msm.pi or msm.stationary_distribution. I tried to compute the free energy landscape by re-weighting the trajectory frames with stationary probabilities from the MSM (returned by msm.trajectory_weights()) by using the code:
in ()
2 pyemma.plots.plot_contour(
3 *tica_concatenated[:, :2].T,
----> 4 msm.pi[dtrajs_concatenated],
5 ax=axes[0],
6 mask=True,
IndexError: index 49 is out of bounds for axis 0 with size 47
How can I solve this issue?
I concatenated the cluster.dtrajs array by using the following code:
cluster = pyemma.coordinates.cluster_kmeans( tica_output, k=75, max_iter=50, stride=10, fixed_seed=1) dtrajs_concatenated = np.concatenate(cluster.dtrajs)
By analyzing the stationary distribution and the free energy computed over the first two TICA coordinates, the stationary distribution, π, was stored in msm.pi or msm.stationary_distribution. I tried to compute the free energy landscape by re-weighting the trajectory frames with stationary probabilities from the MSM (returned by msm.trajectory_weights()) by using the code:
fig, axes = plt.subplots(1, 2, figsize=(10, 4), sharex=True, sharey=True) pyemma.plots.plot_contour( tica_concatenated[:, :2].T, msm.pi[dtrajs_concatenated], ax=axes[0], mask=True, cbar_label='stationary distribution') pyemma.plots.plot_free_energy( tica_concatenated[:, :2].T, weights=np.concatenate(msm.trajectory_weights()), ax=axes[1], legacy=False) for ax in axes.flat: ax.set_xlabel('IC 1') axes[0].set_ylabel('IC 2') axes[0].set_title('Stationary distribution', fontweight='bold') axes[1].set_title('Reweighted free energy surface', fontweight='bold') fig.tight_layout()
However, I got the following error:
IndexError Traceback (most recent call last)