Atom¶
This class stores all properties (attributes) related to an atom.
When pmx reads a PDB file, each line starting with “ATOM” or “HETATM”
is converted to an Atom
instance. In addition, the atom class also has a number
of methods that can be used to calculate distances, angles and dihedrals.
API Reference¶
-
class
pmx.atom.
Atom
(line=None, mol2line=None, **kwargs)¶ Atom Class.
- Parameters
line (str, optional) – input line in PDB format. Default is None.
mol2line (str, optional) – input line in MOL2 format. Default is None.
-
id
¶ atom id
- Type
int
-
name
¶ atom name
- Type
str
-
resname
¶ name of residue atom is part of
- Type
str
-
chain_id
¶ ID of the chain atom belongs to
- Type
str
-
x
¶ atom coordinates
- Type
array
-
occ
¶ occupancy
- Type
float
-
bfac
¶ B-factor
- Type
float
-
symbol
¶ chemical element of the atom
- Type
str
-
unity
¶ unit of the coordinates, either ‘A’ or ‘nm’. Default is ‘A’.
- Type
str
Methods
dist
(other)Calculates the distance between two atoms.
dist2
(other)Calculates the squared distance between two atoms.
translate
(v)Translates the position of the atom.
angle
(other1, other2[, degree])Calcluates the angle between 3 atoms.
dihedral
(other1, other2, other3[, degree])Calculates the dihedral angle between four atoms.
nm2a
()Converts the Atom coordinates from nanometers (nm) to Angstrom (A).
a2nm
()Converts the Atom coordinates from Angstrom (A) to nanometers (nm).