Residue type and associated function

type Residue

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.

function Residue(ptr::Ptr{lib.CHFL_RESIDUE})
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.
function Residue(name::String)
Create a new residue with the given name
function Residue(name::String, resid::Integer)
Create a new residue with the given name and residue identifier resid.
function 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.

function 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.

function deepcopy(residue::Residue)
Make a deep copy of a residue.
function name(residue::Residue)
Get the name of a residue.
function id(residue::Residue)
Get the identifier of a residue in the initial topology.
function size(residue::Residue)
Get the number of atoms in a residue.
function add_atom!(residue::Residue, index::Integer)
Add the atom at the given index in the residue.
function contains(residue::Residue, index::Integer)
Check if the atom at the given index is in the residue.
function deepcopy(residue::Residue)
Make a deep copy of a residue.