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
namestr

Name of the residue. Typical convention is to choose a name that is 4 characters or shorter

numberint, optional

Residue number assigned in the input structure. Default is -1

chainstr, optional

The 1-letter chain identifier for this residue. Default is empty string

insertion_codestr, optional

The insertion code (used in PDB files) for this residue. Default is empty string

segidstr, optional

The segment identifier, used by CHARMM in a way similar to chain. Dfault is empty string

listTrackedList

List of residues in which this residue is a member

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
namestr

The name of this residue

numberint

The number of this residue in the input structure

idxint

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

chainstr

The 1-letter chain identifier for this residue

insertion_codestr

The insertion code (used in PDB files) for this residue

terbool

If True, there is a TER card directly after this residue (i.e., a molecule or chain ends). By default, it is False

listTrackedList

The container that _may_ have this residue contained inside

atomslist of :class`Atom instances

This is the list of `Atom`s that make up this residue

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