IndexError when using Patch CTF with data collected on a Falcon III

I’m using cryoSPARC v2.14.2 and having a failure of patch CTF with data collected on a Falcon III. I can CTF correct in ctffind4 either before or after motion correction, but if I try and run patch CTF on the data after motion correction I get the following error:

Traceback (most recent call last):
  File "cryosparc2_compute/jobs/runcommon.py", line 1490, in run_with_except_hook
    run_old(*args, **kw)
  File "/gs1/RTS/EM/Software/CryoSPARCv2/cryosparc2_worker/deps/anaconda/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "cryosparc2_compute/jobs/pipeline.py", line 153, in thread_work
    work = processor.process(item)
  File "cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation/run.py", line 114, in cryosparc2_compute.jobs.ctf_estimation.run.run.ctfworker.process
  File "cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation/run.py", line 117, in cryosparc2_compute.jobs.ctf_estimation.run.run.ctfworker.process
  File "cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation/run.py", line 118, in cryosparc2_compute.jobs.ctf_estimation.run.run.ctfworker.process
  File "cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation/patchctf.py", line 66, in cryosparc2_compute.jobs.ctf_estimation.patchctf.patchctf
  File "cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation/patchctf.py", line 182, in cryosparc2_compute.jobs.ctf_estimation.patchctf.patchctf
  File "cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation/patchctf.py", line 172, in cryosparc2_compute.jobs.ctf_estimation.patchctf.patchctf.estimate_bg_hack
IndexError: index 0 is out of bounds for axis 0 with size 0

Does anyone know a work around for this? It’s preventing me from using cryoSPARC Live for this type of acquisition.

Hi @hansenbry,

Was this image captured at a low magnification?
If so, this is a bug we’ve reproduced, and we’ve fixed it in the patch file provided below.

To apply this patch, you’re going to have to do the following:

Download the file from our AWS S3 bucket here:
https://structura-assets.s3.amazonaws.com/patch_ctf_v2.14_low_mag_bg_bugfix/patchctf.so

e.g. Download directly or use wget via the command line:

wget https://structura-assets.s3.amazonaws.com/patch_ctf_v2.14_low_mag_bg_bugfix/patchctf.so

Replace the file in the following folder on the cryoSPARC worker node(s):
cryosparc2_worker/cryosparc2_compute/jobs/ctf_estimation

Then try running the same job again, and you should be good to go!

Please note that this fix will be included in all future versions of cryoSPARC.

Please let me know if you have any questions, and please let me know if this patch works for you.

@stephan thanks I’ll give that a try. It’s not super low mag, but a 2.94 A pixel size.

@stephan I pulled the new .so and replaced it in the folder, and I’m still getting the error

@hansenbry can you confirm that you replaced this file in all worker installations for your instance? (it’s also fine if you replaced the file in the master installations but it is not used there)

@apunjani yes I replaced it ones, then I wasn’t sure if it over wrote the file in the worker install so I deleted the .so file and did another pull from wget and moved it into the folder and tried again. Still yields the same error.

Hi @hansenbry,

Is there any way you can send us a micrograph that fails so we can create a better fix? If this is possible, I’d be happy to send you credentials to our file server so that you can upload a micrograph there.

@stephan I can’t give any info about the image, but I can share 1 or 2 for you to test with

That’d be great @hansenbry,

I’d just need enough info to get CTF Estimation working (the 4 microscope parameters for the Import Micrographs job). I’m going to DM you the credentials now.

UPDATING THIS THREAD:
After speaking with OP, it turns out the patch did correctly fix this error- it is released in cryoSPARC v2.15.0. If you are on this version, there is no need to install the patch file linked above.