Rosetta
Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::ligand_evolution::EvolutionOptions Class Reference

Within EvolutionOptions class combines all options and settings are collected, defaults saved and sanity checks performed before running. More...

#include <EvolutionOptions.hh>

Public Member Functions

 EvolutionOptions ()
 Prepares the all options with standard settings. More...
 
 EvolutionOptions (std::string const &path_to_option_file)
 Loads settings from file and fills missing settings with standards. More...
 
core::Size get_max_generations () const
 Returns maximum number of generations. More...
 
core::Size get_external_scoring () const
 Returns number of external scoring runs or zero if evolutionary optimization should be used. More...
 
utility::vector1< std::string > get_selector_names () const
 Returns all selector names. More...
 
std::string const & get_selector_type (std::string const &name) const
 Returns the type of one selector. More...
 
core::Real get_selector_parameter (std::string const &name, std::string const &parameter) const
 Returns a required parameter for one selector. More...
 
utility::vector1< std::string > get_factory_names () const
 Returns all factory names. More...
 
std::string const & get_factory_type (std::string const &name) const
 Returns the type of one factory. More...
 
core::Real get_factory_parameter (std::string const &name, std::string const &parameter) const
 Returns a required parameter for one factory. More...
 
utility::vector1< std::pair< std::string, std::string > > const & get_selector_factory_links () const
 Return the list of factory and selector links. The order defines the order of appliance. More...
 
std::string const & get_path_to_external_smiles () const
 Returns the path to a list of smiles which will all be scored. More...
 
std::string const & get_path_to_reactions () const
 Returns the path to a list of reactions in SMARTS, defining combinatorial rules. More...
 
std::string const & get_path_to_reagents () const
 Returns the path to a list of reagents in SMILES defining the fragments for combination. More...
 
std::map< std::string, std::map< std::string, core::Size > > const & get_pop_init_options () const
 Returns a map of all used pop initialization procedures. More...
 
core::Size get_population_supported_size () const
 Returns how many individuals are supported per generation, essentially defining how many can survive. More...
 
std::string const & get_main_selector () const
 Returns the name of the main selector. More...
 
std::string const & get_main_scfx () const
 Returns the name of the score function used for the main scores within the scorer. More...
 
std::string const & get_path_score_memory () const
 Returns the path to a score memory file. More...
 
std::string const & get_ligand_chain () const
 Returns the name of the ligand chain used by all movers. More...
 
core::Size get_n_scoring_runs () const
 Returns the number of scoring runs. More...
 
std::string const & get_pose_dir_path () const
 Returns the path to directory where all poses will be saved. More...
 
core::Real get_similarity_penalty () const
 Return the similarity penalty for similar ligands in one generation. More...
 
core::Real get_similarity_penalty_threshold () const
 Return the identity penalty threshold after which the penalty is applied to the lower scoring molecule. More...
 
std::string const & get_main_term () const
 Returns the name of the score term to optimize for. More...
 
std::string const & get_protocol_path () const
 
core::pose::PoseOP get_pose_from_stream ()
 
numeric::xyzVector< core::Realget_start_xyz () const
 

Private Member Functions

void parse_cmdline ()
 
void parse_option_file (std::string const &option_file)
 
void check_validity ()
 
void check_scorer_setup ()
 
void check_selectors ()
 
void check_factories ()
 
void check_pop_init ()
 

Private Attributes

core::Size error_counter_ = 0
 Counts how many errors are encountered during parsing to allow report of as many errors as possible per program call. More...
 
numeric::xyzVector< core::Realxyz_
 coordinate where centroid of designed ligands will be placed More...
 
core::import_pose::pose_stream::MetaPoseInputStream pose_stream_
 Stores all input streams to obtain poses. More...
 
std::string protocol_path_
 Stores the path to the xml protocol. More...
 
core::Size external_scoring_ = 0
 If set to something else than 0, this will search for smiles list of ligands to score and score them as often as defined here. This is for benchmarking. More...
 
std::string path_to_external_smiles_
 If external scoring is set to something else than 0, this path will be visited to open a smiles list which will be scored. More...
 
std::string path_to_score_memory_
 If this is set, the Scorer will try to load scores from this file to use during optimization. More...
 
core::Size generations_
 Set the number of generations for evolutionary optimization. More...
 
