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

How to extract structure from near the center of the clusters? #1570

Closed buruiyu closed 2 years ago

buruiyu commented 2 years ago

Hello! I am a new learner. I am using pyemma on linux system. My pyemma version is 2.5.11. After I constructed the model, I found that the representative structures saved inside each macrostate were different, so I first used print(msm.metastable_distributions[1]) to get the distribution of a macrostate over each microstate, and selected the microstate with the highest probability; then used msm.sample_by_state( 10 , [1]) to extract 10 structure from inside a microstate, and then use pyemma.coordinates.save_trajs to save it. I extracted 10 structures from inside each microstate using sample_by_state, what is the criteria for extracting structures with this line of code? Is each structure extracted sorted by some weight? After I extracted it this way, the gap between each structure inside the microstates is still large, so I want to extract some structures near the cluster centroid of the microstates, how should I implement it?

Thank you!

clonker commented 2 years ago

Hey, sample by state does not use any weighting, the structures are drawn uniformly from the pool of frames that are assigned to the particular state. If they deviate a lot, it could mean that either your projection isn't good or the clustering doesn't use enough centers (# cluster centers == # states).

Cheers!