Import from EMDB fails, likely due to API returning unexpected schema

There appears to be a bug in the EMDB import process, a user has run into the following job failure when they try to import from EMDB:

Attempting to load 1 entry from EMDB
Loading details for EMD-13310
  Unable to connect to EMDB server
Compiling job outputs...
Updating job size...
Exporting job and creating csg files...

I’ve verified that I can curl from the cryoSPARC master, so it does not seem to be an inability to connect to the EMDB API.

In digging into the code in cryosparc_compute/jobs/imports/ that does EMDB imports, it looks like the error Unable to connect to EMDB server is a generic catch-all for any type of exception that occurs when processing the API JSON response data.

However, while examining the EMDB response handling, I noticed this block of code, where entry is the data from the API’s JSON response:

data = response.json()
entry = data[entry_id][0]
rc.log(f"  Title: {entry['deposition']['title']}")
rc.log(f"  Authors: {entry['deposition']['authors']}")
rc.log(f"  Deposition date: {entry['deposition']['deposition_date']}")
rc.log(f"  Release date: {entry['deposition']['map_release_date']}")
rc.log(f"  Entry version: {entry['version']}")
rc.log(f"  Resolution: {entry['processing']['reconstruction']['resolution_by_author']}<C3><85>")
rc.log(f"  Size: {int(entry['map']['file']['size_kb'])/float(1<<10):.2f} MB")
rc.log(f"  Contour level: {entry['map']['contour_level']['value']}")
rc.log(f"  URL:{entry_id}")

When compared to the JSON output of, and to the API reference at, it appears that cryoSPARC might be expecting an older version of the API. For instance, what cryoSPARC is expecting under the deposition key seems to exist under the admin key in the API, and has a fairly different schema. This appears to be the source of the problem- import is failing due to an exception being thrown when trying to read the response JSON.

1 Like

@stephan Is this a bug that is expected to be resolved soon? We are experiencing the same issue on both of our CS4 instances.

Hi @bmdennis, thanks for investigating for us :smile:

@nis_it this will be fixed in the next release of CryoSPARC- sorry for the wait!

1 Like