std::string path_to_reactions_
 Path where to find the reaction definitions. The standard settings assume you use a input and run directory structure. More...
 
std::string path_to_reagents_
 Path where to find reagents definitions. The standard settings assume you use a input and run directory structure. More...
 
bool selectors_defined_ = false
 
std::map< std::string, std::pair< std::string, std::map< std::string, core::Real > > > selector_options_
 Maps selector names to types and parameter list. More...
 
bool factories_defined_ = false
 
std::map< std::string, std::pair< std::string, std::map< std::string, core::Real > > > factory_options_
 Maps offspring factory names to types and parameter list. More...
 
bool evolution_protocol_defined_ = false
 
utility::vector1< std::pair< std::string, std::string > > selector_factory_links_
 Links a selector to a factory. More...
 
std::map< std::string, std::map< std::string, core::Size > > pop_init_options_
 Defines how the starting population is generated. For more detail look at Population. More...
 
core::Size supported_population_size_ = 50
 Defines the size of maximum supported individuals in a population. More...
 
std::string main_selector_ = "std_tournament"
 Sets the name of the main selector. This is used to shrink the population to its supported size. More...
 
core::Size score_runs_
 Sets how often all movers are applied to a ligand and how often that ligand is scored. More...
 
std::string ligand_chain_
 Sets the name of the ligand chain. More...
 
std::string main_score_term_
 Sets which score term will be used for optimization. More...
 
core::Real similarity_penalty_ = 0.5
 If a molecule has better scoring molecules with a Tanimoto similarity exceeding the set threshold, it will receive a score penalty of for each of them. Penalty is added up. More...
 
core::Real similarity_penalty_threshold_ = 0.95
 Threshold after which molecules considered being similar and therefore qualified for a penalty. More...
 
std::string pose_dump_directory_
 Subdirectory within current run directory where all poses will be saved. More...
 
std::string scoring_function_
 Name of the scoring function used calculate the final base score. More...
 

Detailed Description

Within EvolutionOptions class combines all options and settings are collected, defaults saved and sanity checks performed before running.

Constructor & Destructor Documentation

◆ EvolutionOptions() [1/2]

protocols::ligand_evolution::EvolutionOptions::EvolutionOptions ( )

Prepares the all options with standard settings.

References check_validity(), parse_cmdline(), and protocols::TR().

◆ EvolutionOptions() [2/2]

protocols::ligand_evolution::EvolutionOptions::EvolutionOptions ( std::string const &  path_to_option_file)
explicit

Loads settings from file and fills missing settings with standards.

References check_validity(), parse_cmdline(), parse_option_file(), and protocols::TR().

Member Function Documentation

◆ check_factories()

void protocols::ligand_evolution::EvolutionOptions::check_factories ( )
private

◆ check_pop_init()

void protocols::ligand_evolution::EvolutionOptions::check_pop_init ( )
private

◆ check_scorer_setup()

void protocols::ligand_evolution::EvolutionOptions::check_scorer_setup ( )
private

◆ check_selectors()

void protocols::ligand_evolution::EvolutionOptions::check_selectors ( )
private

◆ check_validity()

void protocols::ligand_evolution::EvolutionOptions::check_validity ( )
private

◆ get_external_scoring()

core::Size protocols::ligand_evolution::EvolutionOptions::get_external_scoring ( ) const

Returns number of external scoring runs or zero if evolutionary optimization should be used.

References external_scoring_.

◆ get_factory_names()

utility::vector1< std::string > protocols::ligand_evolution::EvolutionOptions::get_factory_names ( ) const

Returns all factory names.

References factory_options_.

◆ get_factory_parameter()

core::Real protocols::ligand_evolution::EvolutionOptions::get_factory_parameter ( std::string const &  name,
std::string const &  parameter 
) const

Returns a required parameter for one factory.

References factory_options_.

◆ get_factory_type()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_factory_type ( std::string const &  name) const

Returns the type of one factory.

References factory_options_.

◆ get_ligand_chain()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_ligand_chain ( ) const

Returns the name of the ligand chain used by all movers.

References ligand_chain_.

◆ get_main_scfx()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_main_scfx ( ) const

Returns the name of the score function used for the main scores within the scorer.

References scoring_function_.

◆ get_main_selector()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_main_selector ( ) const

