org.biojava.bio.structure
Class Calc

java.lang.Object
  extended byorg.biojava.bio.structure.Calc

public class Calc
extends Object

utility operations on Atoms, AminoAcids, etc.

Currently the coordinates of an Atom are stored as an array of size 3 (double[3]). It would be more powerful to use Point3D from javax.vecmath. but unfortunately this is not a part of standard java installations, since it comes with java3d . So to keep things simple at the moment biojava does not depend on java3d. If the structure part of biojava becomes more powerful it could be moved out of the core - biojava and the dependency on java3d could be introduced.

Author:
Andreas Prlic

Constructor Summary
Calc()
           
 
Method Summary
static Atom add(Atom a, Atom b)
          add two atoms ( a + b)
static double amount(Atom a)
          amount
static double angle(Atom a, Atom b)
          angle
static double getDistance(Atom a, Atom b)
          calculate distance between two atoms
static double getPhi(AminoAcid a, AminoAcid b)
          phi angle
static double getPsi(AminoAcid a, AminoAcid b)
          psi angle
static boolean isConnected(AminoAcid a, AminoAcid b)
          test if two amino acids are connected, i.e.
static void rotate(Structure structure, double[][] m)
          rotate a structure
static void shift(Structure structure, Atom a)
          shift a structure with a vector
static double skalarProduct(Atom a, Atom b)
          skalar product
static Atom substract(Atom a, Atom b)
          substract two atoms ( a - b)
static double torsionAngle(Atom a, Atom b, Atom c, Atom d)
          torsion angle = angle between the normal vectors of the two plains a-b-c and b-c-d
static Atom unitVector(Atom a)
          return the unit vector of vector a
static Atom vectorProduct(Atom a, Atom b)
          Vector product
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calc

public Calc()
Method Detail

getDistance

public static double getDistance(Atom a,
                                 Atom b)
                          throws StructureException
calculate distance between two atoms

Throws:
StructureException

add

public static Atom add(Atom a,
                       Atom b)
add two atoms ( a + b)


substract

public static Atom substract(Atom a,
                             Atom b)
                      throws StructureException
substract two atoms ( a - b)

Throws:
StructureException

vectorProduct

public static Atom vectorProduct(Atom a,
                                 Atom b)
Vector product


skalarProduct

public static double skalarProduct(Atom a,
                                   Atom b)
skalar product


amount

public static double amount(Atom a)
amount


angle

public static double angle(Atom a,
                           Atom b)
angle


unitVector

public static Atom unitVector(Atom a)
return the unit vector of vector a


torsionAngle

public static double torsionAngle(Atom a,
                                  Atom b,
                                  Atom c,
                                  Atom d)
                           throws StructureException
torsion angle = angle between the normal vectors of the two plains a-b-c and b-c-d

Throws:
StructureException

getPhi

public static double getPhi(AminoAcid a,
                            AminoAcid b)
                     throws StructureException
phi angle

Throws:
StructureException

getPsi

public static double getPsi(AminoAcid a,
                            AminoAcid b)
                     throws StructureException
psi angle

Throws:
StructureException

isConnected

public static boolean isConnected(AminoAcid a,
                                  AminoAcid b)
                           throws StructureException
test if two amino acids are connected, i.e. if the distance from C to N < 2,5 Angstrom

Throws:
StructureException

rotate

public static void rotate(Structure structure,
                          double[][] m)
                   throws StructureException
rotate a structure

Throws:
StructureException

shift

public static void shift(Structure structure,
                         Atom a)
shift a structure with a vector