Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Molecular_covalent_structure< ParticleInfo > Class Template Reference

Representation of the covalent structure of a molecular conformation. More...

#include <Molecular_covalent_structure.hpp>

Classes

class  Bond_angles_iterator_base
 
class  Dihedral_angles_iterator_base
 
class  Is_embedded
 
class  Is_valid
 
class  Label_writer
 
class  Make_valid
 

Public Types

enum  Bond_type { SIMPLE_BOND = 1, DOUBLE_BOND = 2, TRIPLE_BOND = 3 }
 
typedef T_Molecular_covalent_structure< ParticleInfo > Self
 
typedef T_Particle_info_traits< ParticleInfo > Particle_info_traits
 
typedef Particle_info_traits::Particle_info Particle_info
 
typedef boost::subgraph< boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, Particle_info, boost::property< boost::edge_index_t, int, Bond_type > > > Covalent_structure_graph
 
typedef boost::graph_traits< Covalent_structure_graphCovalent_structure_graph_traits
 
typedef Covalent_structure_graph_traits::vertex_descriptor Particle_rep
 
typedef Covalent_structure_graph_traits::edge_descriptor Bond_rep
 
typedef boost::tuple< Bond_rep, Bond_repBond_angle_rep
 
typedef boost::tuple< Bond_rep, Bond_rep, Bond_repTorsion_angle_rep
 
typedef Covalent_structure_graph_traits::vertex_iterator Particles_iterator_base
 
typedef boost::filter_iterator< Is_embedded, Particles_iterator_baseParticles_iterator
 
typedef Covalent_structure_graph_traits::edge_iterator Bonds_iterator_base
 
typedef boost::filter_iterator< Is_embedded, Bonds_iterator_baseBonds_iterator_filtered
 
typedef boost::transform_iterator< Make_valid, Bonds_iterator_filteredBonds_iterator
 
typedef Covalent_structure_graph_traits::out_edge_iterator Incident_bonds_iterator_base
 
typedef boost::filter_iterator< Is_embedded, Incident_bonds_iterator_baseIncident_bonds_iterator
 
typedef boost::filter_iterator< Is_valid, Bond_angles_iterator_baseBond_angles_iterator
 
typedef boost::filter_iterator< Is_valid, Dihedral_angles_iterator_baseDihedral_angles_iterator
 
typedef std::vector< Torsion_angle_rep >::const_iterator Improper_angles_iterator_base
 
typedef boost::filter_iterator< Is_valid, Improper_angles_iterator_baseImproper_angles_iterator
 

Public Member Functions

template<class InputIterator >
T_Molecular_covalent_structure< ParticleInfo > & get_sub_structure (InputIterator begin, InputIterator end, Self &S)
 

Predicates

bool are_1_2 (Particle_rep p, Particle_rep q) const
 check that p and q share a bond More...
 
bool are_1_3 (Particle_rep p, Particle_rep q) const
 check that p and q share an incident particle More...
 
bool are_1_4 (Particle_rep p, Particle_rep q) const
 

Accessors

const Covalent_structure_graphget_graph (void) const
 
Covalent_structure_graphget_graph (void)
 
unsigned get_number_of_particles (void) const
 
unsigned get_number_of_modeled_particles (void) const
 
unsigned get_number_of_embedded_particles (void) const
 
bool is_fully_embedded (void) const
 
unsigned get_number_of_bonds (void) const
 
unsigned get_number_of_modeled_bonds (void) const
 
unsigned get_number_of_embedded_bonds (void) const
 
std::pair< Particle_rep, Particle_repget_particles (Bond_rep b) const
 
Bond_rep get_bond (Bond_angle_rep b, unsigned i) const
 Get the (i+1)-th bond from a bond angle, with i = 0 or 1. More...
 
Bond_rep get_bond (Torsion_angle_rep b, unsigned i) const
 Get the (i+1)-th bond from a torsion angle, with i = 0,1 or 2. More...
 