Returns the name of the main selector.

References main_selector_.

◆ get_main_term()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_main_term ( ) const

Returns the name of the score term to optimize for.

References main_score_term_.

◆ get_max_generations()

core::Size protocols::ligand_evolution::EvolutionOptions::get_max_generations ( ) const

Returns maximum number of generations.

References generations_.

◆ get_n_scoring_runs()

core::Size protocols::ligand_evolution::EvolutionOptions::get_n_scoring_runs ( ) const

Returns the number of scoring runs.

References score_runs_.

◆ get_path_score_memory()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_path_score_memory ( ) const

Returns the path to a score memory file.

References path_to_score_memory_.

◆ get_path_to_external_smiles()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_path_to_external_smiles ( ) const

Returns the path to a list of smiles which will all be scored.

References path_to_external_smiles_.

◆ get_path_to_reactions()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_path_to_reactions ( ) const

Returns the path to a list of reactions in SMARTS, defining combinatorial rules.

References path_to_reactions_.

◆ get_path_to_reagents()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_path_to_reagents ( ) const

Returns the path to a list of reagents in SMILES defining the fragments for combination.

References path_to_reagents_.

◆ get_pop_init_options()

std::map< std::string, std::map< std::string, core::Size > > const & protocols::ligand_evolution::EvolutionOptions::get_pop_init_options ( ) const

Returns a map of all used pop initialization procedures.

References pop_init_options_.

Referenced by protocols::ligand_evolution::Population::initialize_from_evotoptions().

◆ get_population_supported_size()

core::Size protocols::ligand_evolution::EvolutionOptions::get_population_supported_size ( ) const

Returns how many individuals are supported per generation, essentially defining how many can survive.

References supported_population_size_.

Referenced by protocols::ligand_evolution::Population::initialize_from_evotoptions().

◆ get_pose_dir_path()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_pose_dir_path ( ) const

Returns the path to directory where all poses will be saved.

References pose_dump_directory_.

◆ get_pose_from_stream()

core::pose::PoseOP protocols::ligand_evolution::EvolutionOptions::get_pose_from_stream ( )

◆ get_protocol_path()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_protocol_path ( ) const

References protocol_path_.

◆ get_selector_factory_links()

utility::vector1< std::pair< std::string, std::string > > const & protocols::ligand_evolution::EvolutionOptions::get_selector_factory_links ( ) const

Return the list of factory and selector links. The order defines the order of appliance.

References selector_factory_links_.

◆ get_selector_names()

utility::vector1< std::string > protocols::ligand_evolution::EvolutionOptions::get_selector_names ( ) const

Returns all selector names.

References selector_options_.

◆ get_selector_parameter()

core::Real protocols::ligand_evolution::EvolutionOptions::get_selector_parameter ( std::string const &  name,
std::string const &  parameter 
) const

Returns a required parameter for one selector.

References selector_options_.

◆ get_selector_type()

std::string const & protocols::ligand_evolution::EvolutionOptions::get_selector_type ( std::string const &  name) const

Returns the type of one selector.

References selector_options_.

◆ get_similarity_penalty()

core::Real protocols::ligand_evolution::EvolutionOptions::get_similarity_penalty ( ) const

Return the similarity penalty for similar ligands in one generation.

References similarity_penalty_.

◆ get_similarity_penalty_threshold()

core::Real protocols::ligand_evolution::EvolutionOptions::get_similarity_penalty_threshold ( ) const

Return the identity penalty threshold after which the penalty is applied to the lower scoring molecule.

References similarity_penalty_threshold_.

◆ get_start_xyz()

numeric::xyzVector< core::Real > protocols::ligand_evolution::EvolutionOptions::get_start_xyz ( ) const

References xyz_.

◆ parse_cmdline()

void protocols::ligand_evolution::EvolutionOptions::parse_cmdline ( )
private

◆ parse_option_file()

void protocols::ligand_evolution::EvolutionOptions::parse_option_file ( std::string const &  option_file)
private

Member Data Documentation

◆ error_counter_

core::Size protocols::ligand_evolution::EvolutionOptions::error_counter_ = 0
private

Counts how many errors are encountered during parsing to allow report of as many errors as possible per program call.

