Opened 5 years ago

#3893 assigned enhancement

Make EMDB fetch display author suggested contour level

Reported by: Tom Goddard Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Volume Data Version:
Keywords: Cc: pett
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Eric uses the following code to fetch the EMDB XML meta data to get the author suggested contour level for NIH 3D scripts. Would be good if ChimeraX automatically did this. A few EMDB entries where the default ChimeraX contour level is poor (too high) are EMD 1385 and 2770 (randomly chosen by Eric).

       import requests
       data_key = "EMD-" + emdb_id
       response = requests.get('https://www.ebi.ac.uk/pdbe/api/emdb/entry/map/%s' % data_key)
       if response.status_code == requests.codes.ok:
           data = response.json()
           try:
               info = data[data_key]
           except KeyError:
               error("Key %s not found in metadata for %s" % (data_key, emdb_id))
           else:
               try:
                   contour_level = info[0]['map']['contour_level']['value']
               except:
                   warn("No suggested contour level found in metadata for %s" % emdb_id)
               else:
                   note("Using EMDB-recommended contour level of %g" % contour_level)
       else:
           warn("Could not access metadata for EMDB entry %s" % emdb_id)

Change History (0)

Note: See TracTickets for help on using tickets.