molPX icon indicating copy to clipboard operation
molPX copied to clipboard

ValueError: largest specified index (9562.0 * stride=9562.0 * 1=9562) is larger than trajectory length

Open Qianchen-Liu opened this issue 2 years ago • 2 comments

I have two trajectories: trajj=['strip_prod.dcd','strip_prod2.dcd']; each trajectory file includes 4797 frames. data = pyemma.coordinates.load(trajj, features=feat) Then I did TICA and k-means clustering, and I would like to visualize the structure of each cluster using molPX. tica = pyemma.coordinates.tica(data,lag=8) tica_concatenated = np.concatenate(tica.get_output()) data_sample, geoms = molpx.generate.sample(trajj, pdb, cluster, n_geom_samples=100, #keep_all_samples=True # read the doc for this argument ) I got the error: ValueError: largest specified index (9493.0 * stride=9493.0 * 1=9493) is larger than trajectory length 'strip_prod.dcd' = 4797

I was wondering where the specified index comes from and how to solve it. Thank you in advance!!

Qianchen-Liu avatar May 04 '23 22:05 Qianchen-Liu

As the length of cluster and trajectories are different, I change the molpx.generate.sample as data_sample, geoms = molpx.generate.sample(trajj, pdb, Y_tica, n_geom_samples=100, #keep_all_samples=True # read the doc for this argument ) And it works, but when I want to plot: linked_ngl_wdg = molpx.visualize.sample(data_sample, geoms.superpose(geoms[0]), plt.gca(), clear_lines=False, #plot_path=True ) linked_ngl_wdg I got "ValueError: unitcell angle < 0". Could you help me with this? Thank you!!

Qianchen-Liu avatar May 04 '23 22:05 Qianchen-Liu

@Qianchen-Liu did you get this working?

jackdmarquez avatar Mar 06 '24 21:03 jackdmarquez