If you want to get clusters similar to those used for the GIF you posted you can try the script DanielAsarnow posted here.
That script is written to split particles based on their latent coordinates for 3 modes of variability but I think you will want to try using just 1 mode to begin with. I made a modified version that filters on 1 dimension. If you use this, just change component_mode_2 to whichever mode you are interested in and then change the range from
(x > -30) & (x < 30) to whatever latent coordinate space you’d like to use.
You then need to use an edited .csg file to import those particles per the discussion on the original post I referenced above. If you have to do this for 20 frames this could get quite tedious, so maybe this isn’t your best way forward. Hopefully the “intermediates” mode will output particle clusters, as intended, soon.
Script for extracting a cluster from a single mode of variability:
import numpy as np
cs = np.load(“P1/J942/cryosparc_P1_J942_particles.cs”)
pt = np.load(“P1/J942/P1_J942_passthrough_particles.cs”)
x = cs[‘components_mode_2/value’]
idx = (x > -30) & (x < 30)
np.save(“cryosparc_P1_J942_particles_center.cs”, cs[idx], allow_pickle=True, fix_imports=True)
np.save(“P1_J942_passthrough_particles_center.cs”, pt[idx], allow_pickle=True, fix_imports=True)