Class PdbeCcp4MapProvider

java.lang.Object
org.biojava.nbio.structure.io.density.AbstractDensityMapProvider
org.biojava.nbio.structure.io.density.PdbeCcp4MapProvider
All Implemented Interfaces:
DensityMapProvider

public class PdbeCcp4MapProvider extends AbstractDensityMapProvider
Fetches PDBe's pre-computed CCP4 maps.

These are full-resolution sampled grids, one file per map kind, and are the source Jmol itself uses for its built-in map shortcuts. They are larger than a density-server slice — about 1 MB per map for a small entry such as 1cbs — but need no interpretation beyond contouring.

The service accepts only the lower-case four-character spelling of an identifier; 1CBS.ccp4 and pdb_00001cbs.ccp4 both return HTTP 404. Entries deposited without structure factors, and cryo-EM entries, have no maps here at all.

Since:
7.3.0
Author:
Amr ALHOSSARY
  • Field Details

    • DEFAULT_SERVER_URL

      public static final String DEFAULT_SERVER_URL
      Default base URL of the PDBe map service.
      See Also:
    • ALTERNATIVE_SERVER_URL

      public static final String ALTERNATIVE_SERVER_URL
      An equivalent base URL serving the same files, kept in the documentation as a ready alternative should the primary one change.
      See Also:
    • DEFAULT_TWO_FO_FC_TEMPLATE

      public static final String DEFAULT_TWO_FO_FC_TEMPLATE
      Default path template for the 2mFo-DFc map.
      See Also:
    • DEFAULT_FO_FC_TEMPLATE

      public static final String DEFAULT_FO_FC_TEMPLATE
      Default path template for the mFo-DFc difference map.
      See Also:
  • Constructor Details

    • PdbeCcp4MapProvider

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

    • getServerBaseUrl

      public static String getServerBaseUrl()
      Returns:
      the base URL of the map service
    • setServerBaseUrl

      public static void setServerBaseUrl(String url)
      Parameters:
      url - the base URL of the map service; a trailing slash is added if missing
    • setPathUrlTemplate

      public static void setPathUrlTemplate(DensityMapKind kind, String template)
      Overrides the path template for a map kind.
      Parameters:
      kind - DensityMapKind.TWO_FO_FC or DensityMapKind.FO_FC
      template - a template understood by UrlTemplates
    • resetToDefaults

      public static void resetToDefaults()
      Restores the default server and templates.
    • getSource

      public DensityMapSource getSource()
      Returns:
      which service this provider talks to
    • getFormat

      public DensityFileFormat getFormat()
      Returns:
      the format this provider delivers
    • supports

      public boolean supports(DensityMapKind kind)
      Description copied from interface: DensityMapProvider
      Whether this provider can serve a given kind of map at all. Used to skip requests that could not possibly succeed, such as asking an X-ray map service for a cryo-EM map.
      Specified by:
      supports in interface DensityMapProvider
      Overrides:
      supports in class AbstractDensityMapProvider
      Parameters:
      kind - the kind of map wanted
      Returns:
      true if it is worth trying
    • buildUrl

      public String buildUrl(PdbId pdbId, DensityMapKind kind)
      Builds the URL for a map without fetching it.
      Parameters:
      pdbId - the entry
      kind - the kind of map
      Returns:
      the URL as a string
    • fetch

      public DensityMapResult fetch(DensityMapRequest request) throws IOException
      Description copied from interface: DensityMapProvider
      Fetches a map, using the cache if the request's fetch behaviour allows.
      Parameters:
      request - what is wanted. Its kind is always concrete, never DensityMapKind.AUTO.
      Returns:
      the map, or null if this service has nothing for the entry
      Throws:
      IOException - on transport failure; use HttpStatusException so that a missing resource can be told apart from a broken connection