org.proteinshader.structure.visitor
Class BondPredictor

java.lang.Object
  extended by org.proteinshader.structure.visitor.BondPredictor

public class BondPredictor
extends Object

Knows how to test if the distance between two Atoms is acceptable for a covalent Bond. There is also a method to test whether a Bond between two Atoms of the same AminoAcid should be a double Bond.

Acceptable Bond Lengths

The calculated Bond length is obtained by using the xyz-coordinates of the source and destination Atoms:

calculated length = sqrt( (dstX - srcX)^2 + (dstY - srcY)^2 + (dstZ - srcZ)^2 )

The maximum acceptable Bond length is obtained by adding the covalent radii of the source and destination Atoms plus a tolerance value:

maximum length = source Atom radius + destination Atom radius + tolerance

The covalent radii are given in AtomEnum and are based on values published by the Cambridge Crystallographic Data Center. The tolerance value is set to DEFAULT_TOLERANCE by the no-arg constructor, but it can be set to any desired value by the other constructor or by the setTolerance() method.

The minimum acceptable Bond length is set to DEFAULT_MIN_BOND_LENGTH by the no-arg constructor, but another value can be set by the other constructor or by the setMinBondLength() method.


Field Summary
static double DEFAULT_MIN_BOND_LENGTH
          The default minimum Bond length is 0.40 Angstroms.
static double DEFAULT_TOLERANCE
          The default tolerance for determining if a Bond length is acceptable is 0.56 Angstroms (the same value used by the RasMol program).
 
Constructor Summary
BondPredictor()
          Constructs a BondPredictor with the Bond length tolerance and minimum acceptable length set to DEFAULT_TOLERANCE and DEFAULT_MIN_BOND_LENGTH, respectively.
BondPredictor(double tolerance, double minBondLength)
          Constructs a BondPredictor with the requested tolerance and minimum Bond length.
 
Method Summary
 double getMinBondLength()
          Returns the minimum acceptable Bond length that is currently in use.
 double getTolerance()
          Returns the Bond length tolerance that is currently in use.
 boolean isDistanceAcceptable(Atom srcAtom, Atom dstAtom)
          Determines if two Atoms are within an acceptable distance for a covalent Bond.
 boolean isDoubleBond(Atom srcAtom, Atom dstAtom, AminoAcidEnum aminoAcidType)
          Uses the Atom IDs (from Atom name field in a PDB record) and the AminoAcid type to determine if the Atoms should have a double Bond (assuming that they both belong to the same AminoAcid).
 void setMinBondLength(double minBondLength)
          Sets the minimum acceptable Bond length.
 void setTolerance(double tolerance)
          Sets the Bond length tolerance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TOLERANCE

public static final double DEFAULT_TOLERANCE
The default tolerance for determining if a Bond length is acceptable is 0.56 Angstroms (the same value used by the RasMol program).

See Also:
Constant Field Values

DEFAULT_MIN_BOND_LENGTH

public static final double DEFAULT_MIN_BOND_LENGTH
The default minimum Bond length is 0.40 Angstroms.

See Also:
Constant Field Values
Constructor Detail

BondPredictor

public BondPredictor()
Constructs a BondPredictor with the Bond length tolerance and minimum acceptable length set to DEFAULT_TOLERANCE and DEFAULT_MIN_BOND_LENGTH, respectively.


BondPredictor

public BondPredictor(double tolerance,
                     double minBondLength)
Constructs a BondPredictor with the requested tolerance and minimum Bond length.

Parameters:
tolerance - the tolerance in Angstroms.
minBondLength - the minimum Bond length in Angstroms.
Method Detail

getTolerance

public double getTolerance()
Returns the Bond length tolerance that is currently in use.

Returns:
The Bond length tolerance in Angstroms.

setTolerance

public void setTolerance(double tolerance)
Sets the Bond length tolerance.

Parameters:
tolerance - the Bond length tolerance in Angstroms.

getMinBondLength

public double getMinBondLength()
Returns the minimum acceptable Bond length that is currently in use.

Returns:
The minimum Bond length in Angstroms.

setMinBondLength

public void setMinBondLength(double minBondLength)
Sets the minimum acceptable Bond length.

Parameters:
minBondLength - the minimum Bond length in Angstroms.

isDistanceAcceptable

public boolean isDistanceAcceptable(Atom srcAtom,
                                    Atom dstAtom)
Determines if two Atoms are within an acceptable distance for a covalent Bond.

If either Atom is null, this method returns false (rather than throw a null pointer exception). Otherwise, the algorithm given at the top of the class is used to determine if the distance is acceptable.

Parameters:
srcAtom - the source Atom for the Bond.
dstAtom - the destination Atom for the Bond.

isDoubleBond

public boolean isDoubleBond(Atom srcAtom,
                            Atom dstAtom,
                            AminoAcidEnum aminoAcidType)
Uses the Atom IDs (from Atom name field in a PDB record) and the AminoAcid type to determine if the Atoms should have a double Bond (assuming that they both belong to the same AminoAcid).

This method does not do a reality check on Bond length. That test should be done with the isLengthAcceptable() method before this method is called.

All AminoAcid types are checked for the "C" to "O" double Bond of the carbonyl group. The other Atom ID combinations checked are as follows:


ARG: (CZ-NH1)
ASX: (CG-OD1)
GLX: (CD-OE1)
HIS: (ND1-CE1), (CG-CD2)
TRP: (CG-CD1), (CD2-CE2), (CE3-CZ3), (CZ2-CH2)
PHE or TYR: (CG-CD1), (CD2-CE2), (CE1-CZ)


The possible Bond pairs are tested in both directions.

Parameters:
srcAtom - source Atom for the Bond about to be formed.
dstAtom - destination Atom for the Bond about to be formed.
aminoAcidType - AminoAcid type as an enum.


Copyright © 2007-2008