Class WwpdbMapCoefficientsProvider

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

public class WwpdbMapCoefficientsProvider extends AbstractDensityMapProvider
Fetches the map coefficients published alongside the wwPDB validation reports.

These are not density maps. They are structure-factor amplitudes and phases in mmCIF, exactly as used to produce the pictures in a validation report, and a Fourier transform is required before anything can be drawn from them — gemmi sf2map, or cif2mtz followed by CCP4's fft. Nothing in BioJava or Jmol will render them.

They are supported because this is the route RCSB documents since edmaps.rcsb.org was shut down in October 2024, and because they are the authoritative archival form. For anything that needs to be displayed, prefer PdbeCcp4MapProvider or VolumeServerProvider. Accordingly this source is disabled by default in DensityMapCache.

One useful property: these servers return the content MD5 as the HTTP ETag, so downloads from here are checksum-verified automatically.

The URLs are built against the documented download endpoint, which resolves an entry by file name, rather than against the divided archive path. This is the only provider here that ever had a choice — the density servers and the EMDB archive are addressed by identifier already — and it matters because the PDB moves to extended identifiers and a per-entry directory layout in July 2027. A name survives that move; a constructed directory path does not. Mirrors that publish directories instead of an endpoint are still reachable, through DIVIDED_TWO_FO_FC_TEMPLATE and ENTRIES_TWO_FO_FC_TEMPLATE.

Since:
7.3.0
Author:
Amr ALHOSSARY
  • Field Details

    • DEFAULT_SERVER_URL

      public static final String DEFAULT_SERVER_URL
      Default base URL, the wwPDB validation report download endpoint.
      See Also:
    • RCSB_MIRROR_URL

      public static final String RCSB_MIRROR_URL
      An RCSB mirror serving byte-identical files.
      See Also:
    • BETA_SERVER_URL

      public static final String BETA_SERVER_URL
      The wwPDB beta archive, which already holds the re-organised content that replaces the current archive on 21 July 2027 and serves the same endpoint.

      Deliberately not the default, despite being the newer archive. The wwPDB describes this host as transitional: on the cutover date the beta archive replaces the main one, after which the beta URL is supported by redirection for three years. So it is the hostname that needs changing, twice, whereas DEFAULT_SERVER_URL becomes the new archive and needs changing never.

      Its value is in testing. Because this host is the post-2027 content today, a request against it checks the endpoint against the archive as it will be, rather than against the archive as it is.

      See Also:
    • EBI_MIRROR_URL

      public static final String EBI_MIRROR_URL
      An EBI mirror serving byte-identical files.

      Unlike the two above, EBI publishes no name-resolving endpoint — only full directory paths — so selecting it means setting the divided templates as well:

       setServerBaseUrl(EBI_MIRROR_URL);
       setPathUrlTemplate(DensityMapKind.TWO_FO_FC, DIVIDED_TWO_FO_FC_TEMPLATE);
       setPathUrlTemplate(DensityMapKind.FO_FC, DIVIDED_FO_FC_TEMPLATE);
       
      Setting the base alone yields 404s, because the flat file names do not exist there.
      See Also:
    • DEFAULT_TWO_FO_FC_TEMPLATE

      public static final String DEFAULT_TWO_FO_FC_TEMPLATE
      Default path template for the 2mFo-DFc coefficients: the file name alone.

      The endpoint resolves an entry by name, so no directory path is built here. That is deliberate. In July 2027 the archive moves to extended identifiers and a per-entry directory layout, and a path assembled from a hash and an identifier would have to be rewritten for it; a name does not. Both spellings of an identifier resolve, so whichever PdbId yields is accepted.

      See Also:
    • DEFAULT_FO_FC_TEMPLATE

      public static final String DEFAULT_FO_FC_TEMPLATE
      Default path template for the mFo-DFc coefficients; see DEFAULT_TWO_FO_FC_TEMPLATE.
      See Also:
    • DIVIDED_TWO_FO_FC_TEMPLATE

      public static final String DIVIDED_TWO_FO_FC_TEMPLATE
      Path template for the 2mFo-DFc coefficients in the divided archive, for mirrors that publish directories rather than an endpoint.
      See Also:
    • DIVIDED_FO_FC_TEMPLATE

      public static final String DIVIDED_FO_FC_TEMPLATE
      Path template for the mFo-DFc coefficients in the divided archive.
      See Also:
    • ENTRIES_TWO_FO_FC_TEMPLATE

      public static final String ENTRIES_TWO_FO_FC_TEMPLATE
      Path template for the 2mFo-DFc coefficients in the per-entry archive that replaces the divided one in July 2027, relative to a base URL ending in .../pdb/data/.

      Provided so that a mirror of the new layout can be used the day it exists, without waiting for a release.

      See Also:
    • ENTRIES_FO_FC_TEMPLATE

      public static final String ENTRIES_FO_FC_TEMPLATE
      Path template for the mFo-DFc coefficients in the per-entry archive.
      See Also:
  • Constructor Details

    • WwpdbMapCoefficientsProvider

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

    • getServerBaseUrl

      public static String getServerBaseUrl()
      Returns:
      the base URL of the validation report archive
    • setServerBaseUrl

      public static void setServerBaseUrl(String url)
      Parameters:
      url - the base URL; 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 set of coefficients without fetching them.
      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