Particle extraction from 3D stack fails

Hello,

I have done several rounds of 3D classification with downsampled particle size and I wanted to reextract the full size particles for one last round of refinement. Normally this works perfectly fine but for one particular dataset I keep getting the following error when I try to reextract using the 3D NU-refinement particle stack

Traceback (most recent call last):
File “/opt/cryoSPARC2/cryosparc2_worker/cryosparc_compute/jobs/runcommon.py”, line 1790, in run_with_except_hook
run_old(*args, **kw)
File “/opt/cryoSPARC2/cryosparc2_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.7/threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “/opt/cryoSPARC2/cryosparc2_worker/cryosparc_compute/jobs/pipeline.py”, line 86, in stage_target
work = processor.exec(item)
File “/opt/cryoSPARC2/cryosparc2_worker/cryosparc_compute/jobs/pipeline.py”, line 43, in exec
return self.process(item)
File “/opt/cryoSPARC2/cryosparc2_worker/cryosparc_compute/jobs/extract/run.py”, line 469, in process
update_alignments3D=update_alignments3D)
File “/opt/cryoSPARC2/cryosparc2_worker/cryosparc_compute/jobs/extract/extraction_gpu.py”, line 59, in do_extract_particles_single_mic_gpu
assert n.allclose(psize_align_2D, particles_in.data[‘alignments2D/psize_A’], atol=1e-4), “Particles must all have the same alignment pixel size. If multiple particle stacks were input into the job, please instead run separate extract jobs for each particle stack.”
AssertionError: Particles must all have the same alignment pixel size. If multiple particle stacks were input into the job, please instead run separate extract jobs for each particle stack.

When I try to reextract using the particle input that I used for the 3D refinement itself I get the same error. I confirmed that all particles used throughout the classification had the same pixel size. On other datasets it works fine, could anyone suggest a fix? Thank you!

I was able to fix this by rerunning 2D classification on the refined particle stack and then re-extracting, but still not sure why the alignment pixel size were out of sync.

1 Like

Hi @mpacesa,

This happens when you run multiple 2D or 3D reconstruction/classification/refinement jobs with a different volume/reference pixel size, and then attempt to re-extract. CryoSPARC expects that the pixel sizes used for alignment are the same across the whole particle input, which simplifies the re-centering based on shifts. The workaround you discovered makes sense, as then all particles will be put through the same classification with the same template pixel size.

The other workaround is to identify each sub-stack that was run with a unique 3D classification job, and pass those stacks through an extraction job before they were merged with other stacks from other 3D classification jobs. For e.g., you could take each stack right after the 3D classification job was finished, and run a separate extraction job on each of these.

Best,
Michael