Class StructureName

    • Constructor Detail

      • StructureName

        public StructureName​(String name)
        Create a new StructureName from the given identifier, which may be a domain name, a substructure identifier, etc.

        The source and PDB-Id are extracted at compile time, but fully interpreting the ID, which may require additional parsing or remote calls, is done lazily.

        The following sources are supported. Any may be prefixed by the source name followed by a colon (e.g. PDB:4HHB). In this case, that source will be used unequivocally. If no source is specified, StructureName will make a (usually reliable) guess as to which source was intended.

        • PDBPDB identifier, optionally followed by chain and/or residue ranges. Internally represented by a SubstructureIdentifier; see that class for the full format specification. Examples: 4hhb, 4hhb.A, 4hhb.A:1-50.
        • SCOP SCOP domain (or SCOPe, depending on the ScopFactory.getSCOP() version). Example: d1h6w.2
        • CATH Cath domains. Example: 1qvrC03
        • URL Arbitrary URLs. Most common protocols are handled, including http://, ftp://, and file://. Some parsing information can be passed as custom query parameters. Example:
        • FILE A file path. Supports relative paths and expands ~ to the user's home directory. Only existing files will be automatically detected; to refer to a potentially not-yet existing file, prepend the prefix. Internally represented as a URLIdentifier after path expansion. Example: ~/custom_protein.pdb
        • ECOD ECOD domain. Example: e1lyw.1
        • BIO Biological assembly. These are not guessed, making the BIO: prefix obligatory. Example: BIO:2ehz:1
        name - An identifier string
        IllegalArgumentException - if the name has a recognizable source but is semantically invalid
    • Method Detail

      • getChainId

        public String getChainId()
        Gets the chain ID, for structures where it is unique and well-defined. May return '.' for multi-chain ranges, '_' for wildcard chains, or null if the information is unavailable.

        This method should only be used casually. For precise chainIds, it is better to use toCanonical() and iterate through the residue ranges.

      • isPdbId

        public boolean isPdbId()
      • isURL

        public boolean isURL()
      • isFile

        public boolean isFile()
        Indicates that the identifier was determined to correspond to a file. Note that some file identifiers may also be valid URLs; in that case, the URL source is preferred.
      • getBaseIdentifier

        public StructureIdentifier getBaseIdentifier()
                                              throws StructureException
        StructureName wraps another StructureIdentifier. The type of the base identifier depends on the source. Most StructureName methods deligate to the base identifier.

        It is possible that future versions of StructureName might change the return type. Except for some specialized uses, it is probably better to create the correct type of identifier directly, rather than creating a StructureName and casting the result of this method.

        A Str
        StructureException - Wraps exceptions that may be thrown by individual implementations. For example, a SCOP identifier may require that the domain definitions be available for download.
      • reduce

        public Structure reduce​(Structure input)
                         throws StructureException
        Description copied from interface: StructureIdentifier
        Takes a complete structure as input and reduces it to the substructure represented by this StructureIdentifier.

        The returned structure may be a shallow copy of the input, with shared Chains, Residues, etc.

        Specified by:
        reduce in interface StructureIdentifier
        input - A full structure, e.g. as loaded from the PDB. The structure ID should match that returned by getPdbId(), if applicable.
        See Also:
        StructureTools#getReducedStructure(Structure, String)
      • guessScopDomain

        public static ScopDomain guessScopDomain​(String name,
                                                 ScopDatabase scopDB)

        Guess a scop domain. If an exact match is found, return that.

        Otherwise, return the first scop domain found for the specified protein such that

        • The chains match, or one of the chains is '_' or '.'.
        • The domains match, or one of the domains is '_'.
        In some cases there may be several valid matches. In this case a warning will be logged.
        name - SCOP domain name, or a guess thereof
        scopDB - SCOP domain provider
        The best match for name among the domains of scopDB, or null if none match.