AssertionError: Could not read mrc header

Hello, everyone.

I am importing some data into a CryoSPARC workspace, but ran into an issue when the job tried to read the gain reference’s header. For context, the gain was in the directory above the one containing my raw data and also had a longer name than what is shown in the screenshot. After renaming, trying again, moving it into the subdirectory, and trying once more, I am still unable to get the job to work. Having taken a look at the job multiple times to ensure that I put in the right parameters, I am still met with no luck. Has anyone experienced a similar problem?

Welcome to the forum @perrotta2.
Please can you post

  1. the Traceback as text
  2. details on the instrument and method (gain explicitly recorded, or calculated from actual exposures) that where involved in the generation of the gain reference.

Hi, @wtempel .

Here are the requested details with pertinent information redacted:

Traceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 129, in cryosparc_master.cryosparc_compute.run.main
File “/home/-----/software/cryosparc/cryosparc_worker/cryosparc_compute/jobs/imports/run.py”, line 1061, in run_import_movies_or_micrographs
gshapey, gshapex = read_gain_reference(gainref_abs_path, shape_only=True, data_format=data_format)
File “/home/-----/software/cryosparc/cryosparc_worker/cryosparc_compute/jobs/imports/run.py”, line 1017, in read_gain_reference
hdr = mrc.read_mrc_header(mrc_file, debug_fname=gainref_abs_path)
File “/home/-----/software/cryosparc/cryosparc_worker/cryosparc_compute/blobio/mrc.py”, line 54, in read_mrc_header
assert len(header_int32) == 256, f"Could not read mrc header from {debug_fname}"
AssertionError: Could not read mrc header from /home/-----/-----/-----/Rawdata/gain.mrc

  1. Titan Krios, K3 detector. I believe the gain reference was explicitly recorded.

Hello, @wtempel .

I just wanted to follow up on this request and ensure it did not get forgotten.

Thank you!

Hi @perrotta2! If you have IMOD available, could you try running header gain.mrc? The result should be something like:

 Number of columns, rows, sections .....    1024    1024       1
 Map mode ..............................    2   (32-bit real)
 Start cols, rows, sects, grid x,y,z ...    0     0     0    1024   1024      1
 Pixel spacing (Angstroms)..............   4.200      4.200      4.200
 Cell angles ...........................   90.000   90.000   90.000
 Fast, medium, slow axes ...............    X    Y    Z
 Origin on x,y,z .......................    0.000       0.000       0.000
 Minimum density .......................   102.16
 Maximum density .......................   589.93
 Mean density ..........................   512.93
 tilt angles (original,current) ........   0.0   0.0   0.0   0.0   0.0   0.0
 Space group,# extra bytes,idtype,lens .        0        0        0        0

If you don’t have IMOD, could you let us know the size of your gain reference file using ls -lh?

$ ls -lh gain.mrc
-rw-rw-r-- 1 rposert structura 4.1M Aug  7 18:00 gain.mrc

Hi, @rwaldo . My apologies for taking so long to respond.

Here is the output:
-rwxr-xr-x 1 qliu qliu 0 Jul 22 23:37 gain.mrc

Upon looking at the example you gave, it seems that the size of the gain is 0 bytes, which could explain a few things.

Hi @perrotta2, yes, this indicates that your gain reference is empty. If you do not have a copy of it somewhere you can generate one using, for example, relion_estimate_gain.