Particle_rep get_particle_rep (Bond_rep b, unsigned i) const
 Get the (i+1)-th particle from a bond, with i = 0 or 1. More...
 
Particle_rep get_particle_rep (Bond_angle_rep b, unsigned i) const
 Get the (i+1)-th particle from a bond angle, with i = 0,1 or 2. More...
 
Particle_rep get_particle_rep (Torsion_angle_rep b, unsigned i) const
 Get the (i+1)-th particle from a torsion angle, with i = 0, 1, 2 or 3. More...
 
std::pair< bool, Bond_repget_bond_rep (Particle_rep p, Particle_rep q) const
 Get the bond represented by the two input particles, if any. More...
 
Bond_rep get_mirror_bond_rep (Bond_rep u) const
 
std::pair< bool, Bond_angle_repget_bond_angle_rep (Bond_rep b_1, Bond_rep b_2) const
 
std::pair< bool, Torsion_angle_repget_torsion_angle_rep (Bond_rep b_1, Bond_rep b_2, Bond_rep b_3) const
 
Bond_rep get_cannonized_rep (Bond_rep b) const
 Return the bond such that the smallest vertex index is first. More...
 
Bond_angle_rep get_cannonized_rep (Bond_angle_rep a) const
 Return the bond angle such that the smallest vertex index is first. More...
 
Torsion_angle_rep get_cannonized_rep (Torsion_angle_rep a) const
 If a proper angle, return it with the samellest vertex index first, otherwise return the improper angle itself. More...
 
std::pair< bool, Particle_repfind_particle (const Particle_info &info) const
 
bool has_model (Particle_rep p) const
 
bool is_embedded (Particle_rep p) const
 
int get_model_position (Particle_rep p) const
 
template<class Conformation >
const SBL::Models::T_Conformation_traits< Conformation >::FTget_x (const Conformation &C, Particle_rep p) const
 
template<class Conformation >
SBL::Models::T_Conformation_traits< Conformation >::FTget_x (Conformation &C, Particle_rep p) const
 
template<class Conformation >
const SBL::Models::T_Conformation_traits< Conformation >::FTget_y (const Conformation &C, Particle_rep p) const
 
template<class Conformation >
SBL::Models::T_Conformation_traits< Conformation >::FTget_y (Conformation &C, Particle_rep p) const
 
template<class Conformation >
const SBL::Models::T_Conformation_traits< Conformation >::FTget_z (const Conformation &C, Particle_rep p) const
 
template<class Conformation >
SBL::Models::T_Conformation_traits< Conformation >::FTget_z (Conformation &C, Particle_rep p) const
 

Modifiers

Particle_rep add_particle (const Particle_info &info)
 Add a new particle in the covalent structure corresponding to the ith particle in a given conformation of the molecule. More...
 
std::pair< Bond_rep, bool > add_bond (Particle_rep p, Particle_rep q, Bond_type bond_type=SIMPLE_BOND)
 
std::pair< bool, Torsion_angle_repadd_improper_constraint (Particle_rep p, Particle_rep q, Particle_rep r, Particle_rep s)
 
void set_particle_position (Particle_rep p, int position)
 

Traversal

Particles_iterator particles_begin (bool is_embedded=true) const
 
Particles_iterator particles_end (bool is_embedded=true) const
 
Bonds_iterator bonds_begin (bool is_embedded=true) const
 
Bonds_iterator bonds_end (bool is_embedded=true) const
 
Incident_bonds_iterator incident_bonds_begin (Particle_rep p, bool is_embedded=true) const
 
Incident_bonds_iterator incident_bonds_end (Particle_rep p, bool is_embedded=true) const
 
Bond_angles_iterator bond_angles_begin (bool is_embedded=true) const
 Iterate over the bond angles (u, v, w) so that u and v are the largest indices lower than w such that (u, v) and (v, w) are bonds. More...
 
Bond_angles_iterator bond_angles_end (bool is_embedded=true) const
 Iterate over the bond angles (u, v, w) so that u and v are the largest indices lower than w such that (u, v) and (v, w) are bonds. More...
 
