public class SubstructureIdentifier extends Object implements StructureIdentifier
The current syntax allows the specification of a set of residues from the first model of a structure. Future versions may be extended to represent additional properties.
Identifiers should adhere to the following specification, although some additional forms may be tolerated where unambiguous for backwards compatibility.
name := pdbID | pdbID '.' chainID | pdbID '.' range range := range (',' range)? | chainID | chainID '_' resNum '-' resNum pdbID := [0-9][a-zA-Z0-9]{3} chainID := [a-zA-Z0-9]+ resNum := [-+]?[0-9]+[A-Za-z]?For example:
1TIM #whole structure 1tim #same as above 4HHB.C #single chain 3AA0.A,B #two chains 4GCR.A_1-40 #substructure 3iek.A_17-28,A_56-294,A_320-377 #substructure of 3 disjoint partsMore options may be added to the specification at a future time.
Constructor and Description |
---|
SubstructureIdentifier(String id)
Create a new identifier from a string.
|
SubstructureIdentifier(String pdbId,
List<ResidueRange> ranges)
Create a new identifier based on a set of ranges.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
copyLigandsByProximity(Structure full,
Structure reduced)
Supplements the reduced structure with ligands from the full structure based on
a distance cutoff.
|
protected static void |
copyLigandsByProximity(Structure full,
Structure reduced,
double cutoff,
int fromModel,
int toModel)
Supplements the reduced structure with ligands from the full structure based on
a distance cutoff.
|
String |
getIdentifier()
Get the String form of this identifier.
|
String |
getPdbId() |
List<ResidueRange> |
getResidueRanges() |
Structure |
loadStructure(AtomCache cache)
Loads the complete structure based on
getPdbId() . |
Structure |
reduce(Structure s)
Takes a complete structure as input and reduces it to residues present in
the specified ranges
The returned structure will be a shallow copy of the input, with shared
Chains, Residues, etc.
|
SubstructureIdentifier |
toCanonical()
Return itself.
|
String |
toString() |
public SubstructureIdentifier(String id)
id
- public SubstructureIdentifier(String pdbId, List<ResidueRange> ranges)
pdbId
- ranges
- public String getIdentifier()
getIdentifier
in interface StructureIdentifier
public List<ResidueRange> getResidueRanges()
public SubstructureIdentifier toCanonical()
toCanonical
in interface StructureIdentifier
public Structure reduce(Structure s) throws StructureException
The returned structure will be a shallow copy of the input, with shared Chains, Residues, etc.
Ligands are handled in a special way. If a full chain is selected
(e.g. '1ABC.A') then any waters and ligands with matching chain name are
included. If a residue range is present ('1ABC.A:1-100') then any
ligands (technically non-water non-polymer atoms) within
StructureTools.DEFAULT_LIGAND_PROXIMITY_CUTOFF
of the selected
range are included, regardless of chain.
reduce
in interface StructureIdentifier
input
- A full structure, e.g. as loaded from the PDB. The structure
ID should match that returned by getPdbId().StructureException
StructureTools.getReducedStructure(Structure, String)
public Structure loadStructure(AtomCache cache) throws IOException, StructureException
getPdbId()
.loadStructure
in interface StructureIdentifier
AtomCache
- A source of structuresStructureException
- For errors loading and parsing the structureIOException
- Errors reading the structure from diskprotected static void copyLigandsByProximity(Structure full, Structure reduced)
default cutoff
is used.full
- Structure containing all ligandsreduced
- Structure with a subset of the polymer groups from fullStructureTools.getLigandsByProximity(java.util.Collection, Atom[], double)
protected static void copyLigandsByProximity(Structure full, Structure reduced, double cutoff, int fromModel, int toModel)
full
- Structure containing all ligandsreduced
- Structure with a subset of the polymer groups from fullcutoff
- Distance cutoff (Å)fromModel
- source model in fulltoModel
- destination model in reducedStructureTools.getLigandsByProximity(java.util.Collection, Atom[], double)
Copyright © 2000–2018 BioJava. All rights reserved.