Package org.biojava.nbio.structure
Class URLIdentifier
- java.lang.Object
- 
- org.biojava.nbio.structure.URLIdentifier
 
- 
- All Implemented Interfaces:
- Serializable,- StructureIdentifier
 
 public class URLIdentifier extends Object implements 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
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCHAINID_PARAMURL parameter specifying a single chain to include; overridden by residuesstatic StringFORMAT_PARAMURL parameter specifying the file format (PDB or CIF)static StringPDBID_PARAMURL parameter specifying the PDB IDstatic StringRESIDUES_PARAMURL parameter specifying residue ranges to include, e.g.
 - 
Constructor SummaryConstructors Constructor Description URLIdentifier(String url)URLIdentifier(URL url)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetIdentifier()Get the String form of this identifier.URLgetURL()static StringguessPDBID(String name)Recognizes PDB IDs that occur at the beginning of name followed by some delimiter.StructureloadStructure(AtomCache cache)Load the structure from the URLStructurereduce(Structure input)Takes a complete structure as input and reduces it to the substructure represented by this StructureIdentifier.SubstructureIdentifiertoCanonical()Convert to a canonical SubstructureIdentifier.
 
- 
- 
- 
Field Detail- 
FORMAT_PARAMpublic static final String FORMAT_PARAM URL parameter specifying the file format (PDB or CIF)- See Also:
- Constant Field Values
 
 - 
PDBID_PARAMpublic static final String PDBID_PARAM URL parameter specifying the PDB ID- See Also:
- Constant Field Values
 
 - 
CHAINID_PARAMpublic static final String CHAINID_PARAM URL parameter specifying a single chain to include; overridden by residues- See Also:
- Constant Field Values
 
 - 
RESIDUES_PARAMpublic static final String RESIDUES_PARAM URL parameter specifying residue ranges to include, e.g. residues=A:1-70- See Also:
- SubstructureIdentifier, Constant Field Values
 
 
- 
 - 
Constructor Detail- 
URLIdentifierpublic URLIdentifier(URL url) 
 - 
URLIdentifierpublic URLIdentifier(String url) throws MalformedURLException - Throws:
- MalformedURLException
 
 
- 
 - 
Method Detail- 
getIdentifierpublic String getIdentifier() Description copied from interface:StructureIdentifierGet the String form of this identifier. It is recommended that the#toString()method also return the identifier, for consistency during serialization.- Specified by:
- getIdentifierin interface- StructureIdentifier
- Returns:
- The String form of this identifier
 
 - 
toCanonicalpublic SubstructureIdentifier toCanonical() Description copied from interface:StructureIdentifierConvert to a canonical SubstructureIdentifier.This allows all domains to be converted to a standard format String. - Specified by:
- toCanonicalin interface- StructureIdentifier
- Returns:
- A SubstructureIdentifier without ranges (e.g. including all residues)
 
 - 
reducepublic Structure reduce(Structure input) throws StructureException Description copied from interface:StructureIdentifierTakes 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:
- reducein interface- StructureIdentifier
- 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:
- StructureTools.getReducedStructure(Structure, String)
 
 - 
loadStructurepublic Structure loadStructure(AtomCache cache) throws StructureException, IOException Load the structure from the URL- Specified by:
- loadStructurein interface- StructureIdentifier
- Returns:
- null
- Throws:
- StructureException- For errors loading and parsing the structure
- IOException- Errors reading the structure from disk
 
 - 
guessPDBIDpublic static String guessPDBID(String name) 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
 
 
- 
 
-