Package org.biojava.nbio.structure
Class AtomImpl
java.lang.Object
org.biojava.nbio.structure.AtomImpl
- All Implemented Interfaces:
Serializable,Cloneable,Atom,PDBRecord
Implementation of an Atom of a PDB file.
currently the coordinates of an atom are represented by a double[3] array.
- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe inital capacity of the bonds list. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a bondclone()returns and identical copy of this object .Get alternate Location.getBonds()Get allBonds this atom is part of.shortGet the charge of this atomdouble[]Get the coordinates.javax.vecmath.Point3dGet the coordinates.Get element of the atom, e.g.getGroup()Return the parent Group of the Atom.getName()Get atom name, e.g.floatGet occupancy.intGet PDB atom number.floatGet temp factor.doublegetX()Get coordinate X.doublegetY()Get coordinate Y.doublegetZ()Get coordinate Z.booleanTest if another atom has a bond to this atomvoidSet alternate Location.voidSets the bondsvoidsetCharge(short inputCharge) Set the charge of this atomvoidsetCoords(double[] c) Set the coordinates.voidSet element of the atom name, e.g.voidSet the back-reference to its parent Group.voidSet atom name, e.g.voidsetOccupancy(float occu) 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.toPDB()Returns a PDB file like representation of this record.voidtoPDB(StringBuffer buf) Appends a PDB file like representation of this record to the provided StringBuffer.toString()
-
Field Details
-
BONDS_INITIAL_CAPACITY
The inital capacity of the bonds list. Most atoms have a maximum of 3 heavy atom neighbors.- See Also:
-
-
Constructor Details
-
AtomImpl
public AtomImpl()
-
-
Method Details
-
setName
Set atom name, e.g. "CA". -
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 withAtom.getElement() -
setPDBserial
Set PDB atom number.- Specified by:
setPDBserialin interfaceAtom- Parameters:
i- an int specifying the PDBserial value- See Also:
-
getPDBserial
Get PDB atom number.- Specified by:
getPDBserialin interfaceAtom- Returns:
- an int representing the PDBserial value
- See Also:
-
setCoords
Set the coordinates. -
getCoords
Get the coordinates. -
getCoordsAsPoint3d
Get the coordinates.Internally the coordinates are represented as Point3d so this is recommended over
Atom.getCoords()- Specified by:
getCoordsAsPoint3din interfaceAtom- Returns:
- a reference to the Point3d coordinates
- See Also:
-
setX
Description copied from interface:AtomSet the X coordinate. -
setY
Description copied from interface:AtomSet the Y coordinate. -
setZ
Description copied from interface:AtomSet the Z coordinate. -
getX
Get coordinate X. -
getY
Get coordinate Y. -
getZ
Get coordinate Z. -
setAltLoc
Description copied from interface:AtomSet alternate Location. -
getAltLoc
Description copied from interface:AtomGet alternate Location. -
toString
-
setOccupancy
Description copied from interface:AtomSet occupancy.- Specified by:
setOccupancyin interfaceAtom- Parameters:
occu- a float specifying the occupancy value- See Also:
-
getOccupancy
Description copied from interface:AtomGet occupancy.- Specified by:
getOccupancyin interfaceAtom- Returns:
- a float representing the occupancy value
- See Also:
-
setTempFactor
Description copied from interface:AtomSet temp factor .- Specified by:
setTempFactorin interfaceAtom- Parameters:
temp- a float specifying the temp factor value- See Also:
-
getTempFactor
Description copied from interface:AtomGet temp factor.- Specified by:
getTempFactorin interfaceAtom- Returns:
- a float representing the temp factor value
- See Also:
-
clone
returns and identical copy of this object . -
setGroup
Set the back-reference to its parent Group. -
getGroup
Return the parent Group of the Atom. returns null if the referenced object is not Group -
getElement
Get element of the atom, e.g.Element.Ca- Specified by:
getElementin interfaceAtom- Returns:
- an Element enumeration
- See Also:
-
setElement
Set element of the atom name, e.g.Element.Fe- Specified by:
setElementin interfaceAtom- Parameters:
e- an Element enumeration- See Also:
-
toPDB
Description copied from interface:PDBRecordReturns a PDB file like representation of this record. -
toPDB
Description copied from interface:PDBRecordAppends a PDB file like representation of this record to the provided StringBuffer. -
getBonds
Get allBonds this atom is part of. -
hasBond
Test if another atom has a bond to this atom -
setBonds
Sets the bonds -
addBond
Description copied from interface:AtomAdd a bond -
getCharge
Description copied from interface:AtomGet the charge of this atom -
setCharge
Description copied from interface:AtomSet the charge of this atom
-