meshi.molecularElements.atoms
Class Atom

java.lang.Object
  extended by meshi.molecularElements.atoms.Atom
All Implemented Interfaces:
java.lang.Comparable, Attributable, Verbose
Direct Known Subclasses:
ImageAtom, Pdb2Fasta.MyAtom

public class Atom
extends java.lang.Object
implements java.lang.Comparable, Verbose, Attributable

A generic atom.


A possible pitfall
A Coordinates object (coordinates)is associated with an atom and handle all geometric issues(position, distance, forces etc.). The "geometric" methods (x(), y(), distanceFrom(Atom), etc.) are used to encapsulate this implementation. The Coordinates object itself though, is publicly accessible. Removing the overhead of function calls accelerates DistanceMatrix updating which is the bottleneck of energy based calculations. It may though, open the way to spectacular bugs!!!.

See Also:
AtomList

Field Summary
private  int ATOM_BONDED_CAPACITY
          Atoms bonded to this atom.
private  java.util.HashMap attributes
           
protected  AtomList bonded
           
 AtomCore core
           
private  double energy
           
 int ID
          A unique identifier of the atom in the MolecularSystem.
 MolecularSystem molecularSystem
           
 java.lang.String name
          The atoms name.
private static int numberOfAtoms
          Number of atoms in all the molecular systems.
private  PdbLine pdbLine
           
private  double reliability
           
protected  Residue residue
          Atom's Residue.
private  java.lang.Double temperatureFactor
           
 
Constructor Summary
Atom(PdbLine line)
           
Atom(java.lang.String name, Residue residue, AtomType type, Coordinates coordinates, java.lang.Double temperatureFactor)
          A generic atom with unspecified coordinates.
 
Method Summary
 boolean active()
           
 void addAttribute(MeshiAttribute attribute)
           
 void addEnergy(double add)
           
 void addToFx(double addMe)
          Adds the parameter to the force operating on the atom in the X direction.
 void addToFy(double addMe)
          Adds the parameter to the force operating on the atom in the Y direction.
 void addToFz(double addMe)
          Adds the parameter to the force operating on the atom in the Z direction.
 void addToX(double addMe)
          Adds the parameter to the X coordinate of the atom.
 void addToY(double addMe)
          Adds the parameter to the Y coordinate of the atom.
 void addToZ(double addMe)
          Adds the parameter to the Y coordinate of the atom.
 java.lang.String alternateLocation()
           
 boolean backboneC()
           
 boolean backboneCA()
           
 boolean backboneH()
           
 boolean backboneN()
           
 boolean backboneO()
           
 BBatom bbAtom()
           
 AtomPair bond(Atom other)
          Bonds the other atom to this one.
 AtomList bonded()
          Returns the list of atoms bonded to this one.
 java.lang.String chain()
          Returns the Atom's chain.
 java.lang.String comment()
          Returns atom's comment.
 int compareTo(java.lang.Object obj)
           
 void defrost()
           
 double distanceFrom(Atom atom)
          The distance between this atom and the parameter.
 void emptyBonded()
           
 double energy()
           
 void freeze()
           
 boolean frozen()
           
 double fx()
          Returns the force operating on the atom in the X direction.
 double fy()
          Returns the force operating on the atom in the Y direction.
 double fz()
          Returns the force operating on the atom in the Z direction.
 MeshiAttribute getAttribute(int key)
           
 void hide()
           
 boolean isBackbone()
           
 boolean isCarbon()
           
 boolean isHydrogen()
           
 boolean isNitrogen()
           
 boolean isOxygen()
           
 boolean isSulfur()
           
 java.lang.String name()
           
 boolean nameIs(java.lang.String keys)
          Returns true if the protein's name is a substring of the String parameter seperated by spaces.
 boolean nameIs(StringList keys)
          Returns true if the protein's name is included in the StringList parameter.
 boolean normal()
           
 boolean nowhere()
           
 int number()
          A unique identifier of the atom in the molecular system.
