Class StructureInterface
- java.lang.Object
-
- org.biojava.nbio.structure.contact.StructureInterface
-
- All Implemented Interfaces:
Serializable
,Comparable<StructureInterface>
public class StructureInterface extends Object implements Serializable, Comparable<StructureInterface>
An interface between 2 molecules (2 sets of atoms).- Author:
- duarte_j
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StructureInterface()
Constructs an empty StructureInterfaceStructureInterface(Atom[] firstMolecule, Atom[] secondMolecule, String firstMoleculeId, String secondMoleculeId, AtomContactSet contacts, CrystalTransform firstTransf, CrystalTransform secondTransf)
Constructs a StructureInterface
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(StructureInterface o)
protected Atom[]
getAtomsForAsa(int cofactorSizeToUse)
StructureInterfaceCluster
getCluster()
double
getContactOverlapScore(StructureInterface other, boolean invert)
Calculates the Jaccard contact set score (intersection over union) between this StructureInterface and the given one.AtomContactSet
getContacts()
Pair<List<Group>>
getCoreResidues(double bsaToAsaCutoff, double minAsaForSurface)
Returns the residues belonging to the interface core, defined as those residues at the interface (BSA>0) and for which the BSA/ASA ratio is above the given bsaToAsaCutoffPair<String>
getCrystalIds()
Returns a pair of identifiers for each of the 2 member molecules that identify them uniquely in the crystal: <molecule id (asym unit id)>+<operator id>+<crystal translation>protected Atom[]
getFirstAtomsForAsa(int cofactorSizeToUse)
GroupAsa
getFirstGroupAsa(ResidueNumber resNum)
Gets the GroupAsa for the corresponding residue number of first chainMap<ResidueNumber,GroupAsa>
getFirstGroupAsas()
Gets a map of ResidueNumbers to GroupAsas for all groups of first chain.GroupContactSet
getGroupContacts()
int
getId()
Pair<List<Group>>
getInterfacingResidues(double minAsaForSurface)
Returns the residues belonging to the interface, i.e. the residues at the surface with BSA>0Pair<String>
getMoleculeIds()
Return the pair of identifiers identifying each of the 2 molecules of this interface in the asymmetry unit (usually the chain identifier if this interface is between 2 chains)Pair<Atom[]>
getMolecules()
Pair<Chain>
getParentChains()
Finds the parent chains by looking up the references of first atom of each side of this interfacePair<EntityInfo>
getParentCompounds()
Finds the parent entities by looking up the references of first atom of each side of this interfacePair<List<Group>>
getRimResidues(double bsaToAsaCutoff, double minAsaForSurface)
Returns the residues belonging to the interface rim, defined as those residues at the interface (BSA>0) and for which the BSA/ASA ratio is below the given bsaToAsaCutoffprotected Atom[]
getSecondAtomsForAsa(int cofactorSizeToUse)
GroupAsa
getSecondGroupAsa(ResidueNumber resNum)
Gets the GroupAsa for the corresponding residue number of second chainMap<ResidueNumber,GroupAsa>
getSecondGroupAsas()
Gets a map of ResidueNumbers to GroupAsas for all groups of second chain.Pair<List<Group>>
getSurfaceResidues(double minAsaForSurface)
Returns the residues belonging to the surfacedouble
getTotalArea()
Returns the total area buried upon formation of this interface, defined as: 1/2[ (ASA1u-ASA1c) + (ASA2u-ASA2u) ] , with:Pair<CrystalTransform>
getTransforms()
Return the 2 crystal transform operations performed on each of the molecules of this interface.boolean
isHomomeric()
Returns true if the 2 molecules of this interface are the same entity (i.e. homomeric interface), false otherwise (i.e. heteromeric interface)boolean
isInfinite()
Returns true if the transformation applied to the second molecule of this interface has an infinite character (pure translation or screw rotation) and both molecules of the interface have the same asymmetric unit identifier (chain id): in such cases the interface would lead to infinite fiber-like (linear or helical) assembliesboolean
isIsologous()
Tell whether the interface is isologous, i.e. it is formed by the same patches of same entity on both sides.boolean
isSymRelated()
Tells whether the interface corresponds to one mediated by crystallographic symmetry, i.e. it is between symmetry-related molecules (with same chain identifier)void
setCluster(StructureInterfaceCluster cluster)
void
setContacts(AtomContactSet contacts)
void
setFirstGroupAsa(GroupAsa groupAsa)
void
setFirstGroupAsas(Map<ResidueNumber,GroupAsa> firstGroupAsas)
void
setId(int id)
void
setMoleculeIds(Pair<String> moleculeIds)
void
setMolecules(Pair<Atom[]> molecules)
void
setSecondGroupAsa(GroupAsa groupAsa)
void
setSecondGroupAsas(Map<ResidueNumber,GroupAsa> secondGroupAsas)
void
setTotalArea(double totalArea)
void
setTransforms(Pair<CrystalTransform> transforms)
String
toMMCIF()
Return a String representing the 2 molecules of this interface in mmCIF format.String
toPDB()
Return a String representing the 2 molecules of this interface in PDB format.String
toString()
-
-
-
Constructor Detail
-
StructureInterface
public StructureInterface(Atom[] firstMolecule, Atom[] secondMolecule, String firstMoleculeId, String secondMoleculeId, AtomContactSet contacts, CrystalTransform firstTransf, CrystalTransform secondTransf)
Constructs a StructureInterface- Parameters:
firstMolecule
- the atoms of the first moleculesecondMolecule
- the atoms of the second moleculefirstMoleculeId
- an identifier that identifies the first molecule within the Asymmetric UnitsecondMoleculeId
- an identifier that identifies the second molecule within the Asymmetric Unitcontacts
- the contacts between the 2 moleculesfirstTransf
- the transformation (crystal operator) applied to first moleculesecondTransf
- the transformation (crystal operator) applied to second molecule
-
StructureInterface
public StructureInterface()
Constructs an empty StructureInterface
-
-
Method Detail
-
getId
public int getId()
-
setId
public void setId(int id)
-
getCrystalIds
public Pair<String> getCrystalIds()
Returns a pair of identifiers for each of the 2 member molecules that identify them uniquely in the crystal: <molecule id (asym unit id)>+<operator id>+<crystal translation>- Returns:
-
getTotalArea
public double getTotalArea()
Returns the total area buried upon formation of this interface, defined as: 1/2[ (ASA1u-ASA1c) + (ASA2u-ASA2u) ] , with:ASAxu = ASA of first/second unbound chain
ASAxc = ASA of first/second complexed chain
In the area calculation HETATOM groups not part of the main protein/nucleotide chain are not included.- Returns:
-
setTotalArea
public void setTotalArea(double totalArea)
-
getContacts
public AtomContactSet getContacts()
-
setContacts
public void setContacts(AtomContactSet contacts)
-
getMolecules
public Pair<Atom[]> getMolecules()
-
setMolecules
public void setMolecules(Pair<Atom[]> molecules)
-
getMoleculeIds
public Pair<String> getMoleculeIds()
Return the pair of identifiers identifying each of the 2 molecules of this interface in the asymmetry unit (usually the chain identifier if this interface is between 2 chains)- Returns:
-
setMoleculeIds
public void setMoleculeIds(Pair<String> moleculeIds)
-
getTransforms
public Pair<CrystalTransform> getTransforms()
Return the 2 crystal transform operations performed on each of the molecules of this interface.- Returns:
-
setTransforms
public void setTransforms(Pair<CrystalTransform> transforms)
-
getFirstAtomsForAsa
protected Atom[] getFirstAtomsForAsa(int cofactorSizeToUse)
-
getSecondAtomsForAsa
protected Atom[] getSecondAtomsForAsa(int cofactorSizeToUse)
-
getAtomsForAsa
protected Atom[] getAtomsForAsa(int cofactorSizeToUse)
-
isSymRelated
public boolean isSymRelated()
Tells whether the interface corresponds to one mediated by crystallographic symmetry, i.e. it is between symmetry-related molecules (with same chain identifier)- Returns:
-
isInfinite
public boolean isInfinite()
Returns true if the transformation applied to the second molecule of this interface has an infinite character (pure translation or screw rotation) and both molecules of the interface have the same asymmetric unit identifier (chain id): in such cases the interface would lead to infinite fiber-like (linear or helical) assemblies- Returns:
-
isHomomeric
public boolean isHomomeric()
Returns true if the 2 molecules of this interface are the same entity (i.e. homomeric interface), false otherwise (i.e. heteromeric interface)- Returns:
- true if homomeric or if either of the entities is unknonw (null Compounds), false otherwise
-
getFirstGroupAsas
public Map<ResidueNumber,GroupAsa> getFirstGroupAsas()
Gets a map of ResidueNumbers to GroupAsas for all groups of first chain.- Returns:
-
getFirstGroupAsa
public GroupAsa getFirstGroupAsa(ResidueNumber resNum)
Gets the GroupAsa for the corresponding residue number of first chain- Parameters:
resNum
-- Returns:
-
setFirstGroupAsa
public void setFirstGroupAsa(GroupAsa groupAsa)
-
setFirstGroupAsas
public void setFirstGroupAsas(Map<ResidueNumber,GroupAsa> firstGroupAsas)
-
setSecondGroupAsas
public void setSecondGroupAsas(Map<ResidueNumber,GroupAsa> secondGroupAsas)
-
getSecondGroupAsas
public Map<ResidueNumber,GroupAsa> getSecondGroupAsas()
Gets a map of ResidueNumbers to GroupAsas for all groups of second chain.- Returns:
-
setSecondGroupAsa
public void setSecondGroupAsa(GroupAsa groupAsa)
-
getSecondGroupAsa
public GroupAsa getSecondGroupAsa(ResidueNumber resNum)
Gets the GroupAsa for the corresponding residue number of second chain- Parameters:
resNum
-- Returns:
-
getCoreResidues
public Pair<List<Group>> getCoreResidues(double bsaToAsaCutoff, double minAsaForSurface)
Returns the residues belonging to the interface core, defined as those residues at the interface (BSA>0) and for which the BSA/ASA ratio is above the given bsaToAsaCutoff- Parameters:
bsaToAsaCutoff
-minAsaForSurface
- the minimum ASA to consider a residue on the surface- Returns:
-
getRimResidues
public Pair<List<Group>> getRimResidues(double bsaToAsaCutoff, double minAsaForSurface)
Returns the residues belonging to the interface rim, defined as those residues at the interface (BSA>0) and for which the BSA/ASA ratio is below the given bsaToAsaCutoff- Parameters:
bsaToAsaCutoff
-minAsaForSurface
- the minimum ASA to consider a residue on the surface- Returns:
-
getInterfacingResidues
public Pair<List<Group>> getInterfacingResidues(double minAsaForSurface)
Returns the residues belonging to the interface, i.e. the residues at the surface with BSA>0- Parameters:
minAsaForSurface
- the minimum ASA to consider a residue on the surface- Returns:
-
getSurfaceResidues
public Pair<List<Group>> getSurfaceResidues(double minAsaForSurface)
Returns the residues belonging to the surface- Parameters:
minAsaForSurface
- the minimum ASA to consider a residue on the surface- Returns:
-
getCluster
public StructureInterfaceCluster getCluster()
-
setCluster
public void setCluster(StructureInterfaceCluster cluster)
-
getContactOverlapScore
public double getContactOverlapScore(StructureInterface other, boolean invert)
Calculates the Jaccard contact set score (intersection over union) between this StructureInterface and the given one. The calculation assumes that both interfaces come from the same structure. The output will not necessarily make sense if the two interfaces come from different structures. The two sides of the given StructureInterface need to match this StructureInterface in the sense that they must come from the same Entity, i.e. their residue numbers need to align with 100% identity, except for unobserved density residues. The SEQRES indices obtained throughEntityInfo.getAlignedResIndex(Group, Chain)
are used to match residues, thus if no SEQRES is present or ifFileParsingParameters.setAlignSeqRes(boolean)
is not used, this calculation is not guaranteed to work properly.- Parameters:
other
- the interface to be compared to this oneinvert
- if false the comparison will be done first-to-first and second-to-second, if true the match will be first-to-second and second-to-first- Returns:
- the contact overlap score, range [0.0,1.0]
-
getGroupContacts
public GroupContactSet getGroupContacts()
-
isIsologous
public boolean isIsologous()
Tell whether the interface is isologous, i.e. it is formed by the same patches of same entity on both sides.- Returns:
- true if isologous, false if heterologous
-
getParentChains
public Pair<Chain> getParentChains()
Finds the parent chains by looking up the references of first atom of each side of this interface- Returns:
-
getParentCompounds
public Pair<EntityInfo> getParentCompounds()
Finds the parent entities by looking up the references of first atom of each side of this interface- Returns:
-
toPDB
public String toPDB()
Return a String representing the 2 molecules of this interface in PDB format. If the molecule ids (i.e. chain ids) are the same for both molecules, then the second one will be replaced by the next letter in alphabet (or A for Z)- Returns:
- the PDB-formatted string
-
toMMCIF
public String toMMCIF()
Return a String representing the 2 molecules of this interface in mmCIF format. If the molecule ids (i.e. chain ids) are the same for both molecules, then the second one will be written as chainId_operatorId (with operatorId taken fromgetTransforms()
- Returns:
- the mmCIF-formatted string
-
compareTo
public int compareTo(StructureInterface o)
- Specified by:
compareTo
in interfaceComparable<StructureInterface>
-
-