Class PDBStatus


  • public class PDBStatus
    extends Object
    Methods for getting the status of a PDB file (current, obsolete, etc) and for accessing different versions of the structure.

    All methods query the PDB website.

    PDB supersessions form a directed acyclic graph, where edges point from an obsolete ID to the entry that directly superseded it. For example, here are edges from one portion of the graph:
    1CAT -> 3CAT
    3CAT -> 7CAT
    3CAT -> 8CAT

    The methods getReplaces(pdbId, false)/ getReplacement(pdbId, false, true) just get the incoming/outgoing edges for a single node. The recursive versions (getReplaces(pdbId, true), getReplacement(pdbId, true, false)) will do a depth-first search up/down the tree and return a list of all nodes ] reached.

    Finally, the getCurrent() method returns a single PDB ID from among the results of getReplacement(pdbId, true). To be consistent with the old REST ordering, this is the PDB ID that occurs last alphabetically.

    Results are cached to reduce server load.

    Since:
    3.0.2
    Author:
    Spencer Bliven , Amr AL-Hossary
    • Method Detail

      • getStatus

        public static PDBStatus.Status getStatus​(String pdbId)
        Get the status of the PDB in question.
        Parameters:
        pdbId -
        Returns:
        The status, or null if an error occurred.
      • getStatus

        public static PDBStatus.Status[] getStatus​(String[] pdbIds)
        Get the status of the a collection of PDBs in question in a single query.
        Parameters:
        pdbIds -
        Returns:
        The status array, or null if an error occurred.
        See Also:
        getStatus(String)
      • getCurrent

        public static String getCurrent​(String oldPdbId)
        Gets the current version of a PDB ID. This is equivalent to selecting the first element from getReplacement(String,boolean,boolean)
        Parameters:
        oldPdbId -
        Returns:
        The replacement for oldPdbId, or null if none are found or if an error occurred.
      • getReplacement

        public static List<StringgetReplacement​(String oldPdbId,
                                                  boolean recurse,
                                                  boolean includeObsolete)
        Gets the PDB which superseded oldPdbId. For CURRENT IDs, this will be itself. For obsolete IDs, the behavior depends on the recursion parameter. If false, only IDs which directly supersede oldPdbId are returned. If true, the replacements for obsolete records are recursively fetched, yielding a list of all current replacements of oldPdbId.
        Parameters:
        oldPdbId - A pdb ID
        recurse - Indicates whether the replacements for obsolete records should be fetched.
        includeObsolete - Indicates whether obsolete records should be included in the results.
        Returns:
        The PDB which replaced oldPdbId. This may be oldPdbId itself, for current records. A return value of null indicates that the ID has been removed from the PDB or that an error has occurred.
      • getReplaces

        public static List<StringgetReplaces​(String newPdbId,
                                               boolean recurse)
        Get the ID of the protein which was made obsolete by newPdbId.
        Parameters:
        newPdbId - PDB ID of the newer structure
        recurse - If true, return all ancestors of newPdbId. Otherwise, just go one step newer than oldPdbId.
        Returns:
        A (possibly empty) list of ID(s) of the ancestor(s) of newPdbId, or null if an error occurred.
      • clearCache

        public static void clearCache()
        The status of PDB IDs are cached to reduce server overload. This method clears the cached records.