parmed.topologyobjects.Atom¶
-
class
parmed.topologyobjects.
Atom
(list=None, atomic_number=0, name='', type='', charge=None, mass=0.0, nb_idx=0, solvent_radius=0.0, screen=0.0, tree='BLA', join=0.0, irotat=0.0, occupancy=0.0, bfactor=0.0, altloc='', number=- 1, rmin=None, epsilon=None, rmin14=None, epsilon14=None)[source]¶ An atom. Only use these as elements in AtomList instances, since AtomList will keep track of when indexes and other stuff needs to be updated. All parameters are optional.
- Parameters
- atomic_number
int
The atomic number of this atom
- name
str
The name of this atom
- type
str
The type name of this atom
- charge
float
The partial atomic charge of this atom in fractions of an electron
- mass
float
The atomic mass of this atom in daltons
- nb_idx
int
The nonbonded index. This is a pointer that is relevant in the context of an Amber topology file and identifies its Lennard-Jones atom type
- solvent_radius
float
The intrinsic solvation radius of this atom.
- screen
float
The Generalized Born screening factor for this atom.
- occupancy
float
The occupancy of the atom (see PDB file)
- bfactor
float
The B-factor of the atom (see PDB file)
- altloc
str
Alternate location indicator (see PDB file)
- atomic_number
- Other Parameters
- list
AtomList
The AtomList that this atom belongs to. If None, this atom does not belong to any list. This can be any iterable, but should typically be an AtomList or None
- tree
str
The tree chain identifier assigned to this atom. Relevant in the context of an Amber topology file, and not used for very much.
- join
int
The ‘join` property of atoms stored in the Amber topology file. At the time of writing this class, join is unused, but still oddly required. Add support for future-proofing
- irotat
int
The irotat property of atoms stored in the Amber topology file. Unused, but included for future-proofing.
- number
int
The serial number given to the atom (see PDB file)
- rmin
float
The Rmin/2 Lennard-Jones parameter for this atom. Default evaluates to 0
- epsilon
float
The epsilon (well depth) Lennard-Jones parameter for this atom. Default evaluates to 0
- rmin14
float
The Rmin/2 Lennard-Jones parameter for this atom in 1-4 interactions. Default evaluates to 0
- epsilon14
float
The epsilon (well depth) Lennard-Jones parameter for this atom in 1-4 interactions. Default evaluates to 0
- list
Notes
The bond_partners, angle_partners, dihedral_partners, and exclusion_partners arrays are actually generated as properties by taking differences of sets and sorting them. As a result, accessing this attribute constantly can be less efficient than you would expect. Iterating over them in a loop requires minimal overhead. But if frequent access is needed and these sets are guaranteed not to change, you should save a reference to the object and use that instead.
Binary comparisons are done by atom index and are used primarily for sorting sublists of atoms. The == operator is not defined, so Atom equality should be done using the is operator. This allows Atom instances to be hashable (and so used as dict keys and put in `set`s)
Examples
>>> a1 = Atom(name='CO', type='C', charge=0.5, mass=12.01) >>> a2 = Atom(name='OC', type='O', charge=-0.5, mass=12.01) >>> a1.bond_to(a2) >>> a1 in a2.bond_partners and a2 in a1.bond_partners True >>> a1.idx # Not part of a container -1
This object also supports automatic indexing when it is part of a container
>>> atom_list = [] >>> atom_list.append(Atom(list=atom_list, name='CO', charge=0.5)) >>> atom_list.append(Atom(list=atom_list, name='OC', charge=-0.5)) >>> atom_list[0].idx 0 >>> atom_list[1].idx 1
- Attributes
angle_partners
List of all angle partners that are NOT bond partners
bond_partners
Go through all bonded partners
- charge
dihedral_partners
List of all dihedral partners that are NOT angle or bond partners
- element
- element_name
epsilon
Lennard-Jones epsilon parameter (the Lennard-Jones well depth)
epsilon_14
The 1-4 Lennard-Jones epsilon parameter
exclusion_partners
List of all exclusions not otherwise excluded by bonds/angles/torsions
- idx
rmin
Lennard-Jones Rmin/2 parameter (the Lennard-Jones radius)
rmin_14
The 1-4 Lennard-Jones Rmin/2 parameter
sigma
Lennard-Jones sigma parameter – directly related to Rmin
sigma_14
Lennard-Jones sigma parameter – directly related to Rmin
tortor_partners
List of all 1-5 partners that are NOT in angle or bond partners.
ucharge
Charge with units
uepsilon
Lennard-Jones epsilon parameter with units
uepsilon_14
The 1-4 Lennard-Jones epsilon parameter
- umass
urmin
Lennard-Jones Rmin/2 parameter with units
urmin_14
The 1-4 Lennard-Jones Rmin/2 parameter with units
usigma
Lennard-Jones sigma parameter with units
usigma_14
The 1-4 Lennard-Jones sigma parameter with units
usolvent_radius
Solvation radius with units attached
Methods
angle_to
(other)Log this atom as angled to another atom.
bond_to
(other)Log this atom as bonded to another atom.
dihedral_to
(other)Log this atom as dihedral-ed to another atom.
exclude
(other)Add one atom to my arbitrary exclusion list
nonbonded_exclusions
([only_greater, index_from])Returns the total number of nonbonded atom exclusions for this atom.
For extra points, the exclusion partners may be filled before the bond, angle, dihedral, and tortor partners.
tortor_to
(other)Log this atom as 1-5 partners to another atom
-
__init__
(list=None, atomic_number=0, name='', type='', charge=None, mass=0.0, nb_idx=0, solvent_radius=0.0, screen=0.0, tree='BLA', join=0.0, irotat=0.0, occupancy=0.0, bfactor=0.0, altloc='', number=- 1, rmin=None, epsilon=None, rmin14=None, epsilon14=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
([list, atomic_number, name, type, …])Initialize self.
angle_to
(other)Log this atom as angled to another atom.
bond_to
(other)Log this atom as bonded to another atom.
dihedral_to
(other)Log this atom as dihedral-ed to another atom.
exclude
(other)Add one atom to my arbitrary exclusion list
nonbonded_exclusions
([only_greater, index_from])Returns the total number of nonbonded atom exclusions for this atom.
For extra points, the exclusion partners may be filled before the bond, angle, dihedral, and tortor partners.
tortor_to
(other)Log this atom as 1-5 partners to another atom
Attributes
List of all angle partners that are NOT bond partners
Go through all bonded partners
List of all dihedral partners that are NOT angle or bond partners
Lennard-Jones epsilon parameter (the Lennard-Jones well depth)
The 1-4 Lennard-Jones epsilon parameter
List of all exclusions not otherwise excluded by bonds/angles/torsions
idx
Lennard-Jones Rmin/2 parameter (the Lennard-Jones radius)
The 1-4 Lennard-Jones Rmin/2 parameter
Lennard-Jones sigma parameter – directly related to Rmin
Lennard-Jones sigma parameter – directly related to Rmin
List of all 1-5 partners that are NOT in angle or bond partners.
Charge with units
Lennard-Jones epsilon parameter with units
The 1-4 Lennard-Jones epsilon parameter
Lennard-Jones Rmin/2 parameter with units
The 1-4 Lennard-Jones Rmin/2 parameter with units
Lennard-Jones sigma parameter with units
The 1-4 Lennard-Jones sigma parameter with units
Solvation radius with units attached