meshi.energy.simpleEnergyTerms.compositeTorsions
Class ResidueTorsions

java.lang.Object
  extended by meshi.energy.simpleEnergyTerms.compositeTorsions.ResidueTorsions
All Implemented Interfaces:
CompositeTorsionsDefinitions, Attributable, Updateable

public class ResidueTorsions
extends java.lang.Object
implements Updateable, CompositeTorsionsDefinitions, Attributable

Allows easy access to all of a given residue's torsions.


Field Summary
private  AttributesRack attributes
           
(package private)  double energy
           
private  boolean isPP
           
private  int numberOfUpdates
           
private  Residue residue
           
private  Torsion[] torsionAngles
           
 
Fields inherited from interface meshi.energy.simpleEnergyTerms.compositeTorsions.CompositeTorsionsDefinitions
ALL, CHI_1, CHI_2, CHI_3, CHI_4, COIL, HELIX, NUM_SIDECHAIN_TORSIONS, OMG, OMNI, PHI, POLYNOMIAL_CHI_1, POLYNOMIAL_CHI_1_CHI_2, POLYNOMIAL_CHI_1_CHI_2_TORSIONS, POLYNOMIAL_CHI_1_CHI_3, POLYNOMIAL_CHI_1_CHI_3_TORSIONS, POLYNOMIAL_CHI_1_CHI_4, POLYNOMIAL_CHI_1_CHI_4_TORSIONS, POLYNOMIAL_CHI_1_TORSIONS, POLYNOMIAL_PHI_PSI, POLYNOMIAL_PHI_PSI_CHI_1, POLYNOMIAL_PHI_PSI_CHI_1_TORSIONS, POLYNOMIAL_PHI_PSI_TORSIONS, PREPRO, PSI, SHEET, TOTAL_TORSION_ANGLES, UNIDENTIFIED_TORSION_TYPE
 
Constructor Summary
ResidueTorsions(Residue residue, TorsionList torsionList)
          stores all of the residue's torsion angles.
 
Method Summary
 void addAttribute(MeshiAttribute attribute)
           
 void applyForce(int torsionType, double force)
          Applies force to torsion angles.
 double energy()
           
 AtomList getAtoms()
          returns a list of all atoms in this residue torsions
 AtomList getAtoms(int[] whichTorsions)
           
 MeshiAttribute getAttribute(int key)
           
 Residue getResidue()
          returns residue
 int getResidueNumber()
          returns residue's number
 ResidueType getResidueType()
          returns residue type
 Torsion getTorsion(int torsionType)
          returns torsion of type torsionType.
 boolean hasAllTorsions()
          verifies all the torsions used by this residue are available.
private static boolean interestingTorsion(Torsion tor)
          checks whether a given torsion angle is in [PHI,PSI,CHI_1-CHI_4].
 boolean isPP()
           
 void resetEnergy()
           
 void setEnergy(double e)
           
 void setToPP()
           
private static int torsionNum(Torsion tor)
          returns type of given torsion
 java.lang.String toString()
          Converts attributes of ResidueTorsions to string.
 java.lang.String toStringPhiPsiChi1()
          Partial conversion to string.
 void update(int numberOfUpdates)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isPP

private boolean isPP

residue

private Residue residue

torsionAngles

private Torsion[] torsionAngles

numberOfUpdates

private int numberOfUpdates

energy

double energy

attributes

private AttributesRack attributes
Constructor Detail

ResidueTorsions

public ResidueTorsions(Residue residue,
                       TorsionList torsionList)
stores all of the residue's torsion angles.

Parameters:
residue - for which torsion angles are stored
torsionList - from where the torsion angles are taken
Method Detail

energy

public double energy()

resetEnergy

public void resetEnergy()

setEnergy

public void setEnergy(double e)

getTorsion

public Torsion getTorsion(int torsionType)
returns torsion of type torsionType.


getResidueType

public ResidueType getResidueType()
returns residue type


getResidueNumber

public int getResidueNumber()
returns residue's number


getResidue

public Residue getResidue()
returns residue


setToPP

public void setToPP()

isPP

public boolean isPP()

hasAllTorsions

public boolean hasAllTorsions()
verifies all the torsions used by this residue are available. This includes phi,psi torsion angles.


applyForce

public void applyForce(int torsionType,
                       double force)
Applies force to torsion angles. Force is applied to each atom of the torsion.


getAtoms

public AtomList getAtoms()
returns a list of all atoms in this residue torsions


getAtoms

public AtomList getAtoms(int[] whichTorsions)

update

public void update(int numberOfUpdates)
            throws UpdateableException
Specified by:
update in interface Updateable
Throws:
UpdateableException

toString

public java.lang.String toString()
Converts attributes of ResidueTorsions to string.

Overrides:
toString in class java.lang.Object

toStringPhiPsiChi1

public java.lang.String toStringPhiPsiChi1()
Partial conversion to string. Convert phi, psi and chi_1 torsion angles.


interestingTorsion

private static boolean interestingTorsion(Torsion tor)
checks whether a given torsion angle is in [PHI,PSI,CHI_1-CHI_4].


torsionNum

private static int torsionNum(Torsion tor)
returns type of given torsion


addAttribute

public final void addAttribute(MeshiAttribute attribute)
Specified by:
addAttribute in interface Attributable

getAttribute

public final MeshiAttribute getAttribute(int key)
Specified by:
getAttribute in interface Attributable