![]() |
Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
|
Representaiont of the workflow of an application enriched with default options. More...
#include <Module_based_workflow.hpp>
Public Types | |
typedef T_Module_based_workflow | Base |
typedef T_Module_based_workflow< void > | Self |
typedef Workflow_graph_traits::vertex_descriptor | Vertex |
Representation of a verttex in the workflow that could be a module, or the Start or End vertices. More... | |
typedef Workflow_graph_traits::edge_descriptor | Edge |
Representation of the flow of information in the workflow. More... | |
Public Member Functions | |
Module_based_workflow (const std::string &application_name="no-application-name") | |
Initialize this application with a name. More... | |
virtual boost::program_options::options_description | add_options (void) const |
Virtual method for adding options to the module. More... | |
Static Public Member Functions | |
static boost::program_options::options_description *& | get_options (void) |
Access to the options' description of the module. More... | |
static bool | has_options (void) |
static void | delete_options (void) |
static void | initialize_options (const std::string &caption) |
Modules Management | |
void | set_module_instance_name (const std::string &module_instance_name) |
Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules. More... | |
const std::string & | get_module_instance_name (void) const |
Get the name of this instance of this module. More... | |
void | set_report_mode (std::ios_base::openmode report_mode) |
Set a report mode, that is open or append modes. More... | |
void | set_report_mode (std::ios_base::openmode &report_mode) |
Set a report mode, that is open or append modes. More... | |
const std::ios_base::openmode | get_report_mode (void) const |
Get the report mode to be used when reporting. More... | |
Others | |
template<class Self_ > | |
Self_ * | clone (const Self_ *s) const |
Clones the object using the copy constructor. More... | |
virtual bool | is_logical_module (void) const |
Checks that this module defines a logical operator. More... | |
virtual bool | is_condition_module (void) const |
Checks that this module defines a condition operator. More... | |
virtual bool | operator() (void) |
Only for condition modules, for returning the predicate value. More... | |
virtual bool | is_modules_collection (void) const |
Checks that this module defines a collection of modules. More... | |
Mandatory Requirements | |
std::string | get_name (void) const |
Returns the name of the package. More... | |
void | run (unsigned verbose, std::ostream &out) |
Runs the module following the input options. More... | |
bool | is_runnable (void) const |
Checks that all the input options were set. More... | |
void | statistics (std::ostream &out) |
Reports high-level statistics on the module. More... | |
Optional Requirements | |
bool | check_options (std::string &message) const |
Checks that the input options' values are coherent. More... | |
void | add_options (boost::program_options::options_description *options, bool pre_module) |
std::string | get_output_prefix (void) const |
Returns a prefix that concatains the input line options used when running the module. More... | |
void | report (const std::string &prefix) |
Reports the output and statistics in output files. More... | |
Based Options | |
bool | get_report_at_end (void) const |
void | add_helper (const std::string &helper) |
Set the helper of the application. More... | |
std::ostream & | log (void) |
Stream for the standard output, that can be either the shell or a file. More... | |
unsigned | verbose (void) const |
Return the verbosity level for the workflow : 0 (no output), 1 (output during the run), 2 (output during the statistics) or 3 (all output). More... | |
Modules | |
Vertex | get_start_vertex (void) const |
IO::Loader_base & | get_loader (unsigned i) |
const IO::Loader_base & | get_loader (unsigned i) const |
Module_base & | get_module (Vertex u) |
unsigned | get_number_of_loaders (void) const |
Loader * | add_loader (const std::string &name="") |
Registers a loader into the automaton: note that loaders are executed before the modules. More... | |
Loader * | add_loader (Loader &loader, const std::string &name="") |
Registers a loader into the automaton: note that loaders are executed before the modules. More... | |
Vertex | register_module (const std::string &name="") |
Registers a module with an input: note that modules are executed in a FIFO manner. More... | |
Vertex | register_module (Module_base &module, const std::string &name="") |
Registers a module without any input: note that modules are executed in a FIFO manner. More... | |
void | make_optional_module (Vertex u, const std::string &option_name, const std::string &option_helper) |
Registers a module with an input: note that modules are executed in a FIFO manner. More... | |
Vertex | make_conjunction (Vertex u, Vertex v) |
Make a module that is the conjunction of the two input modules. More... | |
void | make_start_condition (const Predicate &P, Vertex v, const UpdateIfTrue &update_true, const std::string &predicate_name, const std::string &update_name="") |
Make a condition module with exactly one possible outflow, and a predicate for checking if it is followed. More... | |
void | make_start_condition (const Predicate &P, Vertex v, const UpdateIfTrue &update_true, Vertex w, const UpdateIfFalse &update_false, const std::string &predicate_name, const std::string &update_name="") |
Make a condition module with exactly two possible outflows, and a predicate for checking which one to follow. More... | |
void | make_condition (Vertex u, const Predicate &P, Vertex v, const UpdateIfTrue &update_true, const std::string &predicate_name, const std::string &update_name="") |
Make a condition module with exactly one possible outflow, and a predicate for checking if it is followed. More... | |
void | make_condition (Vertex u, const Predicate &P, Vertex v, const UpdateIfTrue &update_true, Vertex w, const UpdateIfFalse &update_false, const std::string &predicate_name, const std::string &update_name="") |
Make a condition module with exactly two possible outflows, and a predicate for checking which one to follow. More... | |
Flows | |
void | set_start_module (Vertex u) |
Modules connected to the start vertex will be first executed; in case of multiple vertices, the modules are executed in an arbitrary order. More... | |
void | set_end_module (Vertex u) |
The results of all modules connected to the end vertex are reported. More... | |
void | make_module_flow (Vertex u, Vertex v, const Transformer &join, const std::string &name="") |
Connect the modules represented by the vertices u (source output) and v (target input); if any output data from u should be passed to the input data of v, it is done through the join functor; the optional name is displayed over the edge of the graph when printing the workflow. More... | |
Running the workflow | |
bool | is_valid_workflow (unsigned verbose, std::ostream &out) const |
void | parse_command_line (int argc, char *argv[]) |
Parses the command line options and store the values of the options: the check_options method is called for all loaders and all modules. More... | |
void | load (std::size_t i) |
Load the data using the loaders. More... | |
void | load (void) |
Load the data using the loaders. More... | |
void | start (void) |
Runs the application by pushing into the stack the Start vertex. More... | |
Representaiont of the workflow of an application enriched with default options.
It provides the following functionnality:
typedef T_Module_based_workflow Base |
|
inherited |
Representation of the flow of information in the workflow.
|
inherited |
|
inherited |
Representation of a verttex in the workflow that could be a module, or the Start or End vertices.
|
inline |
Initialize this application with a name.
|
inlineinherited |
Set the helper of the application.
|
inlineinherited |
Registers a loader into the automaton: note that loaders are executed before the modules.
Registers a loader into the automaton: note that loaders are executed before the modules.
|
inlinevirtualinherited |
Virtual method for adding options to the module.
Reimplemented in T_Morse_theory_based_analyzer_for_NNG_module< ModuleTraits >, T_Potential_energy_parameters< CovalentStructure, UnitSystemTraits, FT >, T_Molecular_interfaces_module< ModuleTraits >, T_Exploration_parameters_with_layers< NumberType, Distance >, T_Potential_energy_parameters< CovalentStructure, UnitSystemTraits, FT >, T_Generic_annotator_without_file< AnnotationType, SetAnnotation, GetInstanceName >, T_Space_filling_model_interface_finder_module< ModuleTraits >, T_Space_filling_model_inner_approximation_module< ModuleTraits >, T_Correlated_motions_by_domain_module< ModuleTraits >, T_PDB_file_loader< ESBTLMolecularSystem, PDBLineFormat >, T_PDB_file_loader< Molecular_system >, T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive >, T_Space_filling_model_shelling_diagram_comparison_module< ModuleTraits >, T_Space_filling_model_outer_approximation_module< ModuleTraits >, T_Space_filling_model_interpolated_approximation_module< ModuleTraits >, T_Morse_theory_based_analyzer_module< ModuleTraits, MorseSmaleWittenChainComplex >, T_Union_of_balls_boundary_patch_shelling_3_module< ModuleTraits, OutputArchive >, T_Morse_theory_based_analyzer_module< ModuleTraits, SBL::GT::T_Morse_Smale_Witten_chain_complex_from_vertex_weighted_graph_builder< GraphType, GetWeight >::Morse_Smale_Witten_chain_complex >, T_Morse_theory_based_analyzer_module< ModuleTraits, SBL::GT::T_Morse_Smale_Witten_chain_complex_from_NNG_builder< ModuleTraits::Nearest_neighbors_graph, ModuleTraits::Morse_function, ModuleTraits::Distance_graph_function >::Morse_Smale_Witten_chain_complex >, T_Morse_theory_based_analyzer_module< ModuleTraits, SBL::GT::T_Morse_Smale_Witten_chain_complex_from_weighted_graph_builder< GraphType, GetWeight >::Morse_Smale_Witten_chain_complex >, T_Radius_annotator_for_particles_with_annotated_name< NT, SetRadius >, T_Sample_extender_module< ModuleTraits >, T_Stop_criterion_module< ModuleTraits >, T_Conformations_file_loader< ConformationType, ConformationBuilder, ESBTLMolecularSystem, PDBLineFormat >, T_Protein_representation_loader< ProteinRepresentation, MolecularCovalentStructureBuilder, PDBLineFormat >, T_Alpha_complex_of_molecular_model_module< ModuleTraits >, T_Generic_annotator< KeyType, AnnotationType, MakeKey, SetAnnotation, GetOptionName, GetOptionHelp, GetOptionDisplayName >, T_Exploration_parameters_update_module< ModuleTraits >, T_Alignment_structures_module< ModuleTraits, AlignmentEngineStructures >, T_Alignment_structures_module< ModuleTraits, ModuleTraits::Iterative_aligner_engine >, T_Alignment_structures_module< ModuleTraits, AlignmentEngine >, T_Union_of_balls_boundary_3_module< ModuleTraits, ExactNT >, T_Molecular_covalent_structure_loader_from_PDB< ParticleTraits, MolecularCovalentStructure, MolecularCovalentStructureBuilder, PDBLineFormat >, T_XTC_file_loader< ConformationType, ConformationBuilder, ESBTLMolecularSystem, PDBLineFormat >, T_Union_of_balls_mesh_3_module< ModuleTraits >, T_Pairwise_structural_alignment_module< ModuleTraits, AlignmentEngine >, T_Modules_collection< Module, SetIndividualInput >, T_Earth_mover_distance_module< ModuleTraits >, T_Subdomain_comparator_module< ModuleTraits >, T_Alignment_sequences_module< ModuleTraits, AlignmentEngineSequences >, T_Buried_surface_area_without_label_module< ModuleTraits >, T_Tertiary_quaternary_structure_annotator_module< ModuleTraits >, T_Dynamic_annotator_for_atoms< SetDynamicAnnotation >, T_Buried_surface_area_with_labels_module< ModuleTraits >, T_Spatial_search_module< ModuleTraits, ApproximatedSpatialSearchEngine >, T_Dynamic_annotator_for_residues< SetDynamicAnnotation >, T_Name_annotator_for_atoms< SetAnnotatedName >, T_Filtration_graph_module< ModuleTraits, GraphBuilder >, T_Nearest_neighbors_graph_builder_module< ModuleTraits >, T_Primitive_labels_loader< PartnerLabelsTraits, MediatorLabelsTraits, ExtraLabelsTraits >, T_RMSD_comb_edge_weighted_module< ModuleTraits >, T_Acceptance_test_module< ModuleTraits >, T_Energy_landscape_transition_graph_landmarks_paths_module< ModuleTraits >, T_Sample_selector_module< ModuleTraits >, T_Spheres_3_file_loader< Sphere3, Point3 >, T_Numbers_file_loader< FT, Tag >, T_Name_annotator_for_pseudo_atoms< SetAnnotatedName >, T_RST_MST_D_Family_matching_module< ModuleTraits >, T_Sequences_loader< FT >, T_Graph_loader< GraphType, FT >, T_D_Family_matching_module< ModuleTraits, TSolutionComputer >, T_Weighted_vertex_graph_loader< PointD, WeightType, GraphType >, T_Graph_loader< GraphType, FT >, T_Graph_loader< Graph >, T_Graph_loader< GraphType, FT >, T_Cluster_engine_module< ModuleTraits >, T_Weights_file_loader< FT >, T_Archive_file_loader< InputArchive, SerializedData >, T_Archive_file_loader< boost::archive::xml_iarchive, typename Traits::Atom_shelling_forest >, T_Particle_annotator_collector< ParticleAnnotator1, ParticleAnnotator2 >, T_Exploration_parameters_default< NumberType, Distance >, T_Transition_graph_loader< InputArchive, TransitionGraphTraits >, T_Points_d_file_loader< PointD >, T_Transition_graph_loader< boost::archive::xml_iarchive, typename Traits::Transition_graph_traits >, T_Domain_annotator_for_particles< Annotations >, T_Iterative_alignment_module< ModuleTraits >, T_Weighted_points_d_loader< PointD, WeightType >, T_Molecular_covalent_structure_loader_from_MOL< MolecularCovalentStructure >, T_Transition_graph_builder_from_DB_of_critical_points_module< ModuleTraits >, T_Conformational_ensemble_symmetric_difference_module< ModuleTraits >, T_Clustering_loader< Graph, Clustering >, T_Graph_loader< Graph >, T_Clustering_loader< Graph, Clustering >, T_Force_field_atomic_traits< TForceFieldFunctionTraits >::Potential_energy_parameters_loader, Conformations_loader, and Space_filling_model_loader.
|
inlineinherited |
|
inlinevirtualinherited |
Checks that the input options' values are coherent.
Reimplemented from T_Module_option_description<>.
|
inlineinherited |
Clones the object using the copy constructor.
|
inlinestaticinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get the name of this instance of this module.
|
inlinevirtualinherited |
Returns the name of the package.
Reimplemented from Module_base.
|
inlineinherited |
|
inlinestaticinherited |
Access to the options' description of the module.
|
inlinevirtualinherited |
Returns a prefix that concatains the input line options used when running the module.
Reimplemented from T_Module_option_description<>.
|
inlineinherited |
|
inlineinherited |
Get the report mode to be used when reporting.
|
inlineinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
|
inlineprotectedvirtualinherited |
Checks that this module defines a condition operator.
|
inlineprotectedvirtualinherited |
Checks that this module defines a logical operator.
|
inlineprotectedvirtualinherited |
Checks that this module defines a collection of modules.
|
inlinevirtualinherited |
Checks that all the input options were set.
Reimplemented from Module_base.
|
inlineinherited |
Check the following properties : – the workflow is connected – each module that is not logical or condition has exactly one input – each logical operator has exactly two input – each condition operator has exactly one input and one to two output
|
inlineinherited |
Load the data using the loaders.
|
inlineinherited |
Load the data using the loaders.
|
inlineinherited |
Stream for the standard output, that can be either the shell or a file.
|
inlineinherited |
Make a condition module with exactly one possible outflow, and a predicate for checking if it is followed.
|
inlineinherited |
Make a condition module with exactly two possible outflows, and a predicate for checking which one to follow.
|
inlineinherited |
Make a module that is the conjunction of the two input modules.
|
inlineinherited |
Connect the modules represented by the vertices u (source output) and v (target input); if any output data from u should be passed to the input data of v, it is done through the join functor; the optional name is displayed over the edge of the graph when printing the workflow.
|
inlineinherited |
Registers a module with an input: note that modules are executed in a FIFO manner.
|
inlineinherited |
Make a condition module with exactly one possible outflow, and a predicate for checking if it is followed.
|
inlineinherited |
Make a condition module with exactly two possible outflows, and a predicate for checking which one to follow.
|
inlineprotectedvirtualinherited |
Only for condition modules, for returning the predicate value.
|
inlineinherited |
Parses the command line options and store the values of the options: the check_options method is called for all loaders and all modules.
|
inlineinherited |
Registers a module with an input: note that modules are executed in a FIFO manner.
|
inlineinherited |
Registers a module without any input: note that modules are executed in a FIFO manner.
|
inlinevirtualinherited |
Reports the output and statistics in output files.
Reimplemented from Module_base.
|
inlinevirtualinherited |
Runs the module following the input options.
Implements Module_base.
|
inlineinherited |
The results of all modules connected to the end vertex are reported.
|
inlineinherited |
Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules.
|
inlineinherited |
Set a report mode, that is open or append modes.
|
inlineinherited |
Set a report mode, that is open or append modes.
|
inlineinherited |
Modules connected to the start vertex will be first executed; in case of multiple vertices, the modules are executed in an arbitrary order.
|
inlineinherited |
Runs the application by pushing into the stack the Start vertex.
|
inlinevirtualinherited |
Reports high-level statistics on the module.
Reimplemented from Module_base.
|
inlineinherited |
Return the verbosity level for the workflow : 0 (no output), 1 (output during the run), 2 (output during the statistics) or 3 (all output).