Particle subtraction failure

I’ve started using cryosparc very recently and encounter an issue with the Particle Subtraction job. I use the version v2.12.4 of cryosparc and I basically followed the protocol described in the case study: Yeast U4/U6.U5 tri-snRNP. I payed extra care to check the mask boxes when needed (import masks and volume mask jobs) and kept the radius of reference window consistent with the one used in the refinement job.
The error message is as following:

Traceback (most recent call last):
File “cryosparc2_worker/cryosparc2_compute/”, line 78, in
File “cryosparc2_worker/cryosparc2_compute/jobs/local_refine/”, line 143, in
File “cryosparc2_compute/”, line 954, in compute_all_fscs
mask_in_real = initmask * (rMA + rMB)
ValueError: operands could not be broadcast together with shapes (200,200,200) (400,400,400)

Do you have an idea of what could the source of the problem? While waiting for you suggestion I going to redesign my masks and keep on trying…


Hi @laurie,

Thanks for reporting.
The error does indicate that the mask that you’ve used is stored in a volume with a different box size (200) than the volume that you are using for subtraction (400).
Can you try using the volume tools job to rescale the volume to the same size as the refinement map?
Let us know if that works!

Hi @apunjani,

the refinement map I provide is supposed to be in a 200 voxel box, that’s the size I set up in the refinement job. The mask I create has the right dimension (200). So why the box of the refinement map is then doubled in the particle subtraction job?
I tried to resample the mask in the volume tool, the resulting mask as a lot of noise/dust and does not look like my mask anymore. I have anyway submitted this resampled mask to the particle subtraction job and obtained the same error message as previously except that it pops up right away the line"Pixel Size is 2.120" instead of after the later line “Scaling factor is 1.501”.

New error message:
Traceback (most recent call last):
File “cryosparc2_worker/cryosparc2_compute/”, line 78, in
File “cryosparc2_worker/cryosparc2_compute/jobs/local_refine/”, line 85, in
ValueError: operands could not be broadcast together with shapes (200,200,200) (400,400,400)

Also the same issue pops up when I try to run a local refinement job.

@laurie thanks for reporting this also - given the steps you’ve taken we’re marking this as an issue that we are trying to reproduce here so it can be fixed.

@apunjani , @laurie
I am encountering the same issue and couldn’t find any solution yet. The original extraction was done with a box size of 512, but for the refinement I used 440. The masks I created also have a box size 440. I am constantly getting this error message:

Traceback (most recent call last):
File “cryosparc_worker/cryosparc_compute/”, line 84, in
File “cryosparc_worker/cryosparc_compute/jobs/local_refine/”, line 73, in
ValueError: operands could not be broadcast together with shapes (440,440,440) (512,512,512)

I tried changing the box size of the masks (thought that might help) to 512, but the same error occurs.

Anybody found out what might be the problem?

Hi @KSusanne,

I believe this happens when there is an inconsistency between particle/volume/mask box sizes, which is definitely a bug as this job should be able to appropriately resample the mask/volume to match the particles. In the meantime, one workaround that could work is downsampling your particles from 512 to 440. This can be done by running a “downsample particles” job with the new box size set as 440. Then, you can build a new particle subtraction job using these particles, along with the original volume and mask (both of which are output from the refinement at box size 440). The only caveat is that if you were close to the Nyquist frequency in the original refinement, then subsequent refinements using the subtracted images won’t be able to exceed this resolution.