astex
Class Atom

java.lang.Object
  extended by astex.Point3d
      extended by astex.Atom
All Implemented Interfaces:
GenericInterface, Selectable

public class Atom
extends Point3d
implements Selectable, GenericInterface

A class for holding information about an atom.


Field Summary
static int Aromatic
           
static int atomsCached
           
static int atomsCreated
           
 java.lang.String atomType
          The (usually sybyl) atom type of the atom.
 int attributes
          An integer for storing various attributes.
static int B
          The B coordinate attribute.
static int BallAndStick
          The property set flag.
 float ballRadius
          The stick radius of the atom.
static java.lang.String BAttribute
           
static java.lang.String Color
           
static int CustomLabelled
          The property set flag.
static int Cylinder
          The property set flag.
static int Displayed
          The atom display flag.
static int DisplayedMask
           
static int E
          The energy.
static java.lang.String Element
           
static int Hetero
          The atom is an heteroatom.
static int ID
          The ID attribute.
 char insertionCode
          Insertion code if any.
static int Labelled
          The atom is labelled.
static int ModellingActive
          Atom is active in energy calculations.
 ModellingData modellingData
           
static int ModellingEnvironment
          Atom is environment in energy calculations.
static int ModellingFixed
          Atom is fixed in energy calculations.
static int ModellingXray
          Atom is xray terms in energy calculations.
static int NameLeftJustified
          Atom is fixed in energy calculations.
static int O
          The O coordinate attribute.
static java.lang.String OAttribute
           
static java.lang.String Opacity
           
static int Property
          The property set flag.
static int Q
          The partial charge attribute.
static java.lang.String QAttribute
           
 float radius
          The radius of the atom.
static java.lang.String Radius
           
static int Ring
           
static int Selected
          The atom is selected.
static int Solvent
          The atom is solvent.
static int sp
           
static int sp2
           
static int sp3
          Hybridisation states.
static int Surface
          The surfaced atom flag.
static int SurfaceContext
          The surface context flag.
static int TemporarilySelected
          The atom is temporarily selected.
static int Undefined
          Undefined atom id.
static int VDWSphere
          The sphere flag.
static int Visited
          The atom visit flag.
static int Wide
          The wide atom flag.
static int X
          The X coordinate attribute.
static java.lang.String XAttribute
           
 int xs
          Screen x-coordinate.
static int Y
          The Y coordinate attribute.
static java.lang.String YAttribute
           
 int ys
          Screen y-coordinate.
static int Z
          The Z coordinate attribute.
static java.lang.String ZAttribute
           
 int zs
          Screen z-coordinate.
 
Fields inherited from class astex.Point3d
x, y, z
 
Fields inherited from interface astex.generic.GenericInterface
Name
 
Method Summary
 void addBond(Bond bond)
          Add a bond to the atom.
 void addChild(GenericInterface child)
          Add a child.
 void addListener(GenericEventInterface geh)
          Add a listener.
 void addParent(GenericInterface parent)
          Add a parent.
 boolean connected121314(Atom otherAtom)
          Are these atoms connected 1,2, 1,3 or 1,4.
 boolean connected13(Atom targetAtom)
          Is this atom connected by two bonds to the specified atom.
 boolean connected14(Atom targetAtom)
          Is this atom connected by three bonds to the specified atom.