Dihedral_angles_iterator dihedral_angles_begin (bool is_embedded=true) const
 Iterate over the torsion angles (u, v, w, t) so that u, v and w are the largest indices lower than t such that (u, v), (v, w) and (w, t) are bonds. More...
 
Dihedral_angles_iterator dihedral_angles_end (bool is_embedded=true) const
 Iterate over the torsion angles (u, v, w, t) so that u, v and w are the largest indices lower than t such that (u, v), (v, w) and (w, t) are bonds. More...
 
Improper_angles_iterator improper_angles_begin (bool is_embedded=true) const
 Iterate over the torsion angles (u, v, w, t) so that (u, v), (u, w) and (u, t) are bonds. More...
 
Improper_angles_iterator improper_angles_end (bool is_embedded=true) const
 Iterate over the torsion angles (u, v, w, t) so that (u, v), (u, w) and (u, t) are bonds. More...
 

Subgraphs

template<class OutputIterator >
OutputIterator get_molecules (OutputIterator out) const
 Computes the connected components of this graph and returns one vertex for each connected component. More...
 
template<class OutputIterator >
OutputIterator get_particles_in_molecule (Particle_rep p, OutputIterator out) const
 Returns the ensemble of particles in the same molecule (i.e connected component) as p. More...
 
template<class InputIterator >
Selfget_sub_structure (InputIterator begin, InputIterator end, Self &S)
 Builds a new covalent structure containing only the particles in the input range; note that no new copy of the information is created, and modifying the underlying graph of one covalent structure affects the other one. More...
 
Selfget_molecule (Particle_rep p, Self &S)
 Builds a new covalent structure containing only the particles of the molecule containing p;. More...
 

Print

std::ostream & print (std::ostream &out) const
 

Detailed Description

template<class ParticleInfo = std::string>
class SBL::CSB::T_Molecular_covalent_structure< ParticleInfo >

Representation of the covalent structure of a molecular conformation.

It uses a boost graph for encoding that covalent structure and offers the possibility to access internal and cartesian coordinates of the structure.

  \tparam ParticleInfo Information to attached to the particle (default is a simple string). It should be comparable (less operator) and streamable.

Member Typedef Documentation

◆ Bond_angle_rep

typedef boost::tuple<Bond_rep, Bond_rep> Bond_angle_rep

◆ Bond_angles_iterator

typedef boost::filter_iterator<Is_valid, Bond_angles_iterator_base> Bond_angles_iterator

◆ Bond_rep

typedef Covalent_structure_graph_traits::edge_descriptor Bond_rep

◆ Bonds_iterator

typedef boost::transform_iterator<Make_valid, Bonds_iterator_filtered> Bonds_iterator

◆ Bonds_iterator_base

typedef Covalent_structure_graph_traits::edge_iterator Bonds_iterator_base

◆ Bonds_iterator_filtered

typedef boost::filter_iterator<Is_embedded, Bonds_iterator_base> Bonds_iterator_filtered

◆ Covalent_structure_graph

typedef boost::subgraph<boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, Particle_info, boost::property< boost::edge_index_t, int, Bond_type> > > Covalent_structure_graph

Graph representation of the covalent structure : it can be subdivided in subgraphs with the following hierarchy : chains, residues, (backbone, sidechain)

◆ Covalent_structure_graph_traits

◆ Dihedral_angles_iterator

◆ Improper_angles_iterator

◆ Improper_angles_iterator_base

typedef std::vector<Torsion_angle_rep>::const_iterator Improper_angles_iterator_base

◆ Incident_bonds_iterator

◆ Incident_bonds_iterator_base

typedef Covalent_structure_graph_traits::out_edge_iterator Incident_bonds_iterator_base

◆ Particle_info

typedef Particle_info_traits::Particle_info Particle_info

◆ Particle_info_traits

◆ Particle_rep

typedef Covalent_structure_graph_traits::vertex_descriptor Particle_rep

◆ Particles_iterator

