Re-extracting particles with relion

Hello!
I would like to import particles from cryosparc to relion to try bayesian polishing. I ran into an error that wasn’t described in any of the threads. Basically, relion cannot find any of the particles on the motion corrected micrographs.

I exported the job from the NU-refinement and converted the particles with csparc2star.py package directly in cryosparcs export folder. A star file was created that I could open and does contain particle information. I repeated it with --swapxy and/or --inverty to be able to quickly test all of them.

I imported the raw micrographs to relion, ran a MotionCorr and CTFFind on the imported mics. The micrographs are binned the same way as in cryosparc.

When I try to run a particle extraction or re-extraction job, I always get the same error message:
MotionCorr/*.mrc optics group " " will be removed because no extracted particles belong to it.

Then the job finishes and with 0 particles in the written out star file.

I also tried to convert particles from the passthrough file and particle.cs as an aux file but that also doesn’t work.

Here is the header and 1 line from the particle.star file, maybe I made a mistake during the conversion:

data_optics

loop_
_rlnVoltage #1
_rlnImagePixelSize #2
_rlnSphericalAberration #3
_rlnAmplitudeContrast #4
_rlnOpticsGroup #5
_rlnImageSize #6
_rlnImageDimensionality #7
300.000000 1.302000 2.700000 0.100000 1 180 2

data_particles

loop_
_rlnImageName #1
_rlnMicrographName #2
_rlnCoordinateX #3
_rlnCoordinateY #4
_rlnAngleRot #5
_rlnAngleTilt #6
_rlnAnglePsi #7
_rlnOriginXAngst #8
_rlnOriginYAngst #9
_rlnDefocusU #10
_rlnDefocusV #11
_rlnDefocusAngle #12
_rlnPhaseShift #13
_rlnCtfBfactor #14
_rlnOpticsGroup #15
_rlnRandomSubset #16
_rlnClassNumber #17
000002@>J119/extract/000009808218258971581_FoilHole_26506575_Data_26499881_26499883_20210526_145315_fractions_patch_aligned_doseweighted_particles.mrc >J6/motioncorrected/FoilHole_26506575_Data_26499881_26499883_20210526_145315_fractions_patch_aligned_doseweighted.mrc 718 5340 -56.627743 108.785370 85.971222 -1.135181 2.087269 20303.039062 19692.845703 -65.356216 0.000000 0.000000 1 2 1

I am most likely missing something very basic, but I cannot figure it out.
Thank you in advance,
Marton

The particles in the star are referencing J6 movies from cryosparc. My guess is they need to reference MotionCorr movies from relion, and there are probably some good info on that in discussion board

Thank you. That is what I was afraid of. I am trying to manually exchange the names. I hope it will work.

Apart from the paths issue (vi and sed are your friends here), check that the optics group table matches between the micrograph and particle star file. Often they need editing to match.

Thank you. Although the optics group table matches, after re-editing my particle file I had yet another error message, that it couldn’t find the optics group “”. Based on that, I tried to edit it manually opticsGroup1 at the respective position, then I got the error message “1,1,1,1,1,1,1,…”.

Now I am trying to re-run the extraction with the un-edited optics group table hoping it was just a “hiccup”.

remember you will need to add the OpticsGroupName column, and make sure the value matches between the two star files

Ah, I did not do that! thank you!

You shouldn’t need to add it manually - current versions of Relion are automatically adding the OpticsGroupName after a warning, and current versions of csparc2star.py are outputting it from the beginning.

Have you tried the instructions on the pyem wiki? Really only minimal editing of paths is required, you can even use --micrograph-path /new/path/prefix and if you are re-extracting in Relion (instead of using cryoSPARC particles in Relion) you don’t need to do any editing at all.

FYI if your particles were picked on cryoSPARC Patch Motion micrographs instead of importing the ones from Relion MotionCorr you will also need --inverty to get the coordinates right.

Thank you for the answer.
I could not find any arguments that would help me with the prefixes like that one that you mention.
I used only the --swapxy and --inverty arguments,and re-edited the annotations to the micrographs manually. It extracted the particles correctly, I ran a quick 2D classification to confirm it.

Somehow before I re-edited, I really was not able to re-extract the particles in Relion. It gave me the error message that there are no particles on the micrograph called XXX. only after I adjusted the names, did this problem go away. It could be that I am using an older version of pyem, and that is the problem.

Of course, extraction will not work if the paths are not correct.

PS I can only guarantee that the current master branch of pyem will work as expected.

Hi! I experience similar problem. The poem did add the optics group but it is different from the one for the movies. And also somehow in the micrographs .star file I have rlnMicrographMovieName but in the .star for particles converted from CryoSPARC - rlnMicrographName. What did I do wrong? Thank you in advance