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

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

#include <Molecular_covalent_structure.hpp>

Accessors

unsigned get_number_of_particles (void) const
unsigned get_number_of_modeled_particles (void) 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.
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.
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.
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.
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.
std::pair< bool, Bond_rep > get_bond_rep (Particle_rep p, Particle_rep q) const
 Get the bond represented by the two input particles, if any.
Bond_rep get_canonical_rep (Bond_rep b) const
 Return the bond such that the smallest vertex index is first.
Bond_angle_rep get_canonical_rep (Bond_angle_rep a) const
 Return the bond angle such that the smallest vertex index is first – out of the first and third vertices.
Torsion_angle_rep get_canonical_rep (Torsion_angle_rep a) const
 If a proper angle: second and third vertices sorted; if improper angle: central atom first, remaining three sorted.
Particle_rep get_atom_serial_number_particle (int atom_serial_number) const
 Get the Particle_rep of an atom from the atom's serial number.

Predicates

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

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.
std::pair< Bond_rep, bool > add_bond (Particle_rep p, Particle_rep q, Bond_type bond_type=SIMPLE_BOND)
 Add a new bond to the covalent structure.

Traversal

Particles_iterator particles_begin (bool is_embedded=true) const
 Provides an iterator (on embedded or not particles.
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.
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.
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.
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.
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.
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.

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.
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.
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.
Selfget_molecule (Particle_rep p, Self &S)
 Creates a new covalent structure containing only the particles of the molecule (connected component) containing p.
void get_chain (char chain_id, Self &S)
 Creates a new covalent structure in S, containing only the particles of the chain with chain_id.

Print

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

Detailed Description

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

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.

Template Parameters
ParticleInfoInformation to attached to the particle (default is a simple string). It should be comparable (less operator) and streamable.

Member Function Documentation

◆ add_bond()

template<class ParticleInfo>
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 a new bond to the covalent structure.

◆ add_particle()

template<class ParticleInfo>
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()

template<class ParticleInfo>
bool are_1_2 ( Particle_rep p,
Particle_rep q ) const
inline

Check that p and q share a bond.

Check a particle indentified by the Particle_rep p and a particle identified by the Particle_rep q share a bond.

◆ are_1_3()

template<class ParticleInfo>
bool are_1_3 ( Particle_rep p,
Particle_rep q ) const
inline

Check that p and q an incident particle.

Check a particle indentified by the Particle_rep p and a particle identified by the Particle_rep q share an incident particle.

◆ are_1_4()

template<class ParticleInfo>
bool are_1_4 ( Particle_rep p,
Particle_rep q ) const
inline

Check that p and q share a common incident bond.

Check a particle indentified by the Particle_rep p and a particle identified by the Particle_rep q share a common incident bond.

◆ bond_angles_begin()

template<class ParticleInfo>
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()

template<class ParticleInfo>
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.

◆ dihedral_angles_begin()

template<class ParticleInfo>
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()

template<class ParticleInfo>
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.

◆ get_atom_serial_number_particle()

template<class ParticleInfo>
T_Molecular_covalent_structure< ParticleInfo >::Particle_rep get_atom_serial_number_particle ( int atom_serial_number) const
inline

Get the Particle_rep of an atom from the atom's serial number.

◆ get_bond() [1/2]

template<class ParticleInfo>
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]

template<class ParticleInfo>
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_rep()

template<class ParticleInfo>
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_canonical_rep() [1/3]

template<class ParticleInfo>
T_Molecular_covalent_structure< ParticleInfo >::Bond_angle_rep get_canonical_rep ( Bond_angle_rep a) const
inline

Return the bond angle such that the smallest vertex index is first – out of the first and third vertices.

◆ get_canonical_rep() [2/3]

template<class ParticleInfo>
T_Molecular_covalent_structure< ParticleInfo >::Bond_rep get_canonical_rep ( Bond_rep b) const
inline

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

◆ get_canonical_rep() [3/3]

template<class ParticleInfo>
T_Molecular_covalent_structure< ParticleInfo >::Torsion_angle_rep get_canonical_rep ( Torsion_angle_rep a) const
inline

If a proper angle: second and third vertices sorted; if improper angle: central atom first, remaining three sorted.

◆ get_chain()

template<class ParticleInfo>
void get_chain ( char chain_id,
Self & S )

Creates a new covalent structure in S, containing only the particles of the chain with chain_id.

◆ get_molecule()

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

Creates a new covalent structure containing only the particles of the molecule (connected component) containing p.

◆ get_molecules()

template<class ParticleInfo>
template<class OutputIterator>
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_modeled_particles()

template<class ParticleInfo>
unsigned get_number_of_modeled_particles ( void ) const
inline

◆ get_number_of_particles()

template<class ParticleInfo>
unsigned get_number_of_particles ( void ) const
inline

/brief Provides the total number of particles /details Returns the total number of particles in the graph (its number of vertices) /returns an unsigned in counting the total number of particles in the graph

◆ get_particle_rep() [1/3]

template<class ParticleInfo>
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() [2/3]

template<class ParticleInfo>
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() [3/3]

template<class ParticleInfo>
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_in_molecule()

template<class ParticleInfo>
template<class OutputIterator>
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()

template<class Particle_info_ = std::string>
template<class InputIterator>
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.

◆ improper_angles_begin()

template<class ParticleInfo>
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()

template<class ParticleInfo>
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.

◆ particles_begin()

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

Provides an iterator (on embedded or not particles.

If embedded is set to true, only the particleRep of embedded particles are

◆ print()

template<class ParticleInfo>
std::ostream & print ( std::ostream & out) const

/brief Writes to "out" the Molecular_covalent_structure in the graphviz format