static Atom create()
          Create an atom.
 void delete()
          Remove an atom.
 void edit(java.lang.String name, java.lang.String value)
           
 java.lang.String generateLabel(java.lang.String format)
          Generate an atom label according to a format.
 java.lang.Object get(java.lang.Object key, java.lang.Object def)
          Get Object representing key.
 java.lang.String getAtomLabel()
          Get the atom label.
 java.lang.String getAtomSymbol()
          Get the atomic symbol for this atom.
 java.lang.String getAtomType()
          Get the atomType.
 double getAttribute(int attribute)
          Get an attribute.
 double getBallRadius()
          Get the vdw radius.
 double getBFactor()
          Return the bFactor.
 double getBiggestDisplayedRadius()
          Get the biggest radius that is displayed.
 Bond getBond(Atom otherAtom)
          Does this atom have a bond to the specified atom.
 Bond getBond(int index)
          Return a specified bond or null if it doesn't exist.
 int getBondCount()
          Return the total number of bonds.
 Atom getBondedAtom(int index)
          Return the specified bonded atom.
 Atom getBondedAtom(java.lang.String nm)
          Get bonded atom with this name.
 double getBondingRadius()
          Get the bonding radius for the atom.
 Bond getBondWithOrder(int bondOrder)
          Return a bond with the specified order.
 int getCharge()
          Get the atom charge.
 java.util.Enumeration getChildren(java.lang.Object type)
          Get an enumeration of our children.
 java.lang.Object getClassname()
          Get our class description.
 int getColor()
          Get the atom color.
 java.lang.String getCustomLabel()
          Set whether the atom is solvent.
 int getElement()
          Get the element type of this atom.
 int getHybridisation()
          Return the hybridisation state of the atom.
 int getId()
          Get the id for this atom.
 char getInsertionCode()
          Get the insertion code.
 double getMass()
          Get the default mass for the atom.
 Molecule getMolecule()
          Get the molecule to which the atom belongs.
 double getOccupancy()
          Get the occupancy.
 java.util.Enumeration getParents(java.lang.Object type)
          Get an Enumeration of our parents.
 float getPartialCharge()
          Get the value of partialCharge.
 java.util.Enumeration getProperties()
          Return an enumeration of our properties.
 Residue getResidue()
          Get the residue to which the atom belongs.
 int getSelectedColor()
          Get the color or selected color if selected.
 java.lang.String getSymbol()
          Get the atom symbol for the element.
 int getTransparency()
          Get the transparency.
 double getVDWRadius()
          Get the VDW radius of this atom.
 boolean hasAttributes()
          Does the atom have any attributes set?
 boolean hasBond(Atom otherAtom)
          Does this atom have a bond to the other atom.
 boolean hasBondWithOrder(int bondOrder)
          Does this atom have a bond of the specified bond order.
 boolean hasExplicitBond()
          Does this atom have bonds that came from an explicit bond.
 void initialise()
          Initialise an atom.
 boolean isAliphaticHydrogen()
          Is this an aliphatic hydrogen.
 boolean isDisplayed()
          Has this atom been displayed.
 boolean isHBondAcceptor()
          Is this atom an HBond donor.
 boolean isHBondDonor()
          Is this atom an HBond donor.
 boolean isHeteroAtom()
          Is this atom a heteroatom.
 boolean isLabelled()
          Is this atom a solvent atom.
 boolean isSelected()
          Is this atom selected.
 boolean isSimpleDisplayed()
          Has this atom been displayed.
 boolean isSolvent()
          Is this atom a solvent atom.
 boolean isTemporarilySelected()
          Is this atom temporarily selected.
 boolean isVisited()
          Has this atom been visited.
 boolean isWide()
          Has this atom been wide.
 void release()
          Release an atom after we finished with it.
 void removeAllBonds()
          Remove all bonds.
 void removeBond(Bond b)
          Remove a bond from this atom.
 void removeChild(GenericInterface child)
          Remove a child.
 void removeListener(GenericEventInterface geh)
          Remove a listener.
 void removeParent(GenericInterface parent)
          Remove a parent.
 void resetColor()
          Set color back to undefined.
 int select(int state)
          Set the selection state.
 java.lang.String selectStatement()
           
 java.lang.Object set(java.lang.Object key, java.lang.Object value)
          Set an object value.
 void setAtomLabel(java.lang.String newLabel)
          Set the atom label.
 void setAtomType(java.lang.String s)
          Set the atomType.
 void setBallRadius(double r)
          Set the vdw radius.
 void setBFactor(double b)
          Set the bFactor.
 void setCharge(int newCharge)
          Set the atom charge.
 void setClassname(java.lang.String classname)
          Set our classname.
 void setColor(int newColor)
          Set the atom color.
 void setCustomLabel(java.lang.String l)
          Set whether the atom is solvent.
 void setDisplayed(boolean state)
          Set whether the atom has been displayed.
 void setElement(int newElement)
          Set the element of this atom.
 void setHeteroAtom(boolean state)
          Set whether the atom is a heteroatom.
 void setId(int newId)
          Set the id for this atom.
 void setInsertionCode(char c)
          Set the insertion code.
 void setLabelled(boolean state)
          Set whether the atom is solvent.
 void setOccupancy(double o)
          Set the occupancy.
 void setOrClearAttribute(int attribute, boolean state)
          Set or clear a particular attribute.
 void setParent(Residue residue)
          Set the residues to which the atom belongs.
 void setPartialCharge(double v)
          Set the value of partialCharge.
 void setSelected(boolean state)
          Set whether the atom is selected.
 void setSolvent(boolean state)
          Set whether the atom is solvent.
 void setTemporarilySelected(boolean state)
          Set whether the atom is temporarily selected.
 void setTransparency(int t)
          Set the transparency.
 void setVDWRadius(double r)
          Set the vdw radius.
 void setVisited(boolean state)
          Set whether the atom has been visited.
 void setWide(boolean state)
          Set whether the atom has been wide.
 java.lang.String toString()
          Return a string representation of this point.
 void transformToScreen(Matrix m)
          Transform this atom to screen coordinates.
 
