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
Modifier and TypeFieldDescriptionstatic final int
The inital capacity of the bonds list. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a bondclone()
returns and identical copy of this object .Get alternate Location.getBonds()
Get allBond
s this atom is part of.short
Get the charge of this atomdouble[]
Get the coordinates.Get element of the atom, e.g.getGroup()
Return the parent Group of the Atom.getName()
Get atom name, e.g.float
Get occupancy.int
Get PDB atom number.float
Get temp factor.double
getX()
Get coordinate X.double
getY()
Get coordinate Y.double
getZ()
Get coordinate Z.boolean
Test if another atom has a bond to this atomvoid
Set alternate Location.void
Sets the bondsvoid
setCharge
(short inputCharge) Set the charge of this atomvoid
setCoords
(double[] c) Set the coordinates.void
Set element of the atom name, e.g.void
Set the back-reference to its parent Group.void
Set atom name, e.g.void
setOccupancy
(float occu) Set occupancy.void
setPDBserial
(int i) Set PDB atom number.void
setTempFactor
(float temp) Set temp factor .void
setX
(double x) Set the X coordinate.void
setY
(double y) Set the Y coordinate.void
setZ
(double z) Set the Z coordinate.toPDB()
Returns a PDB file like representation of this record.void
toPDB
(StringBuffer buf) Appends a PDB file like representation of this record to the provided StringBuffer.toString()
-
Field Details
-
BONDS_INITIAL_CAPACITY
public static final int BONDS_INITIAL_CAPACITYThe 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
public void setPDBserial(int i) Set PDB atom number.- Specified by:
setPDBserial
in interfaceAtom
- Parameters:
i
- an int specifying the PDBserial value- See Also:
-
getPDBserial
public int getPDBserial()Get PDB atom number.- Specified by:
getPDBserial
in interfaceAtom
- Returns:
- an int representing the PDBserial value
- See Also:
-
setCoords
public void setCoords(double[] c) Set the coordinates. -
getCoords
public double[] getCoords()Get the coordinates. -
setX
public void setX(double x) Description copied from interface:Atom
Set the X coordinate. -
setY
public void setY(double y) Description copied from interface:Atom
Set the Y coordinate. -
setZ
public void setZ(double z) Description copied from interface:Atom
Set the Z coordinate. -
getX
public double getX()Get coordinate X. -
getY
public double getY()Get coordinate Y. -
getZ
public double getZ()Get coordinate Z. -
setAltLoc
Set alternate Location. -
getAltLoc
Get alternate Location. -
toString
-
setOccupancy
public void setOccupancy(float occu) Description copied from interface:Atom
Set occupancy.- Specified by:
setOccupancy
in interfaceAtom
- Parameters:
occu
- a float specifying the occupancy value- See Also:
-
getOccupancy
public float getOccupancy()Description copied from interface:Atom
Get occupancy.- Specified by:
getOccupancy
in interfaceAtom
- Returns:
- a float representing the occupancy value
- See Also:
-
setTempFactor
public void setTempFactor(float temp) Description copied from interface:Atom
Set temp factor .- Specified by:
setTempFactor
in interfaceAtom
- Parameters:
temp
- a float specifying the temp factor value- See Also:
-
getTempFactor
public float getTempFactor()Description copied from interface:Atom
Get temp factor.- Specified by:
getTempFactor
in 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:
getElement
in interfaceAtom
- Returns:
- an Element enumeration
- See Also:
-
setElement
Set element of the atom name, e.g.Element.Fe
- Specified by:
setElement
in interfaceAtom
- Parameters:
e
- an Element enumeration- See Also:
-
toPDB
Description copied from interface:PDBRecord
Returns a PDB file like representation of this record. -
toPDB
Description copied from interface:PDBRecord
Appends a PDB file like representation of this record to the provided StringBuffer. -
getBonds
Get allBond
s 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:Atom
Add a bond -
getCharge
public short getCharge()Description copied from interface:Atom
Get the charge of this atom -
setCharge
public void setCharge(short inputCharge) Description copied from interface:Atom
Set the charge of this atom
-