typedef boost::filter_iterator<Is_embedded, Particles_iterator_base> Particles_iterator

◆ Particles_iterator_base

typedef Covalent_structure_graph_traits::vertex_iterator Particles_iterator_base

◆ Self

typedef T_Molecular_covalent_structure<ParticleInfo> Self

◆ Torsion_angle_rep

typedef boost::tuple<Bond_rep, Bond_rep, Bond_rep> Torsion_angle_rep

Member Enumeration Documentation

◆ Bond_type

enum Bond_type
Enumerator
SIMPLE_BOND 
DOUBLE_BOND 
TRIPLE_BOND 

Member Function Documentation

◆ add_bond()

std::pair< typename T_Molecular_covalent_structure< ParticleInfo >::Bond_rep, bool > add_bond ( Particle_rep  p,
Particle_rep  q,
Bond_type  bond_type = SIMPLE_BOND 
)
inline

◆ add_improper_constraint()

std::pair< bool, typename T_Molecular_covalent_structure< ParticleInfo >::Torsion_angle_rep > add_improper_constraint ( Particle_rep  p,
Particle_rep  q,
Particle_rep  r,
Particle_rep  s 
)
inline

◆ add_particle()

T_Molecular_covalent_structure< ParticleInfo >::Particle_rep add_particle ( const Particle_info info)
inline

Add a new particle in the covalent structure corresponding to the ith particle in a given conformation of the molecule.

◆ are_1_2()

bool are_1_2 ( Particle_rep  p,
Particle_rep  q 
) const
inline

check that p and q share a bond

◆ are_1_3()

bool are_1_3 ( Particle_rep  p,
Particle_rep  q 
) const
inline

check that p and q share an incident particle

◆ are_1_4()

bool are_1_4 ( Particle_rep  p,
Particle_rep  q 
) const
inline

check that there are incident bonds to p and q that share a common incident bond

◆ bond_angles_begin()

T_Molecular_covalent_structure< ParticleInfo >::Bond_angles_iterator bond_angles_begin ( bool  is_embedded = true) const
inline

Iterate over the bond angles (u, v, w) so that u and v are the largest indices lower than w such that (u, v) and (v, w) are bonds.

◆ bond_angles_end()

T_Molecular_covalent_structure< ParticleInfo >::Bond_angles_iterator bond_angles_end ( bool  is_embedded = true) const
inline

Iterate over the bond angles (u, v, w) so that u and v are the largest indices lower than w such that (u, v) and (v, w) are bonds.

◆ bonds_begin()

T_Molecular_covalent_structure< ParticleInfo >::Bonds_iterator bonds_begin ( bool  is_embedded = true) const
inline

◆ bonds_end()

T_Molecular_covalent_structure< ParticleInfo >::Bonds_iterator bonds_end ( bool  is_embedded = true) const
inline

◆ dihedral_angles_begin()

T_Molecular_covalent_structure< ParticleInfo >::Dihedral_angles_iterator dihedral_angles_begin ( bool  is_embedded = true) const
inline

Iterate over the torsion angles (u, v, w, t) so that u, v and w are the largest indices lower than t such that (u, v), (v, w) and (w, t) are bonds.

◆ dihedral_angles_end()

T_Molecular_covalent_structure< ParticleInfo >::Dihedral_angles_iterator dihedral_angles_end ( bool  is_embedded = true) const
inline

Iterate over the torsion angles (u, v, w, t) so that u, v and w are the largest indices lower than t such that (u, v), (v, w) and (w, t) are bonds.

◆ find_particle()

std::pair< bool, typename T_Molecular_covalent_structure< ParticleInfo >::Particle_rep > find_particle ( const Particle_info info) const
inline

◆ get_bond() [1/2]

T_Molecular_covalent_structure< ParticleInfo >::Bond_rep get_bond ( Bond_angle_rep  b,
unsigned  i 
) const
inline

Get the (i+1)-th bond from a bond angle, with i = 0 or 1.

◆ get_bond() [2/2]

