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

Class for loading conformations from a list of PDB / cif files, or from a plain txt file listing the conformations as Point_d. Class for loading conformations from a list of PDB / cif files, or from a plain txt file listing the conformations as Point_d. More...

#include <Conformation_loader.h>

Public Member Functions

 T_Conformation_loader (void)
 Default constructor. More...
 
virtual boost::program_options::options_description add_options (void) override
 Virtual method for adding options to the module. More...
 
virtual bool check_options (std::string &message) const override
 Checks that the input options' values are coherent. More...
 
std::string get_output_prefix (void) const override
 Returns a prefix that concatains the input line options used when running the module. More...
 
bool load (unsigned verbose, std::ostream &out) override
 Load function. More...
 
std::string get_name (void) const override
 Return the name of the class itself. More...
 
void statistics (std::ostream &out)
 Prints statistics about the loaded conformations. More...
 
const std::vector< std::vector< Conformation > > & get_conformations (void) const
 Get the vector of conformations. More...
 
std::vector< std::vector< Conformation > > & get_conformations (void)
 Get the vector of conformations. More...
 
Molecular_system_loaderget_molecular_system_loader (void)
 Get the molecular system loader. More...
 
void save_conformations (void)
 Save the loaded conformations in the current dir, with output_prefix as filename. More...
 

Static Public Member Functions

static boost::program_options::options_description *& get_options (void)
 Access to the options' description of the module. More...
 

Management

void set_loader_instance_name (const std::string &loader_instance_name)
 
const std::string & get_loader_instance_name (void) const
 

Detailed Description

template<class Conformation_builder_ = Default_conformation_builder>
class SBL::IO::T_Conformation_loader< Conformation_builder_ >

Class for loading conformations from a list of PDB / cif files, or from a plain txt file listing the conformations as Point_d. Class for loading conformations from a list of PDB / cif files, or from a plain txt file listing the conformations as Point_d.

It combines the options from the SBL::IO::T_Molecular_system_loader and the SBL::Models::T_Points_d_file_loader. To programmatically load a conformation from a PDB / mmCIF file, one must add the file to the molecular system loader :

T_Conformation_loader<Default_conformation_builder> conformation_loader;
conformation_loader.get_molecular_system_loader().set_loaded_file_paths({"path_to_my_file"});

To load from the application command line, PDB / mmCIF files can be added as :

myapplication -f "path_to_my_file"
Template Parameters
Conformation_builder_: Functor building a conformation from a dD point or a molecular model from the SBL.

Constructor & Destructor Documentation

◆ T_Conformation_loader()

T_Conformation_loader ( void  )
inline

Default constructor.

Member Function Documentation

◆ add_options()

boost::program_options::options_description add_options ( void  )
overridevirtual

Virtual method for adding options to the module.

Adds options specific to the "Conformations loader" to the option parser and also as command line arguments.

Reimplemented from T_Module_option_description< Dummy >.

◆ check_options()

bool check_options ( std::string &  message) const
overridevirtual

Checks that the input options' values are coherent.

Reimplemented from T_Module_option_description< Dummy >.

◆ get_conformations() [1/2]

std::vector< std::vector< typename Conformation_builder_::Conformation > > & get_conformations ( void  )

Get the vector of conformations.

Returns
A reference to the vector of conformations.

◆ get_conformations() [2/2]

const std::vector< std::vector< typename Conformation_builder_::Conformation > > & get_conformations ( void  ) const

Get the vector of conformations.

Returns
A constant reference to the vector of conformations.

◆ get_molecular_system_loader()

T_Conformation_loader< Conformation_builder_ >::Molecular_system_loader & get_molecular_system_loader ( void  )

Get the molecular system loader.

Returns
A reference to the molecular system loader.

◆ get_name()

std::string get_name ( void  ) const
overridevirtual

Return the name of the class itself.

Reimplemented from Loader_base.

◆ get_options()

static boost::program_options::options_description*& get_options ( void  )
inlinestaticinherited

Access to the options' description of the module.

◆ get_output_prefix()

std::string get_output_prefix ( void  ) const
overridevirtual

Returns a prefix that concatains the input line options used when running the module.

Reimplemented from T_Module_option_description< Dummy >.

◆ load()

bool load ( unsigned  verbose,
std::ostream &  out 
)
inlineoverridevirtual

Load function.

Parameters
verboseVerbosity level.
[out]outOutput stream.
Returns
True if loading is successful, false otherwise. Function to call to execute the main function of a Loader

Load conformations.

Parameters
verboseVerbosity level.
[out]outOutput stream.
Returns
True if loading is successful, false otherwise. This function loads the conformations.

Reimplemented from Loader_base.

◆ save_conformations()

void save_conformations ( void  )
inline

Save the loaded conformations in the current dir, with output_prefix as filename.

◆ statistics()

void statistics ( std::ostream &  out)

Prints statistics about the loaded conformations.

Parameters
[out]outOutput stream for printing the statistics.