Extracted particles with wrong coordinates

Hey all,

I initially processed my dataset using Cryosparc, (Particle picking with topaz, extraction in Csparc, 2D classification, Ab initio, and consensus refinement) then used Csparc2Star to generate a .star file for further processing in Relion. While doing this, I did not use the --swapxy argument (which I now realise is needed to hit my particles when re-extracting in Relion).

I had used 3D classification in Relion, further processed two classes, and now have an ideal set of particles corresponding to each class (2). Since these particles were not swapped using --swapxy before exporting to Relion, the particle coordinates are incorrect, and pose an issue when I attempt to polish these particles.

I re-did the Csparc2Star conversion on the main, full set of (Class2D selected) particles, and now have the correct .star file containing all of the particles and their correct coordinates. Could someone help me out with a way (example of a command) that I can update the particle coordinates from my sets of ideal particles? All my attempts at using /pyem/star.py have failed.

Thanks in advance for the help :slight_smile:

There are other ways to do this (I hope someone will share), but you can also use startool --replace to implement rlnClassNumber from the 3D classification results into your new star file.
Make a star file for all the particles from 3D classification (subset select, choose all classes)
In the new star file with the correct coordinates from --swapxy, make a new column rlnClassNumber. Insert it behind a column that has constant value, perhaps rlnGroupNumber if you have all one group. Then use the find/replace tool or sed to put some placeholder value in place of rlnClassNumber.
Run startool. You need to remove the optics table from both star files first, run startool, then put the table back.
python startool.py particles_swapxy.star --replace_star _rlnClassNumber=3D_class_results_all_classes.star:_rlnImageName --write particles_swapxy_with_classes.star