Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
Molecular_system< Items, Point > Class Template Reference

A class representing a molecular system. More...

#include <Molecular_system.h>

Public Member Functions

 Molecular_system (int index, std::string name="no_name")
 Constructs a Molecular_system object.
bool has_no_model () const
 Check if the Molecular_system has at least a model or none.
bool has_model (int i) const
 Check if the Molecular_system has a model with the specified index.
size_t number_of_models () const
 Get the number of models in the Molecular_system.
const std::string & name () const
 Get the value of name *.
std::string & name ()
 Set the value of name *.
const int & index () const
 Get the value of index *.
int & index ()
 Set the value of index *.
const char & alternate_location () const
 Get the value of alternate_location *.
char & alternate_location ()
 Set the value of alternate_location *.
Model & get_or_create_model (int i)
 Get or create a model with the specified index. If the model does not exist, it will be created empty and added to the Molecular_system.
Model & get_model (int i)
 Get the model with the specified index.
const Model & get_model (int i) const
 Get the model with the specified index (const version).
Secondary_structure_element & add_secondary_structure_element (const Secondary_structure_element &sse)
 Add a Secondary_structure_element to the Molecular_system. The Secondary_structure_element can be a helix or a sheet. SSE are added per system since they are independent from the NMR model. However, it should be accessible from the Molecular_chain.
void add_ss_bond (SS_bond ss_bond)
 Adds an SS_bond (Disulfide bond) to the system.
const Model_container & models () const
 Returns a const reference to the model container.
Model_container & models ()
 Returns a reference to the model container.
unsigned number_of_ss_bonds (void) const
 Returns the number of SS_bond (Disulfide bond) in the system.
const std::list< SS_bond > & get_ss_bonds (void) const
 Returns the container of SS_bond (Disulfide bond)
Chain & get_chain_from_sheet_identifier (const std::string &id)
 Returns a reference to the Chain associated with the given sheet identifier.
const Chain & get_chain_from_sheet_identifier (const std::string &id) const
 Returns a const reference to the Chain associated with the given sheet identifier.
Models_iterator models_begin ()
 Get an iterator pointing to the beginning of the models in the Molecular_system.
Models_iterator models_end ()
 Get an iterator pointing to the end of the models in the Molecular_system.
Models_const_iterator models_begin () const
 Get a const iterator pointing to the beginning of the models in the Molecular_system.
Models_const_iterator models_end () const
 Get a const iterator pointing to the end of the models in the Molecular_system.

Detailed Description

template<class Items, class Point>
class SBL::CSB::Molecular_system< Items, Point >

A class representing a molecular system.

Template Parameters
ItemsThe class that provides the type definitions for different components of the molecular system
PointA point type with coordinates and const access methods x(), y(), and z()

Constructor & Destructor Documentation

◆ Molecular_system()

template<class Items, class Point>
Molecular_system ( int index,
std::string name = "no_name" )
inline

Constructs a Molecular_system object.

Parameters
indexThe index of the molecular system.
name(Optional) The name of the molecular system. Defaults to "no_name" if not provided.
Returns
A Molecular_system object.

Member Function Documentation

◆ add_secondary_structure_element()

template<class Items, class Point>
Secondary_structure_element & add_secondary_structure_element ( const Secondary_structure_element & sse)
inline

Add a Secondary_structure_element to the Molecular_system. The Secondary_structure_element can be a helix or a sheet. SSE are added per system since they are independent from the NMR model. However, it should be accessible from the Molecular_chain.

Parameters
sseThe Secondary_structure_element to add.
Returns
A reference to the added Secondary_structure_element.

◆ add_ss_bond()

template<class Items, class Point>
void add_ss_bond ( SS_bond ss_bond)
inline

Adds an SS_bond (Disulfide bond) to the system.

Parameters
ss_bondThe SS_bond (Disulfide bond) to add.

◆ alternate_location() [1/2]

template<class Items, class Point>
char & alternate_location ( )
inline

Set the value of alternate_location *.

*

Parameters
valueThe new value of alternate_location

◆ alternate_location() [2/2]

template<class Items, class Point>
const char & alternate_location ( ) const
inline

Get the value of alternate_location *.

  • Returns
    The value of alternate_location

◆ get_chain_from_sheet_identifier() [1/2]

template<class Items, class Point>
Chain & get_chain_from_sheet_identifier ( const std::string & id)
inline

Returns a reference to the Chain associated with the given sheet identifier.

