Local motion correction not working after particle-reassignment

Hi @team! :slightly_smiling_face:

Can anyone explain why after reassigning Particles to Micrographs, if I again extract the particles using a normal ‘Extract from Micrographs’ job all my workflow goes smooth, but if I try to extract particles motion corrected with ‘Local motion correction’ job, I get this error for each micrograph:

Error occurred while processing J1/imported/015693163883890972338_FoilHole_18094582_Data_18095461_18095463_20220618_110847-1406846.tif
Traceback (most recent call last):
File “cryosparc_worker/cryosparc_compute/jobs/motioncorrection/run_local.py”, line 588, in cryosparc_compute.jobs.motioncorrection.run_local.run_local_motion_correction
File “cryosparc_worker/cryosparc_compute/jobs/motioncorrection/run_local.py”, line 589, in cryosparc_compute.jobs.motioncorrection.run_local.run_local_motion_correction
File “cryosparc_worker/cryosparc_compute/jobs/motioncorrection/motioncorrection.py”, line 394, in cryosparc_compute.jobs.motioncorrection.motioncorrection.motion_correction
File “cryosparc_worker/cryosparc_compute/jobs/motioncorrection/loocv.py”, line 70, in cryosparc_compute.jobs.motioncorrection.loocv.min_smooth_fixed_lambda
ValueError: could not broadcast input array from shape (2) into shape (1)

Marking J1/imported/015693163883890972338_FoilHole_18094582_Data_18095461_18095463_20220618_110847-1406846.tif as incomplete and continuing…


Nevertheless, the local motion correction job runs until the end and marks all the exposures as incomplete and no particles extracted, although all this is very strange as the job outputs as well the following for each processed micrograph:

[CPU: 431.3 MB] Processed 0 of 6897 movies in 0.01s
[CPU: 431.3 MB] (0 of 6897) Processing J1/imported/015693163883890972338_FoilHole_18094582_Data_18095461_18095463_20220618_110847-1406846.tif
Motion correcting and extracting 64 particles (0 rejected near edges)
[CPU: 431.3 MB] Loading raw movie data from J1/imported/015693163883890972338_FoilHole_18094582_Data_18095461_18095463_20220618_110847-1406846.tif …
[CPU: 1.05 GB] Loading gain data from J1/imported/015693163883890972338_FoilHole_18094582_Data_18095461_18095463_20220618_110847-1406846.tif …
[CPU: 1.10 GB] Done in 4.78s
[CPU: 1.10 GB] Processing …


Hi André,

Please can you post additional information that may help us reproduce this error.
Maybe a minimal but uninterrupted workflow that includes:

  • specific job types (for example, which the local motion correction implementations was used)
  • movie import job A through job whose output particles are to be reassigned
  • movie import job B, via particle/micrograph reassignment job thru failed local motion job
  • indication of exports from/imports to cryoSPARC
  • indication of any down sampling that may have occurred along the workflow

Hi @wtempel,

We can mark this issue as resolved. Yesterday I managed to figure out the problem and I wished to write here the solution, only I did not have time to do it until now.

Apparently, the error in the Local Motion Correction job arose every time that I performed Patch CTF estimation after Patch Motion Correction, followed by particle reassignment. As soon as I skipped Patch CTF estimation, I could then perform Local Motion Correction without a problem. Skipping CTF correction was not a problem as the particle stack had already a CTF parameter associated. Still, I have no idea how that translates into “ValueError: could not broadcast input array from shape (2) into shape (1)”.

If you have a reflection on this, would be great to share it with everyone. Is this behaviour expected?


Thank you for the update.
May I ask what prompted the reassignment of particles to micrographs in this particular case, the import of particles from processing outside cryoSPARC?


My pleasure to answer: no, everything was processed on cryoSPARC. I simply wanted to re run similar workflow on the same dataset, using just the first movie frames. Radiation damage check. Waiting impatiently for future cryoSPARC developments regarding simplification of this process :slight_smile:

  • André

Please can you post a graphical, annotated, uninterrupted workflow that indicates

  • each job’s type
  • the “all frames” and “early frames only” branches
  • failure or success of the local motion correction jobs