static int numberOfAtoms()
           
 double occupancy()
           
 PdbLine pdbLine()
           
 void randomize(double radius, Atom center)
           
 void randomize(double radius, double centerx, double centery, double centerz)
          Move the atom to a random position within radius from (centerx,centery,centerz).
 double reliability()
           
 void resetCoordinates()
           
 void resetEnergy()
           
 Residue residue()
          Returns the atom's residue.
 java.lang.String residueName()
           
 int residueNumber()
           
 void setFx(double fx)
          Sets the force operating on the atom in the X direction.
 void setFy(double fy)
          Sets the force operating on the atom in the Y direction.
 void setFz(double fz)
          Sets the force operating on the atom in the Z direction.
 void setMolecularSystem(MolecularSystem MolecularSystem)
           
 void setReliability(double reliability)
           
 void setResidue(Residue residue)
          Set the atom residue.
 void setResidueNumber(int number)
           
 void setStatus(AtomStatus status)
           
 void setTemperatureFactor(java.lang.Double tf)
           
 void setType(AtomType newType)
           
 void setXYZ(Coordinates coor)
           
 void setXYZ(double newx, double newy, double newz)
          Sets the X,Y,Z coordinate of the atom.
 void setXYZ(double newx, double newy, double newz, AtomStatus status)
           
 java.lang.Double temperatureFactor()
           
 java.lang.String toString()
           
 AtomType type()
          The atom type.
 java.lang.String verbose(int level)
          Returns the atom as a PDB formatted String.
 double x()
          Returns the X coordinate of the atom.
 double[] X()
           
 double y()
          Returns the Y coordinate of the atom.
 double[] Y()
           
 double z()
          Returns the Z coordinate of the atom.
 double[] Z()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

core

public final AtomCore core

name

public final java.lang.String name
The atoms name. In proteins a unique specification of it's position within the residue.


ID

public final int ID
A unique identifier of the atom in the MolecularSystem.


molecularSystem

public MolecularSystem molecularSystem

energy

private double energy

residue

protected Residue residue
Atom's Residue.


temperatureFactor

private java.lang.Double temperatureFactor

ATOM_BONDED_CAPACITY

private final int ATOM_BONDED_CAPACITY
Atoms bonded to this atom.

See Also:
Constant Field Values

bonded

protected AtomList bonded

numberOfAtoms

private static int numberOfAtoms
Number of atoms in all the molecular systems.


pdbLine

private PdbLine pdbLine

reliability

private double reliability

attributes

private java.util.HashMap attributes
Constructor Detail

Atom

public Atom(java.lang.String name,
            Residue residue,
            AtomType type,
            Coordinates coordinates,
            java.lang.Double temperatureFactor)
A generic atom with unspecified coordinates. Mainly for use by other more specific constructors.


Atom

public Atom(PdbLine line)
Method Detail

setMolecularSystem

public void setMolecularSystem(MolecularSystem MolecularSystem)

number

public final int number()
A unique identifier of the atom in the molecular system. Among other things serves as an index into a DistanceMatrix.


type

public AtomType type()
The atom type.


setType

public void setType(AtomType newType)

reliability

public double reliability()

setReliability

public void setReliability(double reliability)

nowhere

public boolean nowhere()

active

public boolean active()

pdbLine

public PdbLine pdbLine()

chain

public java.lang.String chain()
Returns the Atom's chain.

See Also:
chain()

setResidue

public void setResidue(Residue residue)
Set the atom residue.

See Also:
residue

residue

public final Residue residue()
Returns the atom's residue.

See Also:
residue

nameIs

public boolean nameIs(java.lang.String keys)
Returns true if the protein's name is a substring of the String parameter seperated by spaces. Examples:
  1. String s = "CA CB";
    Atom a;
    a.name = "CB";
    System.out.println(a.nameIs(s));
    prints true
  2. String s = "CACB";
    Atom a;
    a.name = "CB";
    System.out.println(a.nameIs(s));
    prints false

See Also:
name

nameIs

public boolean nameIs(StringList keys)
Returns true if the protein's name is included in the StringList parameter.


x

public final double x()
Returns the X coordinate of the atom.

See Also:
Coordinates.x

X

public final double[] X()

y

public final double y()
Returns the Y coordinate of the atom.

See Also:
Coordinates.Y()

Y

public final double[] Y()

z

