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. More...
 
bool has_no_model () const
 Check if the Molecular_system has at least a model or none. More...
 
bool has_model (int i) const
 Check if the Molecular_system has a model with the specified index. More...
 
size_t number_of_models () const
 Get the number of models in the Molecular_system. More...
 
const std::string & name () const
 Get the value of name *. More...
 
std::string & name ()
 Set the value of name *. More...
 
const int & index () const
 Get the value of index *. More...
 
int & index ()
 Set the value of index *. More...
 
const char & alternate_location () const
 Get the value of alternate_location *. More...
 
char & alternate_location ()
 Set the value of alternate_location *. More...
 
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. More...
 
Model & get_model (int i)
 Get the model with the specified index. More...
 
const Model & get_model (int i) const
 Get the model with the specified index (const version). More...
 
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. More...
 
void add_ss_bond (SS_bond ss_bond)
 Adds an SS_bond (Disulfide bond) to the system. More...
 
const Model_container & models () const
 Returns a const reference to the model container. More...
 
Model_container & models ()
 Returns a reference to the model container. More...
 
unsigned number_of_ss_bonds (void) const
 Returns the number of SS_bond (Disulfide bond) in the system. More...
 
const std::list< SS_bond > & get_ss_bonds (void) const
 Returns the container of SS_bond (Disulfide bond) More...
 
Chain & get_chain_from_sheet_identifier (const std::string &id)
 Returns a reference to the Chain associated with the given sheet identifier. More...
 
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. More...
 
Models_iterator models_begin ()
 Get an iterator pointing to the beginning of the models in the Molecular_system. More...
 
Models_iterator models_end ()
 Get an iterator pointing to the end of the models in the Molecular_system. More...
 
Models_const_iterator models_begin () const
 Get a const iterator pointing to the beginning of the models in the Molecular_system. More...
 
Models_const_iterator models_end () const
 Get a const iterator pointing to the end of the models in the Molecular_system. More...
 

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()

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()

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()

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]

char& alternate_location ( )
inline

Set the value of alternate_location *.

*

Parameters
valueThe new value of alternate_location

◆ alternate_location() [2/2]

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]

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]

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]

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]

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()

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()

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()

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()

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]

int& index ( )
inline

Set the value of index *.

*

Parameters
valueThe new value of index

◆ index() [2/2]

const int& index ( ) const
inline

Get the value of index *.

  • Returns
    The value of index

◆ models() [1/2]

Model_container& models ( )
inline

Returns a reference to the model container.

Returns
The reference to the model container.

◆ models() [2/2]

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]

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]

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]

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]

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]

std::string& name ( )
inline

Set the value of name *.

*

Parameters
valueThe new value of name

◆ name() [2/2]

const std::string& name ( ) const
inline

Get the value of name *.

  • Returns
    The value of name

◆ number_of_models()

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()

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).