Pixel size change

Hi… I realize that I put the wrong pixelsize for a dataset when I imported it. Of course, I noticed this when the CTF determination went completely crazy. Since the step of unblurring took an inordinate amount of time, I would prefer just to be able to change it after this step. Is it possible to do that, or do I have to restart the whole process?

Hi @Ruben1,

It is possible (though somewhat difficult) to change the pixel size, and also the pixel size is used to set/autotune parameters of the motion correction algorithms, so it may be worth re-processing anyway.

To change the pixel size:

  1. find the job directory of your motion correction job
  2. inside the motion correction job you should find a passthrough_micrographs.cs file. Note the full path to this file.
  3. run:
cryosparcm icli
# now in the cryosparc python shell
from cryosparc2_compute import dataset
d = dataset.Dataset().from_file('<path to .cs file>')
d.data['micrograph_blob/psize_A'] = <new pixel size>
d.to_file('<path to .cs file>')

This will manually override the pixel size in the output of the motion correction job, and your subsequent CTF estimation job should work correctly.

1 Like

Very nice, thank you!! I reprocessed the images from the beginning, which worked fine, but this is very helpful for the future.

@apunjani, is this information still relevant for v3.2.0?
I figured out that the “cryosparc2_compute” module properly changed name to “cryosparc_compute”, but at the next step “d = dataset.from_file('<path to .cs file>')” I get this error:

AttributeError: module 'cryosparc_compute.dataset' has no attribute 'from_file'

Any idea on how to fix this?

Hey @jelka,

Sorry for the typo, it’s actually: d = dataset.Dataset().from_file('<path to .cs file>')

Thanks @stephan,
This got me to the next line, but then a new error struck.
‘mscope_params/psize_A’ does not seem exist, maybe it should be ‘movie_blob/psize_A’?

Hi @jelka,

You’re right, but there are actually a couple places where you can change the pixel size.
The pixel size result field exists in the movie_blob and the micrograph_blob result groups. The movie_blob/psize_A value will be equal to the parameter you set in the Import Movies job. The micrograph_blob/psize_A will be equal to either the parameter you set in the Import Micrographs job (if you imported micrographs directly), or if you used Motion Correction to create the micrographs, they’ll be equal to movie_blob/psize_A divided by the Fourier crop factor (the Fourier crop factor is 1 if you didn’t Fourier crop your exposures).
You can check what result fields your dataset has by printing d (e.g. print(d)). If your dataset has both, I’d suggest changing them accordingly.

1 Like

Thanks for in depth explanation.

Hi, I had the same problem. I don’t know if this is useful, but my work around was to start a import micrograph job with the correct pixel size and use the the path of the dose_weighted.mrc files from the motion corrected job.