Error broadcasting two matrices together when running Create Templates


I am trying to create projections of an electron density map that I’ve generated in Chimera with molmap.

I have done the following:

  1. Fetched the appropriate pdb, and ran molmap #0.1 4 in Chimera to generate a map of resolution 4A.
  2. Saved this as an .mrc file
  3. Imported the .mrc file using the Import Volume job with a resolution of 1.06:
  4. Ran the Create Templates job with a resolution of 1.06

Then, I receive the following error:

[CPU: 212.8 MB]  Traceback (most recent call last):
  File "cryosparc_worker/cryosparc_compute/", line 84, in
  File "cryosparc_worker/cryosparc_compute/jobs/create_templates/", line 47, in
  File "/home/nick/CryoSPARC/install/cryosparc_worker/cryosparc_compute/", line 152, in zeropad
    new_X[a:b,a:b,a:b] = X
ValueError: could not broadcast input array from shape (60,61,74) into shape (74,74,74)

How can I get the ogrid of my map and the one to be generated by CryoSPARC to match?


The map needs to have the same shape along all three axes for cryoSPARC to process it. If you have an already existing volume from cryoSPARC that is on a cubic grid, I think this can be accomplished by using the vop resample command with the onGrid option – check out this thread: Creating templates from imported 3D volume using Chimera


1 Like

yep you can do that, or use onGrid directly as an argument to molmap, assuming you have both maps loaded