T_Molecular_covalent_structure< ParticleInfo >::Bond_rep get_bond ( Torsion_angle_rep  b,
unsigned  i 
) const
inline

Get the (i+1)-th bond from a torsion angle, with i = 0,1 or 2.

◆ get_bond_angle_rep()

std::pair< bool, typename T_Molecular_covalent_structure< ParticleInfo >::Bond_angle_rep > get_bond_angle_rep ( Bond_rep  b_1,
Bond_rep  b_2 
) const
inline

◆ get_bond_rep()

std::pair< bool,typename T_Molecular_covalent_structure< ParticleInfo >::Bond_rep > get_bond_rep ( Particle_rep  p,
Particle_rep  q 
) const
inline

Get the bond represented by the two input particles, if any.

◆ get_cannonized_rep() [1/3]

T_Molecular_covalent_structure< ParticleInfo >::Bond_rep get_cannonized_rep ( Bond_rep  b) const
inline

Return the bond such that the smallest vertex index is first.

◆ get_cannonized_rep() [2/3]

T_Molecular_covalent_structure< ParticleInfo >::Bond_angle_rep get_cannonized_rep ( Bond_angle_rep  a) const
inline

Return the bond angle such that the smallest vertex index is first.

◆ get_cannonized_rep() [3/3]

T_Molecular_covalent_structure< ParticleInfo >::Torsion_angle_rep get_cannonized_rep ( Torsion_angle_rep  a) const
inline

If a proper angle, return it with the samellest vertex index first, otherwise return the improper angle itself.

◆ get_graph() [1/2]

const T_Molecular_covalent_structure< ParticleInfo >::Covalent_structure_graph & get_graph ( void  ) const
inline

◆ get_graph() [2/2]

T_Molecular_covalent_structure< ParticleInfo >::Covalent_structure_graph & get_graph ( void  )
inline

◆ get_mirror_bond_rep()

T_Molecular_covalent_structure< ParticleInfo >::Bond_rep get_mirror_bond_rep ( Bond_rep  u) const
inline

◆ get_model_position()

int get_model_position ( Particle_rep  p) const
inline

◆ get_molecule()

T_Molecular_covalent_structure< ParticleInfo > & get_molecule ( Particle_rep  p,
Self S 
)
inline

Builds a new covalent structure containing only the particles of the molecule containing p;.

◆ get_molecules()

OutputIterator get_molecules ( OutputIterator  out) const
inline

Computes the connected components of this graph and returns one vertex for each connected component.

◆ get_number_of_bonds()

unsigned get_number_of_bonds ( void  ) const
inline

◆ get_number_of_embedded_bonds()

unsigned get_number_of_embedded_bonds ( void  ) const
inline

◆ get_number_of_embedded_particles()

unsigned get_number_of_embedded_particles ( void  ) const
inline

◆ get_number_of_modeled_bonds()

unsigned get_number_of_modeled_bonds ( void  ) const
inline

◆ get_number_of_modeled_particles()

unsigned get_number_of_modeled_particles ( void  ) const
inline

◆ get_number_of_particles()

unsigned get_number_of_particles ( void  ) const
inline

◆ get_particle_rep() [1/3]

T_Molecular_covalent_structure< ParticleInfo >::Particle_rep get_particle_rep ( Bond_rep  b,
unsigned  i 
) const
inline

Get the (i+1)-th particle from a bond, with i = 0 or 1.

◆ get_particle_rep() [2/3]

T_Molecular_covalent_structure< ParticleInfo >::Particle_rep get_particle_rep ( Bond_angle_rep  b,
unsigned  i 
) const
inline

Get the (i+1)-th particle from a bond angle, with i = 0,1 or 2.

◆ get_particle_rep() [3/3]

T_Molecular_covalent_structure< ParticleInfo >::Particle_rep get_particle_rep ( Torsion_angle_rep  b,
unsigned  i 
) const
inline

Get the (i+1)-th particle from a torsion angle, with i = 0, 1, 2 or 3.

