Package org.biojava.nbio.structure
Class URLIdentifier
java.lang.Object
org.biojava.nbio.structure.URLIdentifier
- All Implemented Interfaces:
StructureIdentifier
Represents a structure loaded from a URL (including a file URL)
A few custom query parameters are supported:
- format=[pdb|cif] Specify the file format (will otherwise be guessed from the extension)
- pdbId=[String] Specify the PDB ID (also guessed from the filename)
- chainID=[String] A single chain from the structure
- residues=[String] Residue ranges, in a form understood by
SubstructureIdentifier
- Author:
- Spencer Bliven
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
URL parameter specifying a single chain to include; overridden by residuesstatic final String
URL parameter specifying the file format (PDB or CIF)static final String
URL parameter specifying the PDB IDstatic final String
URL parameter specifying residue ranges to include, e.g. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the String form of this identifier.getURL()
static String
guessPDBID
(String name) Recognizes PDB IDs that occur at the beginning of name followed by some delimiter.loadStructure
(AtomCache cache) Load the structure from the URLTakes a complete structure as input and reduces it to the substructure represented by this StructureIdentifier.Convert to a canonical SubstructureIdentifier.
-
Field Details
-
FORMAT_PARAM
URL parameter specifying the file format (PDB or CIF)- See Also:
-
PDBID_PARAM
URL parameter specifying the PDB ID- See Also:
-
CHAINID_PARAM
URL parameter specifying a single chain to include; overridden by residues- See Also:
-
RESIDUES_PARAM
URL parameter specifying residue ranges to include, e.g. residues=A:1-70- See Also:
-
-
Constructor Details
-
URLIdentifier
-
URLIdentifier
- Throws:
MalformedURLException
-
-
Method Details
-
getURL
-
getIdentifier
Description copied from interface:StructureIdentifier
Get the String form of this identifier. It is recommended that the#toString()
method also return the identifier, for consistency during serialization.- Specified by:
getIdentifier
in interfaceStructureIdentifier
- Returns:
- The String form of this identifier
-
toCanonical
Description copied from interface:StructureIdentifier
Convert to a canonical SubstructureIdentifier.This allows all domains to be converted to a standard format String.
- Specified by:
toCanonical
in interfaceStructureIdentifier
- Returns:
- A SubstructureIdentifier without ranges (e.g. including all residues)
-
reduce
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 interfaceStructureIdentifier
- Parameters:
input
- A full structure, e.g. as loaded from the PDB. The structure ID should match that returned by getPdbId(), if applicable.- Returns:
- Throws:
StructureException
- See Also:
-
loadStructure
Load the structure from the URL- Specified by:
loadStructure
in interfaceStructureIdentifier
- Returns:
- null
- Throws:
StructureException
- For errors loading and parsing the structureIOException
- Errors reading the structure from disk
-
guessPDBID
Recognizes PDB IDs that occur at the beginning of name followed by some delimiter.- Parameters:
name
- Input filename- Returns:
- A 4-character id-like string, or null if none is found
-