Class DownloadChemCompProvider

  • All Implemented Interfaces:
    ChemCompProvider

    public class DownloadChemCompProvider
    extends java.lang.Object
    implements ChemCompProvider
    This provider of chemical components can download and cache chemical component definition files from the RCSB PDB web site. It is the default way to access these definitions. If this provider is called he first time, it will download and install all chemical component definitions in a local directory. Once the definition files have been installed, it has quick startup time and low memory requirements. An alternative provider, that keeps all definitions in memory is the AllChemCompProvider. Another provider, that does not require any network access, but only can support a limited set of chemical component definitions, is the ReducedChemCompProvider.
    Author:
    Andreas Prlic
    • Field Detail

      • CHEM_COMP_CACHE_DIRECTORY

        public static final java.lang.String CHEM_COMP_CACHE_DIRECTORY
        See Also:
        Constant Field Values
      • DEFAULT_SERVER_URL

        public static final java.lang.String DEFAULT_SERVER_URL
        See Also:
        Constant Field Values
      • DEFAULT_CHEMCOMP_PATHURL_TEMPLATE

        public static final java.lang.String DEFAULT_CHEMCOMP_PATHURL_TEMPLATE
        See Also:
        Constant Field Values
      • serverBaseUrl

        public static java.lang.String serverBaseUrl
        The base URL to which the full path specified via setChemCompPathUrlTemplate(String) is appended. It is assumed that it has a trailing slash.
    • Constructor Detail

      • DownloadChemCompProvider

        public DownloadChemCompProvider()
      • DownloadChemCompProvider

        public DownloadChemCompProvider​(java.lang.String cacheFilePath)
    • Method Detail

      • setServerBaseUrl

        public static void setServerBaseUrl​(java.lang.String serverBaseUrl)
        Set the base URL for the location of all chemical component CIF files, to which the chemCompPathUrlTemplate is appended, settable in setChemCompPathUrlTemplate(String). A trailing slash is appended if not present.
      • setChemCompPathUrlTemplate

        public static void setChemCompPathUrlTemplate​(java.lang.String chemCompPathUrlTemplate)
        Set the path to append to the serverBaseUrl (settable in setServerBaseUrl(String)). The string can contain placeholders that will be expanded at runtime:
      • "{ccd_id}" to be replaced by the chemical component identifier, in capitals
      • "{ccd_id:beginIndex-endIndex}" to be replaced by a substring of the chemical component identifier in capitals, with indices following the same convention as String.substring(int, int)
      • "{ccd_id:index}" to be replaced by a substring of the chemical component identifier in capitals, with index either a positive or negative integer to substring from left or right of the string respectively.
      • If any of the indices are off-bounds, then the full chemical component identifier is replaced