Package org.biojava.nbio.structure
Interface Atom
-
- All Superinterfaces:
Cloneable,PDBRecord,Serializable
- All Known Implementing Classes:
AtomImpl
public interface Atom extends Cloneable, PDBRecord
A simple interface for an Atom. The coordinates can be accessed via thegetCoords(), or thegetX(),getY(),getZ()methods. There are a few additional methods here to provide some PDB specific information.- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic, Horvath Tamas
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBond(Bond bond)Add a bondObjectclone()Return an identical copy of this object .CharactergetAltLoc()Get alternate Location.List<Bond>getBonds()Get allBonds this atom is part of.shortgetCharge()Get the charge of this atomdouble[]getCoords()Get the coordinates.javax.vecmath.Point3dgetCoordsAsPoint3d()Get the coordinates.ElementgetElement()Get element of the atom, e.g.GroupgetGroup()Return the parent Group of the Atom.StringgetName()Get atom name, e.g.floatgetOccupancy()Get occupancy.intgetPDBserial()Get PDB atom number.floatgetTempFactor()Get temp factor.doublegetX()Get coordinate X.doublegetY()Get coordinate Y.doublegetZ()Get coordinate Z.booleanhasBond(Atom other)Test if another atom has a bond to this atomvoidsetAltLoc(Character c)Set alternate Location.voidsetBonds(List<Bond> bonds)Sets the bondsvoidsetCharge(short charge)Set the charge of this atomvoidsetCoords(double[] c)Set the coordinates.voidsetElement(Element e)Set element of the atom name, e.g.voidsetGroup(Group parent)Set the back-reference to its parent Group.voidsetName(String s)Set atom name, e.g.voidsetOccupancy(float occupancy)Set occupancy.voidsetPDBserial(int i)Set PDB atom number.voidsetTempFactor(float temp)Set temp factor .voidsetX(double x)Set the X coordinate.voidsetY(double y)Set the Y coordinate.voidsetZ(double z)Set the Z coordinate.
-
-
-
Method Detail
-
setName
void setName(String s)
Set atom name, e.g. "CA".- Parameters:
s- a trimmed String specifying the name value- See Also:
getName()
-
getName
String getName()
Get atom name, e.g. "CA". Beware that some PDB atom names are ambiguous (e.g. CA, which means C-alpha or Calcium), the ambiguity can simply be resolved by also checking the element withgetElement()- Returns:
- a trimmed String representing the name value
- See Also:
setName(java.lang.String)
-
setElement
void setElement(Element e)
Set element of the atom name, e.g.Element.Fe- Parameters:
e- an Element enumeration- See Also:
getElement()
-
getElement
Element getElement()
Get element of the atom, e.g.Element.Ca- Returns:
- an Element enumeration
- See Also:
setElement(org.biojava.nbio.structure.Element)
-
setPDBserial
void setPDBserial(int i)
Set PDB atom number.- Parameters:
i- an int specifying the PDBserial value- See Also:
getPDBserial()
-
getPDBserial
int getPDBserial()
Get PDB atom number.- Returns:
- an int representing the PDBserial value
- See Also:
setPDBserial(int)
-
setCoords
void setCoords(double[] c)
Set the coordinates.- Parameters:
c- an array of doubles specifying the coords value- See Also:
getCoords()
-
getCoords
double[] getCoords()
Get the coordinates.- Returns:
- a new array of doubles representing the coords value
- See Also:
setCoords(double[]),getCoordsAsPoint3d()
-
getCoordsAsPoint3d
javax.vecmath.Point3d getCoordsAsPoint3d()
Get the coordinates.Internally the coordinates are represented as Point3d so this is recommended over
getCoords()- Returns:
- a reference to the Point3d coordinates
- See Also:
getCoords()
-
getX
double getX()
Get coordinate X.- Returns:
- a double
- See Also:
setX(double)
-
getY
double getY()
Get coordinate Y.- Returns:
- a double
- See Also:
setY(double)
-
getZ
double getZ()
Get coordinate Z.- Returns:
- a double
- See Also:
setZ(double)
-
setAltLoc
void setAltLoc(Character c)
Set alternate Location.- Parameters:
c- a Character object specifying the alt loc value- See Also:
getAltLoc()
-
getAltLoc
Character getAltLoc()
Get alternate Location.- Returns:
- a Character object representing the alt loc value. Default altLoc ('.' in mmCIF files) is represented by ' ' (space character, ascii 32).
- See Also:
setAltLoc(java.lang.Character)
-
setOccupancy
void setOccupancy(float occupancy)
Set occupancy.- Parameters:
occupancy- a float specifying the occupancy value- See Also:
getOccupancy()
-
getOccupancy
float getOccupancy()
Get occupancy.- Returns:
- a float representing the occupancy value
- See Also:
setOccupancy(float)
-
setTempFactor
void setTempFactor(float temp)
Set temp factor .- Parameters:
temp- a float specifying the temp factor value- See Also:
getTempFactor()
-
getTempFactor
float getTempFactor()
Get temp factor.- Returns:
- a float representing the temp factor value
- See Also:
setTempFactor(float)
-
clone
Object clone()
Return an identical copy of this object .- Returns:
- an identical copy of this object
-
setGroup
void setGroup(Group parent)
Set the back-reference to its parent Group.- Parameters:
parent- the parent Group- See Also:
getGroup()
-
getGroup
Group getGroup()
Return the parent Group of the Atom. returns null if the referenced object is not Group- Returns:
- Group the parent Group of the Atom, or null
- See Also:
setGroup(Group)
-
addBond
void addBond(Bond bond)
Add a bond- Parameters:
bond- to be added- See Also:
getBonds()
-
getBonds
List<Bond> getBonds()
Get allBonds this atom is part of.- Returns:
- a list of
Bonds or null if no bonds exist for this Atom
-
hasBond
boolean hasBond(Atom other)
Test if another atom has a bond to this atom- Parameters:
other-- Returns:
-
getCharge
short getCharge()
Get the charge of this atom- Returns:
- a the integer charge.
-
setCharge
void setCharge(short charge)
Set the charge of this atom
-
-