◆ get_particles()

std::pair< typename T_Molecular_covalent_structure< ParticleInfo >::Particle_rep, typename T_Molecular_covalent_structure< ParticleInfo >::Particle_rep > get_particles ( Bond_rep  b) const
inline

◆ get_particles_in_molecule()

OutputIterator get_particles_in_molecule ( Particle_rep  p,
OutputIterator  out 
) const
inline

Returns the ensemble of particles in the same molecule (i.e connected component) as p.

◆ get_sub_structure() [1/2]

Self& get_sub_structure ( InputIterator  begin,
InputIterator  end,
Self S 
)
inline

Builds a new covalent structure containing only the particles in the input range; note that no new copy of the information is created, and modifying the underlying graph of one covalent structure affects the other one.

◆ get_sub_structure() [2/2]

T_Molecular_covalent_structure<ParticleInfo>& get_sub_structure ( InputIterator  begin,
InputIterator  end,
Self S 
)

◆ get_torsion_angle_rep()

std::pair< bool, typename T_Molecular_covalent_structure< ParticleInfo >::Torsion_angle_rep > get_torsion_angle_rep ( Bond_rep  b_1,
Bond_rep  b_2,
Bond_rep  b_3 
) const
inline

◆ get_x() [1/2]

const SBL::Models::T_Conformation_traits< Conformation >::FT & get_x ( const Conformation C,
Particle_rep  p 
) const
inline

◆ get_x() [2/2]

SBL::Models::T_Conformation_traits< Conformation >::FT & get_x ( Conformation C,
Particle_rep  p 
) const
inline

◆ get_y() [1/2]

const SBL::Models::T_Conformation_traits< Conformation >::FT & get_y ( const Conformation C,
Particle_rep  p 
) const
inline

◆ get_y() [2/2]

SBL::Models::T_Conformation_traits< Conformation >::FT & get_y ( Conformation C,
Particle_rep  p 
) const
inline

◆ get_z() [1/2]

const SBL::Models::T_Conformation_traits< Conformation >::FT & get_z ( const Conformation C,
Particle_rep  p 
) const
inline

◆ get_z() [2/2]

SBL::Models::T_Conformation_traits< Conformation >::FT & get_z ( Conformation C,
Particle_rep  p 
) const
inline

◆ has_model()

bool has_model ( Particle_rep  p) const
inline

◆ improper_angles_begin()

T_Molecular_covalent_structure< ParticleInfo >::Improper_angles_iterator improper_angles_begin ( bool  is_embedded = true) const
inline

Iterate over the torsion angles (u, v, w, t) so that (u, v), (u, w) and (u, t) are bonds.

◆ improper_angles_end()

T_Molecular_covalent_structure< ParticleInfo >::Improper_angles_iterator improper_angles_end ( bool  is_embedded = true) const
inline

Iterate over the torsion angles (u, v, w, t) so that (u, v), (u, w) and (u, t) are bonds.

◆ incident_bonds_begin()

T_Molecular_covalent_structure< ParticleInfo >::Incident_bonds_iterator incident_bonds_begin ( Particle_rep  p,
bool  is_embedded = true 
) const
inline

◆ incident_bonds_end()

T_Molecular_covalent_structure< ParticleInfo >::Incident_bonds_iterator incident_bonds_end ( Particle_rep  p,
bool  is_embedded = true 
) const
inline

◆ is_embedded()

bool is_embedded ( Particle_rep  p) const
inline

◆ is_fully_embedded()

bool is_fully_embedded ( void  ) const
inline

◆ particles_begin()

T_Molecular_covalent_structure< ParticleInfo >::Particles_iterator particles_begin ( bool  is_embedded = true) const
inline

◆ particles_end()

T_Molecular_covalent_structure< ParticleInfo >::Particles_iterator particles_end ( bool  is_embedded = true) const
inline

◆ print()

std::ostream & print ( std::ostream &  out) const

◆ set_particle_position()

void set_particle_position ( Particle_rep  p,
int  position 
)
inline