Exporting to relion with pyem - get box size

So I have seen this issue elsewhere but I cannot resolve it following the advice in other pages.

I did all particle pre-processing in cryosparc and want to take these particles to relion 3.1. I take the cs file from homogeneous refinement and run csparc2star.py, create symlinks in my relion directory and change .mrc to .mrcs, plus change the star particle name to .mrcs. I verify the star file points to .mrcs particles that are within “relion-project/Job/extract/*.mrcs”

I import the star file to relion and I cannot run anything with it, getting the error “ObservationModel::getBoxSize: box sizes not available. Make sure particle images are available before converting/importing STAR files from earlier versions of RELION.”
I also just updated relion and pyem.

In csparc2star.py, I used --boxsize 340 but this does not show up in the star file, so I added it manually to the optics group. Still at import, it gives the error " + WARNING: will ignore (but maintain) values for the unknown label: rlnImageBoxSize"

Not sure what is going wrong. I also cannot run csparc2star.py on the cs file of an exported homogeneous refinement job, which I tried as a way to possibly get around this issue.

My overall goal is to run bayesian polishing, so I plan to extract particles in relion based on cryosparc locations (I used --swapxy too).

My star file is as follows. Note that I did alter the mic path to point to relion-corrected micrographs for re-extraction and later polishing.

data_optics

loop_
_rlnVoltage #1
_rlnSphericalAberration #2
_rlnAmplitudeContrast #3
_rlnOpticsGroup #4
_rlnImagePixelSize #5
_rlnImageDimensionality #6
_rlnImageBoxSize #7
300.000000 2.730698 0.100000 2 0.830000 2 340

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
000001@J97/extract/20aug06a_gr3_2_00002Gr_00015Sq_v03_00002Hln_00002Enn.frames_patch_aligned_doseweighted_particles.mrcs MotionCorr/job007/frames/20aug06a_gr3_2_00002Gr_00015Sq_v03_00002Hln_00002Enn_frames.mrc 3648 1439 45.536884 4.295629 -97.593208 -2.425156 0.396844 12787.012695 12541.234375 54.108551 -1.782589 0.000000 2 2 1

you need to add rlnImageSize

@DanielAsarnow I think csparc2star.py should write rlnImageSize not rlnImageBoxSize - I don’t think relion recognizes the latter and it definitely works with the former?

(or maybe I’m missing something, more likely)

Thank you, Oli. Adding rlnImageSize and adding rlnOpticsGroupName worked.

For some reason the subset selection tool was changing the optics group numbers even after I had fixed it. I was using this to extract a small subset as a test. So if I fix the particles_split.star to all have the same original optics groups (It changed from 2 to 1) as the original star, then I can extract my particles.

Also, anyone know why coordinates from cryosparc particle picks might be significantly off when taken to relion? The original coordinates are from patch motion corrected mics and are now being used for motioncor mics with 7x5 patch for K3 data. SwapXY was necessary but I wonder if an axis is inverted because the particles coming out of relion are garbage. The motion was not substantial at all.
Picking new particles in cryosparc with the motioncor mics then taking those coords to relion for extraction produces good particles.

OK, OK, I get it :stuck_out_tongue:

If you update pyem, rlnImageSize will be converted.

1 Like

@user123 maybe some confusion with offsets being in pixels vs angstroms (this being a change in relion3.1)? Do the coordinates look fine if you use relion to extract from the patch motion mics?

And thanks @DanielAsarnow!! :blush::pray:

Maybe that’s the case. I did not test out extracting from the patch motion mics but that would be a good diagnostic. I opted for new particle picks and extraction as it’s become faster to just redo it in cryosparc :slight_smile:

Hi,
How did you change .mrc to .mrcs for the extract folder?
Thanks,
Priyanka

in the extract folder, on the command line, this snippet should do the trick:

for i in *mrc; do ln -s ${i} "${i}s"; done

1 Like

Thanks for your reply.It works.

1 Like

Hi,
I have generated the symbolic link but while running job in RELION 3.1 it is giving this error:
“stacks of images in MRC-format should have extension .mrcs; .mrc extensions are reserved for 3D maps”.
Can you please suggest what to do to tackle this issue.
Thanks,
Priyanka

did you edit your star file to point to the mrcs symlinks you created?

No,I have not done that.It works.
Thanks for your help and suggestions.It will really help me.
Priyanka