Micrograph shape mismatch errors

Hi,
I’m trying to extract particles with CS 3.2 with the latest patches, but I get size mismatch errors. This is what I did:

  • Import movies
  • MotionCor2 Job
  • CTF estimate with ctffind4

Which worked fine. Afterwards I tried importing crYOLO coordinates, which worked, but the extract job would result in:

[CPU: 574.2 MB]  Traceback (most recent call last):
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_worker/cryosparc_compute/jobs/runcommon.py", line 1791, in run_with_except_hook
    run_old(*args, **kw)
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_worker/cryosparc_compute/jobs/pipeline.py", line 86, in stage_target
    work = processor.exec(item)
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_worker/cryosparc_compute/jobs/pipeline.py", line 43, in exec
    return self.process(item)
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_worker/cryosparc_compute/jobs/extract/run.py", line 469, in process
    update_alignments3D=update_alignments3D)
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_worker/cryosparc_compute/jobs/extract/extraction_gpu.py", line 49, in do_extract_particles_single_mic_gpu
    assert mic_shape == mic.shape, "Micrograph shapes are inconsistent!" # otherwise micrograph_blob/shape is inconsistent with the actual frame shape
AssertionError: Micrograph shapes are inconsistent!

If i probe for those values, i have mic_shape=(3710, 3838) mic.shape=(3838, 3710).
I also tried to see if it was a problem with my import, so I manually picked a few coordinates on just one image and I get:

[CPU: 310.1 MB]  --------------------------------------------------------------

[CPU: 310.1 MB]  Processed 0 of 1 micrographs in 0.01s 

[CPU: 310.1 MB]  Extracting from J6/motioncorrected/016219736477392216318_D1-1_SPA_057_Apr16_13.22.42_motioncor2_aligned_DW.mrc : 13 particles (0 rejected near edges)

[CPU: 310.2 MB]    Loading micrograph..
[CPU: 463.7 MB]  Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 84, in cryosparc_compute.run.main
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_master/cryosparc_compute/jobs/manual_picker/run.py", line 643, in run_manual_picker
    do_extract_particles_from_micrographs(state['box_size_pix'], state['bin_size_pix'])
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_master/cryosparc_compute/jobs/manual_picker/run.py", line 492, in do_extract_particles_from_micrographs
    scale_const, overall_normalizer, bg_fwhm_A = 200, has_ctf=state['has_ctf'])
  File "/home/nieverge/bin/cryoSPARC/cryosparc2_master/cryosparc_compute/jobs/extract/extraction.py", line 90, in do_extract_particles_single_mic
    mic -= bg_full # bg subtracted
ValueError: operands could not be broadcast together with shapes (3838,3710) (3710,3838) (3838,3710) 

I’d be happy if anyone had an idea what I’m doing wrong or had a suggestion on how to fix this.

Hi @VerTeX,

Is there some chance motioncor2 is outputting micrographs with flipped axes? Not sure what parameters you have set there. It’s worth also checking the raw movies input files directly for their size, and also checking the .mrc micrographs coming out of motioncor2 for their size - they should be the same

It seems with the internal patch motion correction I get the correct behaviour, while the MotionCor2 output does not work. The files all have the same header information and I can see no flipping.

Patch v3.2.0+210601 released yesterday resolves this issue: Patch 210601 is available for cryoSPARC v3.2.0

1 Like