parmed.topologyobjects.Residue¶
-
class
parmed.topologyobjects.
Residue
(name, number=- 1, chain='', insertion_code='', segid='', list=None)[source]¶ A single residue that is composed of a small number of atoms
- Parameters
- name
str
Name of the residue. Typical convention is to choose a name that is 4 characters or shorter
- number
int
, optional Residue number assigned in the input structure. Default is -1
- chain
str
, optional The 1-letter chain identifier for this residue. Default is empty string
- insertion_code
str
, optional The insertion code (used in PDB files) for this residue. Default is empty string
- segid
str
, optional The segment identifier, used by CHARMM in a way similar to chain. Dfault is empty string
- list
TrackedList
List of residues in which this residue is a member
- name
Notes
Iterating over a residue will iterate over the atoms. It is exactly equivalent to iterating over the atoms attribute
Supports testing if an Atom instance is contained in this residue
len() returns the number of atoms in this residue
- Attributes
- name
str
The name of this residue
- number
int
The number of this residue in the input structure
- idx
int
The index of this residue inside the container. If this residue has no container, or it is not present in the container, idx is -1
- chain
str
The 1-letter chain identifier for this residue
- insertion_code
str
The insertion code (used in PDB files) for this residue
- ter
bool
If True, there is a TER card directly after this residue (i.e., a molecule or chain ends). By default, it is False
- list
TrackedList
The container that _may_ have this residue contained inside
- atoms
list of
:class`Atominstances
This is the list of `Atom`s that make up this residue
- name
Methods
add_atom
(atom)Adds an atom to this residue
delete_atom
(atom)If an atom is present in this residue, delete it from the list of atoms.
is_empty
()Determines if there are any atoms in this residue
sort
()Sorts the atoms in this list by atom index
-
__init__
(name, number=- 1, chain='', insertion_code='', segid='', list=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(name[, number, chain, …])Initialize self.
add_atom
(atom)Adds an atom to this residue
delete_atom
(atom)If an atom is present in this residue, delete it from the list of atoms.
is_empty
()Determines if there are any atoms in this residue
sort
()Sorts the atoms in this list by atom index
Attributes
idx