Loading...
Searching...
No Matches
PLMD::isdb::OnebeadMapping Class Reference

The ONEBEAD coarse-grained mapping of an all-atom structure. More...

#include <OnebeadMapping.h>

Inheritance diagram for PLMD::isdb::OnebeadMapping:

Public Types

enum  {
  TRP , TYR , PHE , HIS ,
  HIP , ARG , LYS , CYS ,
  CYX , ASP , GLU , ILE ,
  LEU , MET , ASN , PRO ,
  GLN , SER , THR , VAL ,
  ALA , GLY , BB_PO2 , BB_PO3 ,
  BB_DNA , BB_DNA_5 , BB_DNA_3 , BB_RNA ,
  BB_RNA_5 , BB_RNA_3 , BASE_A , BASE_C ,
  BASE_T , BASE_G , BASE_U , GLYC_FUC ,
  GLYC_MAN , GLYC_BMA , GLYC_GAL , GLYC_GLC ,
  GLYC_NAG , GLYC_NGA , GLYC_SIA , OB_NA ,
  OB_K , OB_CL , OB_CA , OB_MG ,
  OB_ZN , OB_FE2 , OB_FE3 , OB_MN ,
  NONEBEAD
}
 Bead types of the ONEBEAD model. More...
 
enum  {
  ION_NA , ION_K , ION_CL , ION_CA ,
  ION_MG , ION_ZN , ION_FE2 , ION_FE3 ,
  ION_MN , NIONS
}
 Canonical ion identifiers. More...
 
typedef std::function< void(const std::string &)> ErrorHandler
 Called with a message when the input is not valid.
 

Public Member Functions

 OnebeadMapping (const PDB &tmpl, const std::vector< AtomNumber > &atoms, Log &log, const ErrorHandler &error)
 Build the mapping of atoms.
 
double getAtomMass (unsigned a) const
 The mass of atom a (g/mol), from its element.
 
const std::string & getAtomName (unsigned a) const
 The atom name of atom a, as in the template.
 
double getAtomWeight (unsigned a) const
 The mass of atom a divided by the mass of its bead: the derivative of the bead position with respect to the position of the atom.
 
unsigned getBead (unsigned a) const
 The bead of atom a.
 
const std::vector< unsigned > & getBeadAtoms () const
 
const std::vector< unsigned > & getBeadOffsets () const
 The atoms of bead b are getBeadAtoms()[k] for getBeadOffsets()[b] <= k < getBeadOffsets()[b+1], in increasing order.
 
void getBeadPositions (const std::vector< Vector > &pos, std::vector< Vector > &beads) const
 The positions of the beads (centres of mass) from those of the atoms.
 
unsigned getBeadType (unsigned b) const
 The bead type (TRP, ..., OB_MN) of bead b.
 
int getGlycanType (unsigned a) const
 The GLYC_* bead type of atom a, or -1 if the atom is not in a monosaccharide.
 
unsigned getNumberOfAtoms () const
 
unsigned getNumberOfBeads () const
 
const std::string & getResidueName (unsigned a) const
 The residue name of atom a, after onebeadResidueAlias().
 
bool isGlycanBridge (unsigned a) const
 True for the oxygens bound to two heavy atoms in a monosaccharide (ring and glycosidic oxygens), and for the protein or nucleic-acid atoms that carry a glycan.
 

Static Public Member Functions

static int glycanTypeFromResname (const std::string &resname, bool hasN)
 The GLYC_* bead type of a monosaccharide residue name, or -1 if the residue is not a supported glycan.
 
static double ionMass (unsigned ion)
 The atomic mass (g/mol) of an ion.
 
static int ionTypeFromResname (const std::string &resname)
 The canonical ION_* id for a residue name, or -1 if it is not a known ion.
 
static bool isOnebeadProteinResidue (const PDB &pdb, const std::string &resname)
 True when the residue is an amino acid (a single bead), CYX included.
 
static bool isUnsupportedGlycan (const std::string &resname)
 True for monosaccharides that are recognised but not parameterised.
 
static unsigned obSlot (unsigned ion)
 The ONEBEAD bead type of an ion.
 
