# Class monomer

- Defined in File model.hpp

## Inheritance Relationships

### Base Type

- `public cif::mm::residue` (Class residue)

## Class Documentation

class monomer : public cif::mm::residue

  a monomer models a single residue in a protein chain

  Public Functions

  monomer(const polymer &polymer, std::size_t index, int seqID, const std::string &authSeqID, const std::string &pdbInsCode, const std::string &compoundID)

    constructor with actual values

  monomer(const monomer &rhs) = default

    Copy constructor.

  inline monomer(monomer &&rhs)

    Move constructor.

  inline monomer &operator=(monomer rhs)

    Assignment for both move and copy (modern move semantics).

  bool is_first_in_chain() const

    Return if this residue is the first residue in the chain.

  bool is_last_in_chain() const

    Return if this residue is the last residue in the chain.

  const monomer &prev() const

    Return previous monomer in polymer.

  const monomer &next() const

    Return next monomer in polymer.

  bool has_alpha() const

    Return if a alpha value can be calculated (depends on location in chain).

  bool has_kappa() const

    Return if a kappa value can be calculated (depends on location in chain).

  float phi() const

    Return the phi value for this residue.

  float psi() const

    Return the psi value for this residue.

  float alpha() const

    Return the alpha value for this residue.

  float kappa() const

    Return the kappa value for this residue.

  float tco() const

    Return the tco value for this residue.

  float omega() const

    Return the omega value for this residue.

  std::size_t nr_of_chis() const

    Return how many torsion angles can be calculated.

  float chi(std::size_t i) const

    Return torsion angle i.

  bool is_cis() const

    Return true if this residue is in a cis conformation.

  bool is_complete() const

    Returns true if the four atoms C, CA, N and O are present.

  bool has_alternate_backbone_atoms() const

    Returns true if any of the backbone atoms has an alternate.

  inline atom CAlpha() const

    Return the CAlpha atom.

  inline atom C() const

    Return the C atom.

  inline atom N() const

    Return the N atom.

  inline atom O() const

    Return the O atom.

  inline atom H() const

    Return the H atom.

  inline bool is_bonded_to(const monomer &rhs) const

    Return true if this monomer is bonded to monomer rhs.

  float chiral_volume() const

    Return the chiral volume, only for LEU and VAL.

  inline bool operator==(const monomer &rhs) const

    Compare this monomer with rhs.

  virtual atom create_new_atom(atom_type inType, const std::string &inAtomID, point inLocation) override

    Create a new atom and add it to the list.

    Returns:

      newly created atom

  Public Static Functions

  static bool are_bonded(const monomer &a, const monomer &b, float errorMargin = 0.5f)

    Return true if the distance between the CA atoms of the two monomers a and b are within the expected range with an error margin of errorMargin.

    The expected distance is 3.0 ångström for a cis conformation and 3.8 ångström for trans.

  static bool is_cis(const monomer &a, const monomer &b)

    Return true if the bond between a and b is cis.

  static float omega(const monomer &a, const monomer &b)

    Return the omega angle between a and b.

  Friends

  inline friend void swap(monomer &a, monomer &b) noexcept

    swap two monomers