Methods inherited from class astex.Point3d
add, angle, angleDegrees, clone, cross, cross, cross, crossNoNormalise, distance, distance, distanceSq, distanceSq, divide, dot, equal, get, getX, getY, getZ, isNullVector, length, length, max, mid, mid, min, negate, normalise, normalToLine, normalToLine, normalToLine, normalToLine, planeEquation, print, scale, set, set, set, set, setX, setY, setZ, subtract, torsion, torsion, torsionDegrees, torsionDegrees, transform, transformByMatrix, translate, translate, unitVector, unitVector, unitVector, vector, vector, zero
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Undefined

public static int Undefined
Undefined atom id.


attributes

public int attributes
An integer for storing various attributes.


radius

public float radius
The radius of the atom.


ballRadius

public float ballRadius
The stick radius of the atom.


Solvent

public static int Solvent
The atom is solvent.


Labelled

public static int Labelled
The atom is labelled.


Selected

public static int Selected
The atom is selected.


Hetero

public static int Hetero
The atom is an heteroatom.


TemporarilySelected

public static int TemporarilySelected
The atom is temporarily selected.


Visited

public static int Visited
The atom visit flag.


Displayed

public static int Displayed
The atom display flag.


Wide

public static int Wide
The wide atom flag.


VDWSphere

public static int VDWSphere
The sphere flag.


Surface

public static int Surface
The surfaced atom flag.


SurfaceContext

public static int SurfaceContext
The surface context flag.


Property

public static int Property
The property set flag.


BallAndStick

public static int BallAndStick
The property set flag.


Cylinder

public static int Cylinder
The property set flag.


CustomLabelled

public static int CustomLabelled
The property set flag.


DisplayedMask

public static int DisplayedMask

ModellingActive

public static int ModellingActive
Atom is active in energy calculations.


ModellingEnvironment

public static int ModellingEnvironment
Atom is environment in energy calculations.


ModellingXray

public static int ModellingXray
Atom is xray terms in energy calculations.


ModellingFixed

public static int ModellingFixed
Atom is fixed in energy calculations.


NameLeftJustified

public static int NameLeftJustified
Atom is fixed in energy calculations.


Aromatic

public static final int Aromatic
See Also:
Constant Field Values

Ring

public static final int Ring
See Also:
Constant Field Values

modellingData

public ModellingData modellingData

X

public static final int X
The X coordinate attribute.

See Also:
Constant Field Values

Y

public static final int Y
The Y coordinate attribute.

See Also:
Constant Field Values

Z

public static final int Z
The Z coordinate attribute.

See Also:
Constant Field Values

B

public static final int B
The B coordinate attribute.

See Also:
Constant Field Values

O

public static final int O
The O coordinate attribute.

See Also:
Constant Field Values

ID

public static final int ID
The ID attribute.

See Also:
Constant Field Values

Q

public static final int Q
The partial charge attribute.

See Also:
Constant Field Values

E

public static final int E
The energy.

See Also:
Constant Field Values

sp3

public static final int sp3
Hybridisation states.

See Also:
Constant Field Values

sp2

public static final int sp2
See Also:
Constant Field Values

sp

public static final int sp
See Also:
Constant Field Values

xs

public transient int xs
Screen x-coordinate.


ys

public transient int ys
Screen y-coordinate.


zs

public transient int zs
Screen z-coordinate.


insertionCode

public char insertionCode
Insertion code if any.


atomType

public java.lang.String atomType
The (usually sybyl) atom type of the atom.


atomsCreated

public static int atomsCreated

atomsCached

public static int atomsCached

XAttribute

public static final java.lang.String XAttribute
See Also:
Constant Field Values

YAttribute

public static final java.lang.String YAttribute
See Also:
Constant Field Values

ZAttribute

public static final java.lang.String ZAttribute
See Also:
Constant Field Values

BAttribute

public static final java.lang.String BAttribute
See Also:
Constant Field Values

OAttribute

public static final java.lang.String OAttribute
See Also:
Constant Field Values

QAttribute

public static final java.lang.String QAttribute
See Also:
Constant Field Values

Color

public static final java.lang.String Color
See Also:
Constant Field Values

Radius

public static final java.lang.String Radius
See Also:
Constant Field Values

Opacity

public static final java.lang.String Opacity
See Also:
Constant Field Values

Element

public static final java.lang.String Element
See Also:
Constant Field Values
Method Detail

initialise

public void initialise()
Initialise an atom.

Overrides:
initialise in class Point3d

setAtomType

public void setAtomType(java.lang.String s)
Set the atomType.


getAtomType

public java.lang.String getAtomType()
Get the atomType.


setTransparency

public void setTransparency(int t)
Set the transparency.


getTransparency

public int getTransparency()
Get the transparency.


setInsertionCode

public void setInsertionCode(char c)
Set the insertion code.


getInsertionCode

public char getInsertionCode()
Get the insertion code.


create

public static Atom create()
Create an atom. This is the only public interface for creating new atoms.


release

public void release()
Release an atom after we finished with it.


setBFactor

public void setBFactor(double b)
Set the bFactor.


getBFactor

public double getBFactor()
Return the bFactor.


setOccupancy

public void setOccupancy(double o)
Set the occupancy.


getOccupancy

public double getOccupancy()
Get the occupancy.


getPartialCharge

public float getPartialCharge()
Get the value of partialCharge.

Returns:
value of partialCharge.

setPartialCharge

public void setPartialCharge(double v)
Set the value of partialCharge.

Parameters:
v - Value to assign to partialCharge.

getAttribute

public double getAttribute(int attribute)
Get an attribute.


setId

public void setId(int newId)
Set the id for this atom.


getId

public int getId()
Get the id for this atom.


setElement

public void setElement(int newElement)
Set the element of this atom.


getElement

public int getElement()
Get the element type of this atom.


getAtomSymbol

public java.lang.String getAtomSymbol()
Get the atomic symbol for this atom.


setAtomLabel

public void setAtomLabel(java.lang.String newLabel)
Set the atom label.


getAtomLabel

public java.lang.String getAtomLabel()
Get the atom label.


generateLabel

public java.lang.String generateLabel(java.lang.String format)
Generate an atom label according to a format.


getSymbol

public java.lang.String getSymbol()
Get the atom symbol for the element.


getMass

public double getMass()
Get the default mass for the atom.


getCharge

public int getCharge()
Get the atom charge.


setCharge

public void setCharge(int newCharge)
Set the atom charge.


setColor

public void setColor(int newColor)
Set the atom color.


getColor

public int getColor()
Get the atom color.


getSelectedColor

public int getSelectedColor()
Get the color or selected color if selected.


resetColor

public void resetColor()
Set color back to undefined.


getMolecule

public Molecule getMolecule()
Get the molecule to which the atom belongs.


setParent

public void setParent(Residue residue)
Set the residues to which the atom belongs.


getResidue

public Residue getResidue()
Get the residue to which the atom belongs.


addBond

public void addBond(Bond bond)
Add a bond to the atom.


getBond

public Bond getBond(int index)
Return a specified bond or null if it doesn't exist.


getBondedAtom

public Atom getBondedAtom(int index)
Return the specified bonded atom.


getBondCount

public int getBondCount()
Return the total number of bonds.


getBond

public Bond getBond(Atom otherAtom)
Does this atom have a bond to the specified atom.


getBondedAtom

public Atom getBondedAtom(java.lang.String nm)
Get bonded atom with this name.


hasBond

public boolean hasBond(Atom otherAtom)
Does this atom have a bond to the other atom.


hasExplicitBond

public boolean hasExplicitBond()
Does this atom have bonds that came from an explicit bond.


connected13

public boolean connected13(Atom targetAtom)
Is this atom connected by two bonds to the specified atom. That is are they 1,3 connected.


connected14

public boolean connected14(Atom targetAtom)
Is this atom connected by three bonds to the specified atom. That is are they 1,4 connected.


connected121314

public boolean connected121314(Atom otherAtom)
Are these atoms connected 1,2, 1,3 or 1,4.


getBondWithOrder

public Bond getBondWithOrder(int bondOrder)
Return a bond with the specified order.


hasBondWithOrder

public boolean hasBondWithOrder(int bondOrder)
Does this atom have a bond of the specified bond order.


getBondingRadius

public double getBondingRadius()
Get the bonding radius for the atom.


getVDWRadius

public double getVDWRadius()
Get the VDW radius of this atom.


getBiggestDisplayedRadius

public double getBiggestDisplayedRadius()
Get the biggest radius that is displayed.


setVDWRadius

public void setVDWRadius(double r)
Set the vdw radius.


setBallRadius

public void setBallRadius(double r)
Set the vdw radius.


getBallRadius

public double getBallRadius()
Get the vdw radius.


transformToScreen