static std::string onebeadResidueAlias (const std::string &resname)
 The canonical name of a residue whose name encodes a glycosylation site (e.g.
 

Private Member Functions

void assignBeadTypes (const PDB &tmpl, const std::vector< AtomNumber > &atoms, const ErrorHandler &error)
 

Private Attributes

std::vector< std::string > atom_name_
 
std::vector< double > atom_weight_
 
std::vector< unsigned > bead_atoms_
 
std::vector< double > bead_inv_mass_
 
std::vector< unsigned > bead_of_
 
std::vector< unsigned > bead_off_
 
std::vector< unsigned > bead_type_
 
std::vector< bool > glyc_bridge_
 
std::vector< int > glyc_type_
 
std::vector< double > mass_
 
std::vector< std::string > residue_name_
 

Detailed Description

The ONEBEAD coarse-grained mapping of an all-atom structure.

Every amino acid is one bead, every nucleotide is two or three beads (sugar, base and, when present, phosphate), every monosaccharide is one bead and every monoatomic ion is one bead. A bead is the centre of mass of its atoms.

The mapping is built from an all-atom PDB (the template), read chain by chain and, within a chain, residue by residue. The template must contain exactly the atoms of the list passed to the constructor, in the same order. Atom indices in this class are positions in that list.

Member Typedef Documentation

◆ ErrorHandler

typedef std::function<void(const std::string &)> PLMD::isdb::OnebeadMapping::ErrorHandler

Called with a message when the input is not valid.

It must not return (e.g. Action::error); if it does, the constructor throws.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Bead types of the ONEBEAD model.

Enumerator
TRP 
TYR 
PHE 
HIS 
HIP 
ARG 
LYS 
CYS 
CYX 
ASP 
GLU 
ILE 
LEU 
MET 
ASN 
PRO 
GLN 
SER 
THR 
VAL 
ALA 
GLY 
BB_PO2 
BB_PO3 
BB_DNA 
BB_DNA_5 
BB_DNA_3 
BB_RNA 
BB_RNA_5 
BB_RNA_3 
BASE_A 
BASE_C 
BASE_T 
BASE_G 
BASE_U 
GLYC_FUC 
GLYC_MAN 
GLYC_BMA 
GLYC_GAL 
GLYC_GLC 
GLYC_NAG 
GLYC_NGA 
GLYC_SIA 
OB_NA 
OB_K 
OB_CL 
OB_CA 
OB_MG 
OB_ZN 
OB_FE2 
OB_FE3 
OB_MN 
NONEBEAD 

◆ anonymous enum

anonymous enum
inherited

Canonical ion identifiers.

The ATOMISTIC (AFF_*) and ONEBEAD (OB_*) ion slots of SAXS are listed in this same order.

Enumerator
ION_NA 
ION_K 
ION_CL 
ION_CA 
ION_MG 
ION_ZN 
ION_FE2 
ION_FE3 
ION_MN 
NIONS 

Constructor & Destructor Documentation

◆ OnebeadMapping()

PLMD::isdb::OnebeadMapping::OnebeadMapping ( const PDB & tmpl,
const std::vector< AtomNumber > & atoms,
Log & log,
const ErrorHandler & error )

Build the mapping of atoms.

The template must be read with scale 1 (Angstrom). A summary of the residue-name aliases and of the glycans is written to log.

Member Function Documentation

◆ assignBeadTypes()

void PLMD::isdb::OnebeadMapping::assignBeadTypes ( const PDB & tmpl,
const std::vector< AtomNumber > & atoms,
const ErrorHandler & error )
private

◆ getAtomMass()

double PLMD::isdb::OnebeadMapping::getAtomMass ( unsigned a) const
inline

The mass of atom a (g/mol), from its element.

◆ getAtomName()

const std::string & PLMD::isdb::OnebeadMapping::getAtomName ( unsigned a) const
inline

The atom name of atom a, as in the template.

◆ getAtomWeight()

double PLMD::isdb::OnebeadMapping::getAtomWeight ( unsigned a) const
inline

The mass of atom a divided by the mass of its bead: the derivative of the bead position with respect to the position of the atom.

◆ getBead()

unsigned PLMD::isdb::OnebeadMapping::getBead ( unsigned a) const
inline

The bead of atom a.

◆ getBeadAtoms()

const std::vector< unsigned > & PLMD::isdb::OnebeadMapping::getBeadAtoms ( ) const
inline

◆ getBeadOffsets()

const std::vector< unsigned > & PLMD::isdb::OnebeadMapping::getBeadOffsets ( ) const
inline

The atoms of bead b are getBeadAtoms()[k] for getBeadOffsets()[b] <= k < getBeadOffsets()[b+1], in increasing order.

◆ getBeadPositions()

void PLMD::isdb::OnebeadMapping::getBeadPositions ( const std::vector< Vector > & pos,
std::vector< Vector > & beads ) const

The positions of the beads (centres of mass) from those of the atoms.

The sums are done in the order of the atoms, so the result does not depend on the number of threads.

◆ getBeadType()

unsigned PLMD::isdb::OnebeadMapping::getBeadType ( unsigned b) const
inline

The bead type (TRP, ..., OB_MN) of bead b.

◆ getGlycanType()

int PLMD::isdb::OnebeadMapping::getGlycanType ( unsigned a) const
inline

The GLYC_* bead type of atom a, or -1 if the atom is not in a monosaccharide.

◆ getNumberOfAtoms()

unsigned PLMD::isdb::OnebeadMapping::getNumberOfAtoms ( ) const
inline

◆ getNumberOfBeads()

unsigned PLMD::isdb::OnebeadMapping::getNumberOfBeads ( ) const
inline

◆ getResidueName()

const std::string & PLMD::isdb::OnebeadMapping::getResidueName ( unsigned a) const
inline

The residue name of atom a, after onebeadResidueAlias().

◆ glycanTypeFromResname()

int PLMD::isdb::OnebeadTypes::glycanTypeFromResname ( const std::string & resname,
bool hasN )
staticinherited

The GLYC_* bead type of a monosaccharide residue name, or -1 if the residue is not a supported glycan.

hasN must be true when the residue carries an amide nitrogen: that is what distinguishes GlcNAc from Glc and GalNAc from Gal when the input file names an N-acetylhexosamine after its parent hexose.

◆ ionMass()

double PLMD::isdb::OnebeadTypes::ionMass ( unsigned ion)
staticinherited

The atomic mass (g/mol) of an ion.

◆ ionTypeFromResname()

int PLMD::isdb::OnebeadTypes::ionTypeFromResname ( const std::string & resname)
staticinherited

The canonical ION_* id for a residue name, or -1 if it is not a known ion.

◆ isGlycanBridge()

bool PLMD::isdb::OnebeadMapping::isGlycanBridge ( unsigned a) const
inline

True for the oxygens bound to two heavy atoms in a monosaccharide (ring and glycosidic oxygens), and for the protein or nucleic-acid atoms that carry a glycan.

◆ isOnebeadProteinResidue()

bool PLMD::isdb::OnebeadTypes::isOnebeadProteinResidue ( const PDB & pdb,
const std::string & resname )
staticinherited

True when the residue is an amino acid (a single bead), CYX included.

◆ isUnsupportedGlycan()

bool PLMD::isdb::OnebeadTypes::isUnsupportedGlycan ( const std::string & resname)
staticinherited

True for monosaccharides that are recognised but not parameterised.

◆ obSlot()

static unsigned PLMD::isdb::OnebeadTypes::obSlot ( unsigned ion)
inlinestaticinherited

The ONEBEAD bead type of an ion.

◆ onebeadResidueAlias()

std::string PLMD::isdb::OnebeadTypes::onebeadResidueAlias ( const std::string & resname)
staticinherited

The canonical name of a residue whose name encodes a glycosylation site (e.g.

NLN -> ASN); other names are returned unchanged.

Member Data Documentation

◆ atom_name_

std::vector<std::string> PLMD::isdb::OnebeadMapping::atom_name_
private

◆ atom_weight_

std::vector<double> PLMD::isdb::OnebeadMapping::atom_weight_
private

◆ bead_atoms_

std::vector<unsigned> PLMD::isdb::OnebeadMapping::bead_atoms_
private

◆ bead_inv_mass_

std::vector<double> PLMD::isdb::OnebeadMapping::bead_inv_mass_
private

◆ bead_of_

std::vector<unsigned> PLMD::isdb::OnebeadMapping::bead_of_
private

◆ bead_off_

std::vector<unsigned> PLMD::isdb::OnebeadMapping::bead_off_
private

◆ bead_type_

std::vector<unsigned> PLMD::isdb::OnebeadMapping::bead_type_
private

◆ glyc_bridge_

std::vector<bool> PLMD::isdb::OnebeadMapping::glyc_bridge_
private

◆ glyc_type_

std::vector<int> PLMD::isdb::OnebeadMapping::glyc_type_
private

◆ mass_

std::vector<double> PLMD::isdb::OnebeadMapping::mass_
private

◆ residue_name_

std::vector<std::string> PLMD::isdb::OnebeadMapping::residue_name_
private

The documentation for this class was generated from the following files: