Potential bug in "optimize per group parameters" during homogeneous refinement

I keep getting this error, but only when running the optimize per group Parameters button is checked. Without it the job completes without issue.
This job is using two particle stacks from 2 different classes, from a 3d classification job. Oddly the structures of those classes don’t align well, which is odd, since typically 3d class outputs are aligned for me. not sure if that is relevant to the error or not. Also the low res particle blobs from the 3d classification job were swapped out for the higher res blobs for both prior homogeneous refinement jobs whose particle stacks went into the homogeneous ref. job that produced this error.
Running: 4.2.1

[2023-06-16 1:08:12.52]
[CPU: 23.05 GB Avail: 162.89 GB]
Performing global CTF refinement against current combined reference.

[2023-06-16 1:08:12.53]
[CPU: 23.05 GB Avail: 162.89 GB]
Minimum resolution: 10.00A Maximum resolution 2.92A

[2023-06-16 1:08:14.27]
[CPU: 23.05 GB Avail: 162.89 GB]
Dataset has 1 unique exposure groups.

[2023-06-16 1:08:14.28]
[CPU: 23.05 GB Avail: 162.89 GB]
Group 0 : 396542 particles

[2023-06-16 1:08:17.93]
[CPU: 7.02 GB Avail: 178.95 GB]
Traceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 96, in cryosparc_compute.run.main
File “cryosparc_master/cryosparc_compute/jobs/refine/newrun.py”, line 483, in cryosparc_compute.jobs.refine.newrun.run_homo_refine
File “/opt/cryosparc/cryosparc_worker/cryosparc_compute/exposure_groups.py”, line 51, in check_particles_groups
retval = check_field_in_group(group, egid, fullname)
File “/opt/cryosparc/cryosparc_worker/cryosparc_compute/exposure_groups.py”, line 38, in check_field_in_group
if do_assert: assert False, “Field %s is not constant in group %d with %d items, should be %s” % (fullname, egid, len(group), str(firstval))
AssertionError: Field ctf/shift_A is not constant in group 0 with 396542 items, should be [0.03020161 0.01906822]


Has any of the two particle stacks been through group CTF param optimization before the merge into the homogeneous refinement?

Perhaps we can resolve this error by resetting the CTF parameters to default for the combined particles by running a standalone Global CTF Refinement job. If the job completes without an error, you can use the output particle stack for the homogeneous refinement with per group CTF params optimization on.

1 Like

Yes – I believe you should be able to correct this by running a global CTF refinement with “Reset Tilt to default” (This also resets the shifts to 0). You may need to turn on all of the “reset” flags though, just in case the other CTF params are not constant across the exposure group after separate refinements. Downstream particles should be able to be used for homogeneous refinement with optimize per-group parameters enabled.