Package org.biojava.nbio.structure
Interface Atom
- All Known Implementing Classes:
AtomImpl
A simple interface for an Atom.
The coordinates can be accessed via the
getCoords()
, or the
getX()
, 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
Modifier and TypeMethodDescriptionvoid
Add a bondclone()
Return an 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 charge) 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 occupancy) 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.
-
Method Details
-
setName
Set atom name, e.g. "CA".- Parameters:
s
- a trimmed String specifying the name value- See Also:
-
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:
-
setElement
Set element of the atom name, e.g.Element.Fe
- Parameters:
e
- an Element enumeration- See Also:
-
getElement
Element getElement()Get element of the atom, e.g.Element.Ca
- Returns:
- an Element enumeration
- See Also:
-
setPDBserial
void setPDBserial(int i) Set PDB atom number.- Parameters:
i
- an int specifying the PDBserial value- See Also:
-
getPDBserial
int getPDBserial()Get PDB atom number.- Returns:
- an int representing the PDBserial value
- See Also:
-
setCoords
void setCoords(double[] c) Set the coordinates.- Parameters:
c
- an array of doubles specifying the coords value- See Also:
-
getCoords
double[] getCoords()Get the coordinates.- Returns:
- an array of doubles representing the coords value
- See Also:
-
setX
void setX(double x) Set the X coordinate.- Parameters:
x
- a double- See Also:
-
setY
void setY(double y) Set the Y coordinate.- Parameters:
y
- a double- See Also:
-
setZ
void setZ(double z) Set the Z coordinate.- Parameters:
z
- a double- See Also:
-
getX
double getX()Get coordinate X.- Returns:
- a double
- See Also:
-
getY
double getY()Get coordinate Y.- Returns:
- a double
- See Also:
-
getZ
double getZ()Get coordinate Z.- Returns:
- a double
- See Also:
-
setAltLoc
Set alternate Location.- Parameters:
c
- a Character object specifying the alt loc value- See Also:
-
getAltLoc
Character getAltLoc()Get alternate Location.- Returns:
- a Character object representing the alt loc value
- See Also:
-
setOccupancy
void setOccupancy(float occupancy) Set occupancy.- Parameters:
occupancy
- a float specifying the occupancy value- See Also:
-
getOccupancy
float getOccupancy()Get occupancy.- Returns:
- a float representing the occupancy value
- See Also:
-
setTempFactor
void setTempFactor(float temp) Set temp factor .- Parameters:
temp
- a float specifying the temp factor value- See Also:
-
getTempFactor
float getTempFactor()Get temp factor.- Returns:
- a float representing the temp factor value
- See Also:
-
clone
Object clone()Return an identical copy of this object .- Returns:
- an identical copy of this object
-
setGroup
Set the back-reference to its parent Group.- Parameters:
parent
- the parent Group- See Also:
-
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:
-
addBond
Add a bond- Parameters:
bond
- to be added- See Also:
-
getBonds
Get allBond
s this atom is part of.- Returns:
- a list of
Bond
s or null if no bonds exist for this Atom
-
setBonds
Sets the bonds- Parameters:
bonds
-
-
hasBond
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
-