Referenced by check_factories(), check_pop_init(), check_scorer_setup(), check_selectors(), check_validity(), parse_cmdline(), and parse_option_file().

◆ evolution_protocol_defined_

bool protocols::ligand_evolution::EvolutionOptions::evolution_protocol_defined_ = false
private

Referenced by parse_option_file().

◆ external_scoring_

core::Size protocols::ligand_evolution::EvolutionOptions::external_scoring_ = 0
private

If set to something else than 0, this will search for smiles list of ligands to score and score them as often as defined here. This is for benchmarking.

Referenced by check_validity(), get_external_scoring(), and parse_cmdline().

◆ factories_defined_

bool protocols::ligand_evolution::EvolutionOptions::factories_defined_ = false
private

Referenced by parse_option_file().

◆ factory_options_

std::map< std::string, std::pair< std::string, std::map< std::string, core::Real > > > protocols::ligand_evolution::EvolutionOptions::factory_options_
private
Initial value:
{
{ "std_mutator", { "mutator", {
{ "size", 30.0 },
{ "reaction_weight", 1.0 },
{ "reagent_weight", 2.0 },
{ "min_similarity", 0.6 },
{ "max_similarity", 0.99 }
} } },
{ "drastic_mutator", { "mutator", {
{ "size", 30.0 },
{ "reaction_weight", 0.0 },
{ "reagent_weight", 1.0 },
{ "min_similarity", 0.0 },
{ "max_similarity", 0.25 }
} } },
{ "reaction_mutator", { "mutator", {
{ "size", 30.0 },
{ "reaction_weight", 1.0 },
{ "reagent_weight", 0.0 },
{ "min_similarity", 0.6 },
{ "max_similarity", 0.99 }
} } },
{ "large_crossover", { "crossover", {
{ "size", 60.0 }
} } },
{ "std_identity", { "identity", {
{ "size", 15.0 }
} } }
}

Maps offspring factory names to types and parameter list.

Referenced by check_factories(), get_factory_names(), get_factory_parameter(), get_factory_type(), and parse_option_file().

◆ generations_

core::Size protocols::ligand_evolution::EvolutionOptions::generations_
private

Set the number of generations for evolutionary optimization.

Referenced by check_validity(), get_max_generations(), and parse_cmdline().

◆ ligand_chain_

std::string protocols::ligand_evolution::EvolutionOptions::ligand_chain_
private

Sets the name of the ligand chain.

Referenced by check_scorer_setup(), get_ligand_chain(), and parse_cmdline().

◆ main_score_term_

std::string protocols::ligand_evolution::EvolutionOptions::main_score_term_
private

Sets which score term will be used for optimization.

Referenced by check_scorer_setup(), get_main_term(), and parse_cmdline().

◆ main_selector_

std::string protocols::ligand_evolution::EvolutionOptions::main_selector_ = "std_tournament"
private

Sets the name of the main selector. This is used to shrink the population to its supported size.

Referenced by check_selectors(), check_validity(), get_main_selector(), and parse_option_file().

◆ path_to_external_smiles_

std::string protocols::ligand_evolution::EvolutionOptions::path_to_external_smiles_
private

If external scoring is set to something else than 0, this path will be visited to open a smiles list which will be scored.

Referenced by check_validity(), get_path_to_external_smiles(), and parse_cmdline().

◆ path_to_reactions_

std::string protocols::ligand_evolution::EvolutionOptions::path_to_reactions_
private

Path where to find the reaction definitions. The standard settings assume you use a input and run directory structure.

Referenced by check_validity(), get_path_to_reactions(), and parse_cmdline().

◆ path_to_reagents_

std::string protocols::ligand_evolution::EvolutionOptions::path_to_reagents_
private

Path where to find reagents definitions. The standard settings assume you use a input and run directory structure.

Referenced by check_validity(), get_path_to_reagents(), and parse_cmdline().

◆ path_to_score_memory_

std::string protocols::ligand_evolution::EvolutionOptions::path_to_score_memory_
private

If this is set, the Scorer will try to load scores from this file to use during optimization.

Referenced by check_pop_init(), check_scorer_setup(), get_path_score_memory(), and parse_cmdline().

◆ pop_init_options_

std::map< std::string, std::map< std::string, core::Size > > protocols::ligand_evolution::EvolutionOptions::pop_init_options_
private
Initial value:
{
{ "random", {
{ "size", 200 }
} }
}