public final double z()
Returns the Z coordinate of the atom.

See Also:
Coordinates.Z()

Z

public final double[] Z()

addToX

public void addToX(double addMe)
Adds the parameter to the X coordinate of the atom.

See Also:
Coordinates.addToX(double)

addToY

public void addToY(double addMe)
Adds the parameter to the Y coordinate of the atom.

See Also:
Coordinates.addToY(double)

addToZ

public void addToZ(double addMe)
Adds the parameter to the Y coordinate of the atom.

See Also:
Coordinates.addToZ(double)

setXYZ

public void setXYZ(double newx,
                   double newy,
                   double newz)
Sets the X,Y,Z coordinate of the atom.


setXYZ

public void setXYZ(double newx,
                   double newy,
                   double newz,
                   AtomStatus status)

setXYZ

public void setXYZ(Coordinates coor)

resetCoordinates

public void resetCoordinates()

fx

public double fx()
Returns the force operating on the atom in the X direction.

See Also:
Coordinates.fx()

fy

public double fy()
Returns the force operating on the atom in the Y direction.

See Also:
Coordinates.fy()

fz

public double fz()
Returns the force operating on the atom in the Z direction.

See Also:
Coordinates.fz()

setFx

public void setFx(double fx)
Sets the force operating on the atom in the X direction.

See Also:
Coordinates.setFx(double)

setFy

public void setFy(double fy)
Sets the force operating on the atom in the Y direction.

See Also:
Coordinates.setFy(double)

setFz

public void setFz(double fz)
Sets the force operating on the atom in the Z direction.

See Also:
Coordinates.setFz(double)

addToFx

public final void addToFx(double addMe)
Adds the parameter to the force operating on the atom in the X direction.

See Also:
Coordinates.addToFx(double)

addToFy

public final void addToFy(double addMe)
Adds the parameter to the force operating on the atom in the Y direction.

See Also:
Coordinates.addToFy(double)

addToFz

public final void addToFz(double addMe)
Adds the parameter to the force operating on the atom in the Z direction.

See Also:
Coordinates.addToFz(double)

distanceFrom

public final double distanceFrom(Atom atom)
The distance between this atom and the parameter.


verbose

public java.lang.String verbose(int level)
Returns the atom as a PDB formatted String.

Specified by:
verbose in interface Verbose

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

randomize

public void randomize(double radius,
                      double centerx,
                      double centery,
                      double centerz)
Move the atom to a random position within radius from (centerx,centery,centerz).


randomize

public void randomize(double radius,
                      Atom center)

comment

public java.lang.String comment()
Returns atom's comment.


bonded

public AtomList bonded()
Returns the list of atoms bonded to this one.

See Also:
bonded

bond

public AtomPair bond(Atom other)
Bonds the other atom to this one. Eeach atom is added to the bonded list of the other.


residueNumber

public final int residueNumber()

name

public java.lang.String name()

numberOfAtoms

public static int numberOfAtoms()

occupancy

public double occupancy()

temperatureFactor

public java.lang.Double temperatureFactor()

setTemperatureFactor

public void setTemperatureFactor(java.lang.Double tf)

alternateLocation

public java.lang.String alternateLocation()

residueName

public java.lang.String residueName()

freeze

public void freeze()

hide

public void hide()

frozen

public boolean frozen()

normal

public boolean normal()

defrost

public void defrost()

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

resetEnergy

public void resetEnergy()

addEnergy

public void addEnergy(double add)

energy

public double energy()

isBackbone

public final boolean isBackbone()

backboneH

public final boolean backboneH()

backboneN

public final boolean backboneN()

backboneCA

public final boolean backboneCA()

backboneC

public final boolean backboneC()

backboneO

public final boolean backboneO()

isCarbon

public final boolean isCarbon()

isOxygen

public final boolean isOxygen()

isNitrogen

public final boolean isNitrogen()

isSulfur

public final boolean isSulfur()

isHydrogen

public final boolean isHydrogen()

bbAtom

public final BBatom bbAtom()

setStatus

public void setStatus(AtomStatus status)

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

setResidueNumber

public void setResidueNumber(int number)

emptyBonded

public void emptyBonded()