Parameters
idThe identifier of the sheet.
Returns
A reference to the Chain associated with the sheet identifier.
Note
This function assumes that the sheet identifier exists in the Molecular_system, or triggers an assertion.

◆ get_chain_from_sheet_identifier() [2/2]

template<class Items, class Point>
const Chain & get_chain_from_sheet_identifier ( const std::string & id) const
inline

Returns a const reference to the Chain associated with the given sheet identifier.

Parameters
idThe identifier of the sheet.
Returns
A const reference to the Chain associated with the sheet identifier.
Note
This function assumes that the sheet identifier exists in the Molecular_system, or triggers an assertion.

◆ get_model() [1/2]

template<class Items, class Point>
Model & get_model ( int i)
inline

Get the model with the specified index.

Parameters
iThe index of the model to retrieve.
Returns
A reference to the model with the specified index.
Exceptions
std::runtime_errorIf the model with the specified index does not exist.

◆ get_model() [2/2]

template<class Items, class Point>
const Model & get_model ( int i) const
inline

Get the model with the specified index (const version).

Parameters
iThe index of the model to retrieve.
Returns
A const reference to the model with the specified index.
Exceptions
std::runtime_errorIf the model with the specified index does not exist.

◆ get_or_create_model()

template<class Items, class Point>
Model & get_or_create_model ( int i)
inline

Get or create a model with the specified index. If the model does not exist, it will be created empty and added to the Molecular_system.

Parameters
iThe index of the model.
Returns
A reference to the model with the specified index.

◆ get_ss_bonds()

template<class Items, class Point>
const std::list< SS_bond > & get_ss_bonds ( void ) const
inline

Returns the container of SS_bond (Disulfide bond)

Returns
A const reference to the container of SS_bond (Disulfide bond)

◆ has_model()

template<class Items, class Point>
bool has_model ( int i) const
inline

Check if the Molecular_system has a model with the specified index.

Parameters
iThe index of the model to check.
Returns
True if the Molecular_system has a model with the specified index, false otherwise.

◆ has_no_model()

template<class Items, class Point>
bool has_no_model ( ) const
inline

Check if the Molecular_system has at least a model or none.

Returns
True if the Molecular_system has none, false if it has at least one model.

◆ index() [1/2]

template<class Items, class Point>
int & index ( )
inline

Set the value of index *.

*

Parameters
valueThe new value of index

◆ index() [2/2]

template<class Items, class Point>
const int & index ( ) const
inline

Get the value of index *.

  • Returns
    The value of index

◆ models() [1/2]

template<class Items, class Point>
Model_container & models ( )
inline

Returns a reference to the model container.

Returns
The reference to the model container.

◆ models() [2/2]

template<class Items, class Point>
const Model_container & models ( ) const
inline

Returns a const reference to the model container.

To retrieve the Molecular_model with smallest id of a Molecular_system object auto& model = (molecular_system->models().begin())->second;

Returns
The const reference to the model container.

◆ models_begin() [1/2]

template<class Items, class Point>
Models_iterator models_begin ( )
inline

Get an iterator pointing to the beginning of the models in the Molecular_system.

Returns
An iterator pointing to the beginning of the models.

◆ models_begin() [2/2]

template<class Items, class Point>
Models_const_iterator models_begin ( ) const
inline

Get a const iterator pointing to the beginning of the models in the Molecular_system.

Returns
A const iterator pointing to the beginning of the models.

◆ models_end() [1/2]

template<class Items, class Point>
Models_iterator models_end ( )
inline

Get an iterator pointing to the end of the models in the Molecular_system.

Returns
An iterator pointing to the end of the models.

◆ models_end() [2/2]

template<class Items, class Point>
Models_const_iterator models_end ( ) const
inline

Get a const iterator pointing to the end of the models in the Molecular_system.

Returns
A const iterator pointing to the end of the models.

◆ name() [1/2]

template<class Items, class Point>
std::string & name ( )
inline

Set the value of name *.

*

Parameters
valueThe new value of name

◆ name() [2/2]

template<class Items, class Point>
const std::string & name ( ) const
inline

Get the value of name *.

  • Returns
    The value of name

◆ number_of_models()

template<class Items, class Point>
size_t number_of_models ( ) const
inline

Get the number of models in the Molecular_system.

Returns
The number of models in the Molecular_system.

◆ number_of_ss_bonds()

template<class Items, class Point>
unsigned number_of_ss_bonds ( void ) const
inline

Returns the number of SS_bond (Disulfide bond) in the system.

Returns
The number of SS_bond (Disulfide bond).