Class EmdbEntryResolver

java.lang.Object
org.biojava.nbio.structure.io.density.EmdbEntryResolver

public class EmdbEntryResolver extends Object
Finds the EMDB entry, if any, associated with a PDB entry, and reads the few facts about its map that are needed to fetch and display it.

The primary lookup is EMDB's own search API, which returns the identifier and the author-recommended contour level together in a single small CSV response. That is also the route Jmol uses, so BioJava's answer matches what a user sees elsewhere. If it fails, RCSB's entry API is consulted for the identifier alone.

The experimental method is deliberately not inferred from a structure's resolution: BioJava is known to mis-parse resolution for some cryo-EM entries (biojava/biojava#1000), so the presence of an EMDB identifier is the reliable signal.

Answers are cached on disk. Under LocalPDBDirectory.FetchBehavior.LOCAL_ONLY the cached answer is used whatever its age and no connection is opened.

Since:
7.3.0
Author:
Amr ALHOSSARY
  • Field Details

    • DEFAULT_SEARCH_URL_TEMPLATE

      public static final String DEFAULT_SEARCH_URL_TEMPLATE
      Default template for the EMDB search that maps a PDB entry to the EM reconstructions it was fitted into, returning the contour level as well.
      See Also:
    • DEFAULT_MAP_INFO_URL_TEMPLATE

      public static final String DEFAULT_MAP_INFO_URL_TEMPLATE
      Default template for the EMDB entry map metadata.
      See Also:
    • DEFAULT_RCSB_ENTRY_URL_TEMPLATE

      public static final String DEFAULT_RCSB_ENTRY_URL_TEMPLATE
      Default template for the RCSB entry record, used as a fallback.
      See Also:
  • Constructor Details

    • EmdbEntryResolver

      public EmdbEntryResolver(File cacheRoot)
      Parameters:
      cacheRoot - the BioJava cache directory
  • Method Details

    • setCacheRoot

      public void setCacheRoot(File cacheRoot)
      Parameters:
      cacheRoot - the BioJava cache directory
    • setFetchBehavior

      public void setFetchBehavior(LocalPDBDirectory.FetchBehavior fetchBehavior)
      Parameters:
      fetchBehavior - how aggressively to refresh cached answers
    • setMappingMaxAgeDays

      public void setMappingMaxAgeDays(int days)
      Parameters:
      days - how long a cached mapping stays fresh. Mappings change only when an entry is re-released, so this can be generous.
    • setSearchUrlTemplate

      public static void setSearchUrlTemplate(String template)
      Parameters:
      template - the EMDB search URL template
    • setMapInfoUrlTemplate

      public static void setMapInfoUrlTemplate(String template)
      Parameters:
      template - the EMDB map metadata URL template
    • setRcsbEntryUrlTemplate

      public static void setRcsbEntryUrlTemplate(String template)
      Parameters:
      template - the RCSB entry URL template used as a fallback
    • resetToDefaults

      public static void resetToDefaults()
      Restores all default URL templates.
    • getEmdbIds

      public List<String> getEmdbIds(PdbId pdbId)
      The EMDB entries a PDB entry was fitted into.
      Parameters:
      pdbId - the PDB entry
      Returns:
      the EMDB identifiers, most relevant first; empty if the entry is not an EM structure or has no associated map
    • getContourLevelFor

      public Double getContourLevelFor(PdbId pdbId)
      The contour level the depositors recommend for the map a PDB entry was fitted into, as reported by the EMDB search.
      Parameters:
      pdbId - the PDB entry
      Returns:
      the level in absolute map units, or null if unknown
    • getEntryInfo

      public EmdbEntryInfo getEntryInfo(String emdbId)
      Reads an EMDB entry's map metadata: contour level, RMS deviation and the size of the primary map file.

      The response is cached verbatim, so asking twice costs one request.

      Parameters:
      emdbId - the EMDB entry, in any accepted form
      Returns:
      the metadata, or null if it could not be obtained