Defines how the starting population is generated. For more detail look at Population.

Referenced by check_pop_init(), get_pop_init_options(), and parse_option_file().

◆ pose_dump_directory_

std::string protocols::ligand_evolution::EvolutionOptions::pose_dump_directory_
private

Subdirectory within current run directory where all poses will be saved.

Referenced by check_scorer_setup(), get_pose_dir_path(), and parse_cmdline().

◆ pose_stream_

core::import_pose::pose_stream::MetaPoseInputStream protocols::ligand_evolution::EvolutionOptions::pose_stream_
private

Stores all input streams to obtain poses.

Referenced by get_pose_from_stream(), and parse_cmdline().

◆ protocol_path_

std::string protocols::ligand_evolution::EvolutionOptions::protocol_path_
private

Stores the path to the xml protocol.

Referenced by get_protocol_path(), and parse_cmdline().

◆ score_runs_

core::Size protocols::ligand_evolution::EvolutionOptions::score_runs_
private

Sets how often all movers are applied to a ligand and how often that ligand is scored.

Referenced by check_scorer_setup(), get_n_scoring_runs(), and parse_cmdline().

◆ scoring_function_

std::string protocols::ligand_evolution::EvolutionOptions::scoring_function_
private

Name of the scoring function used calculate the final base score.

Referenced by check_scorer_setup(), get_main_scfx(), and parse_cmdline().

◆ selector_factory_links_

utility::vector1< std::pair< std::string, std::string > > protocols::ligand_evolution::EvolutionOptions::selector_factory_links_
private
Initial value:
{
{ "std_roulette", "std_mutator" },
{ "std_roulette", "large_crossover" },
{ "std_roulette", "drastic_mutator" },
{ "std_roulette", "reaction_mutator" },
{ "remove_elitist", "std_identity" },
{ "std_roulette", "std_mutator" },
{ "std_roulette", "large_crossover" },
}

Links a selector to a factory.

Referenced by check_factories(), check_selectors(), get_selector_factory_links(), and parse_option_file().

◆ selector_options_

std::map< std::string, std::pair< std::string, std::map< std::string, core::Real > > > protocols::ligand_evolution::EvolutionOptions::selector_options_
private
Initial value:
{
{ "remove_elitist", { "elitist", {
{ "size", 15 },
{ "remove", 1 }
} } },
{ "std_tournament", { "tournament", {
{ "tournament_size", 15 },
{ "acceptance_chance", 0.75 },
{ "size", 15 },
{ "remove", 0 }
} } },
{ "std_roulette", { "roulette", {
{ "consider_positive", 0 },
{ "size", 15 },
{ "remove", 0 }
} } }
}

Maps selector names to types and parameter list.

Referenced by check_factories(), check_selectors(), get_selector_names(), get_selector_parameter(), get_selector_type(), and parse_option_file().

◆ selectors_defined_

bool protocols::ligand_evolution::EvolutionOptions::selectors_defined_ = false
private

Referenced by parse_option_file().

◆ similarity_penalty_

core::Real protocols::ligand_evolution::EvolutionOptions::similarity_penalty_ = 0.5
private

If a molecule has better scoring molecules with a Tanimoto similarity exceeding the set threshold, it will receive a score penalty of for each of them. Penalty is added up.

Referenced by get_similarity_penalty(), and parse_option_file().

◆ similarity_penalty_threshold_

core::Real protocols::ligand_evolution::EvolutionOptions::similarity_penalty_threshold_ = 0.95
private

Threshold after which molecules considered being similar and therefore qualified for a penalty.

Referenced by get_similarity_penalty_threshold(), and parse_option_file().

◆ supported_population_size_

core::Size protocols::ligand_evolution::EvolutionOptions::supported_population_size_ = 50
private

Defines the size of maximum supported individuals in a population.

Referenced by check_factories(), check_pop_init(), check_selectors(), check_validity(), get_population_supported_size(), and parse_option_file().

◆ xyz_

numeric::xyzVector<core::Real> protocols::ligand_evolution::EvolutionOptions::xyz_
private

coordinate where centroid of designed ligands will be placed

Referenced by get_start_xyz(), and parse_cmdline().


The documentation for this class was generated from the following files: