Sort Particles Based on Job Results (such as angle shift of particles in Local Refinement)

Hi,
When changing the allowed angle and shift search parameters in a Local Refinement job, eventually the volume generated become gibberish (even though it goes to high resolution), and I’m guessing it is because I still have junk in the particle stack.

I’d like to test this hypothesis by sorting out all the particles above a certain angle and shift threshold. I’d like to be able to do this in CryoSPARC somehow, but if I can just get a file that matches the particle to the angle shift (i.e. how much it is moved during the job, not just the new orientation), I can do it manually.

Cheers,
Alex

Hi @apayne97,

This is an interesting idea for sure.
There isn’t a simple way within cryoSPARC to do this, but you can get the before and after pose and shift alignment parameters directly and compare them to do this manually as you suggested.

I’m not sure if you’ve already worked with cryoSPARC .cs files that contain all the particle data, but you can easily read and work with them using the
cryosparcm icli

Inside the icli shell, you can
from cryosparc2_compute import dataset
and then you can open up cs files like so:
dset = dataset.Dataset().from_file('/path/to/.cs/file')

There is more information about the .cs files here: https://cryosparc.com/docs/tutorials/data-management#use-case-modify

Once you’ve opened both datasets, you can compare the alignments3D/shift and alignments3D/pose columns to look for changes. The poses are encoded in axis-angle format, so you will have to convert them to rotation matrices to measure the angle change (and this may get more complicated if you have symmetry). For converting, you can use:

from cryosparc2_compute import geometry
R = geometry.expmap(axis_angle_vector)
axis_angle_vector = geometry.logmap(R)

And to measure the pose change, you can convert the before and after poses to rotation matrix, and then multiply the first by the inverse of the second, and then use the logmap to get back to axis angle. The length (euclidean norm) of the resulting axis-angle vector is the pose change in radians between the two poses.

5 Likes