Class DensityMapRequest

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

public class DensityMapRequest extends Object
A request for a density map, describing what is wanted and how hard to look for it.

Instances are immutable; build them with builder(PdbId) or builder(String).

Since:
7.3.0
Author:
Amr ALHOSSARY
  • Method Details

    • builder

      public static DensityMapRequest.Builder builder(PdbId pdbId)
      Starts a request for a PDB entry.
      Parameters:
      pdbId - the entry
      Returns:
      a new builder
    • builder

      public static DensityMapRequest.Builder builder(String id)
      Starts a request from an identifier string. An identifier beginning with EMD- (case-insensitively) is taken as an EMDB entry, anything else as a PDB entry.
      Parameters:
      id - a PDB or EMDB identifier
      Returns:
      a new builder
    • normalizeEmdbId

      public static String normalizeEmdbId(String emdbId)
      Normalises an EMDB identifier to the canonical EMD-1234 form.
      Parameters:
      emdbId - an identifier such as emd-1234, EMD_1234 or a bare number
      Returns:
      the canonical form
    • emdbNumber

      public static String emdbNumber(String emdbId)
      Extracts the numeric part of an EMDB identifier, as used in file names and some URL templates.
      Parameters:
      emdbId - an EMDB identifier in any accepted form
      Returns:
      the digits, without the EMD- prefix
    • getPdbId

      public PdbId getPdbId()
      Returns:
      the PDB entry requested, or null for an EMDB-only request
    • getEmdbId

      public String getEmdbId()
      Returns:
      the EMDB entry, if known or explicitly requested; otherwise null
    • getKind

      public DensityMapKind getKind()
      Returns:
      the kind of map wanted; never null
    • getFetchBehavior

      public LocalPDBDirectory.FetchBehavior getFetchBehavior()
      Returns:
      how aggressively to re-fetch, or null to use the cache's setting
    • getCacheDir

      public File getCacheDir()
      Returns:
      an override for the cache directory, or null to use the cache's own
    • isAllowNonRenderableFormats

      public boolean isAllowNonRenderableFormats()
      Whether sources that deliver something a viewer cannot contour directly — currently only map coefficients — may be used.
      Returns:
      true by default; a viewer should set it to false
    • getMaxDownloadBytes

      public long getMaxDownloadBytes()
      Returns:
      the download size limit in bytes, or 0 for no limit
    • getSourceChain

      public List<DensityMapSource> getSourceChain()
      Returns:
      an explicit source order, or null to let the cache choose
    • withKind

      public DensityMapRequest withKind(DensityMapKind newKind)
      Returns a copy of this request with a different map kind, used when expanding DensityMapKind.AUTO.
      Parameters:
      newKind - the kind to use
      Returns:
      a new request
    • withEmdbId

      public DensityMapRequest withEmdbId(String newEmdbId)
      Returns a copy of this request with the EMDB entry filled in.
      Parameters:
      newEmdbId - the EMDB identifier
      Returns:
      a new request
    • toString

      public String toString()
      Overrides:
      toString in class Object