public void transformToScreen(Matrix m)
Transform this atom to screen coordinates.


isAliphaticHydrogen

public boolean isAliphaticHydrogen()
Is this an aliphatic hydrogen.


isHBondDonor

public boolean isHBondDonor()
Is this atom an HBond donor. Only suitable for standard aminoacid names.


isHBondAcceptor

public boolean isHBondAcceptor()
Is this atom an HBond donor. Only suitable for standard aminoacid names.


hasAttributes

public boolean hasAttributes()
Does the atom have any attributes set?


setOrClearAttribute

public void setOrClearAttribute(int attribute,
                                boolean state)
Set or clear a particular attribute.


setSolvent

public void setSolvent(boolean state)
Set whether the atom is solvent.


isSolvent

public boolean isSolvent()
Is this atom a solvent atom.


setCustomLabel

public void setCustomLabel(java.lang.String l)
Set whether the atom is solvent.


getCustomLabel

public java.lang.String getCustomLabel()
Set whether the atom is solvent.


isLabelled

public boolean isLabelled()
Is this atom a solvent atom.


setLabelled

public void setLabelled(boolean state)
Set whether the atom is solvent.


setSelected

public void setSelected(boolean state)
Set whether the atom is selected.


isSelected

public boolean isSelected()
Is this atom selected.


setHeteroAtom

public void setHeteroAtom(boolean state)
Set whether the atom is a heteroatom.


isHeteroAtom

public boolean isHeteroAtom()
Is this atom a heteroatom.


setTemporarilySelected

public void setTemporarilySelected(boolean state)
Set whether the atom is temporarily selected.


isTemporarilySelected

public boolean isTemporarilySelected()
Is this atom temporarily selected.


setVisited

public void setVisited(boolean state)
Set whether the atom has been visited.


isVisited

public boolean isVisited()
Has this atom been visited.


setWide

public void setWide(boolean state)
Set whether the atom has been wide.


isWide

public boolean isWide()
Has this atom been wide. Its a bond property.


setDisplayed

public void setDisplayed(boolean state)
Set whether the atom has been displayed.


isSimpleDisplayed

public boolean isSimpleDisplayed()
Has this atom been displayed.


isDisplayed

public boolean isDisplayed()
Has this atom been displayed.


select

public int select(int state)
Set the selection state.

Specified by:
select in interface Selectable

selectStatement

public java.lang.String selectStatement()
Specified by:
selectStatement in interface Selectable

getHybridisation

public int getHybridisation()
Return the hybridisation state of the atom.


toString

public java.lang.String toString()
Description copied from class: Point3d
Return a string representation of this point.

Overrides:
toString in class Point3d

delete

public void delete()
Remove an atom.


removeBond

public void removeBond(Bond b)
Remove a bond from this atom.


removeAllBonds

public void removeAllBonds()
Remove all bonds.


getProperties

public java.util.Enumeration getProperties()
Return an enumeration of our properties.

Specified by:
getProperties in interface GenericInterface

get

public java.lang.Object get(java.lang.Object key,
                            java.lang.Object def)
Get Object representing key.

Specified by:
get in interface GenericInterface

edit

public void edit(java.lang.String name,
                 java.lang.String value)

set

public java.lang.Object set(java.lang.Object key,
                            java.lang.Object value)
Set an object value.

Specified by:
set in interface GenericInterface

getClassname

public java.lang.Object getClassname()
Get our class description.

Specified by:
getClassname in interface GenericInterface

setClassname

public void setClassname(java.lang.String classname)
Set our classname.

Specified by:
setClassname in interface GenericInterface

getParents

public java.util.Enumeration getParents(java.lang.Object type)
Get an Enumeration of our parents.

Specified by:
getParents in interface GenericInterface

addParent

public void addParent(GenericInterface parent)
Add a parent.

Specified by:
addParent in interface GenericInterface

removeParent

public void removeParent(GenericInterface parent)
Remove a parent.

Specified by:
removeParent in interface GenericInterface

getChildren

public java.util.Enumeration getChildren(java.lang.Object type)
Get an enumeration of our children.

Specified by:
getChildren in interface GenericInterface

addChild

public void addChild(GenericInterface child)
Add a child.

Specified by:
addChild in interface GenericInterface

removeChild

public void removeChild(GenericInterface child)
Remove a child.

Specified by:
removeChild in interface GenericInterface

addListener

public void addListener(GenericEventInterface geh)
Add a listener.

Specified by:
addListener in interface GenericInterface

removeListener

public void removeListener(GenericEventInterface geh)
Remove a listener.

Specified by:
removeListener in interface GenericInterface