# Residue

Chemfiles.ResidueType

A Residue is a group of atoms belonging to the same logical unit. They can be small molecules, amino-acids in a protein, monomers in polymers, etc.

source
Chemfiles.ResidueType
Residue(name::String, id=nothing)

Create a new residue with the given name and optional residue identifier id.

source
Chemfiles.ResidueMethod
Residue(topology::Topology, index::Integer)

Get a copy of the residue at index from a topology.

The residue index in the topology is not always the same as the residue identifier.

source
Chemfiles.add_atom!Method
add_atom!(residue::Residue, index::Integer)

Add the atom at the given index in the residue.

source
Chemfiles.idMethod
id(residue::Residue)

Get the identifier of a residue in the initial topology.

source
Chemfiles.residue_for_atomMethod
residue_for_atom(topology::Topology, index::Integer)

Get a copy of the residue containing the atom at index in the topology.

This function will return nothing if the atom is not in a residue, or if the index is bigger than the number of atoms in the topology.

source