Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::optimize_weights::IterativeOptEDriver Class Reference

#include <IterativeOptEDriver.hh>

Public Types

typedef core::Real Real
 
typedef core::Size Size
 
typedef core::scoring::ScoreTypes ScoreTypes
 
typedef core::scoring::EnergyMap EnergyMap
 

Public Member Functions

 IterativeOptEDriver ()
 Main constructor for the IterativeOptEDriver class. Note that mpi_rank and mpi_nprocs get set even if USEMPI is not defined. These values are then used to set MPI_rank_ and MPI_nprocs_. Also calls the initialize_free_and_fixed_terms method. More...
 
 ~IterativeOptEDriver ()
 
void task_factory (core::pack::task::TaskFactoryCOP)
 take care when using a custom TaskFactory: TaskOperations must not 'accumulate state' as they will be reused repeatedly More...
 
void go ()
 Main loop for the optE protocol. This is function the apps call to do optE. More...
 

Private Member Functions

core::Size num_outer_iterations () const
 
core::Size num_inner_iterations () const
 
void read_tagfile_to_taskfactory (std::string tagfile_name, core::pack::task::TaskFactoryOP task_factory)
 Reads in an XML formatted task operation and puts builds a task factory from it. More...
 
void load_pose (core::pose::Pose &pose, std::string const &filename, bool ignore_centroid_input_flag)
 loads structure into pose - decides between silent or pdb More...
 
void divide_up_pdbs ()
 The head node has to send out to all the work nodes the list of pdb files they have to do their thing on. It itself doesn't do any of the calculations, right? Work nodes get their list of pdb to work on. More...
 
void intialize_free_and_fixed_energy_terms ()
 Calls the method initialize_free_and_fixed() which reads in the files free and fixed and sets the EnergyMap vectors free_parameters_ and fixed_parameters_. Also here the reference energies array gets init'd. Finally, setup_derived_free_and_fixed_data gets called which. More...
 
void setup_derived_free_and_fixed_data ()
 include_terms_ is an EnergyMap, as well. I think this function sets up the free and fixed score lists which are just a vector1 of ScoreType objects. include_, fixed_ and free_count_ are just (core::Size) member variables. More...
 
void collect_rotamer_energies ()
 
void compute_rotamer_energies_for_assigned_pdbs ()
 Computes the rotamer energies for all positions for all pdbs given (in the call to get_nat_aa_opte_data()). Also, optionally, does the same for native rotamer recovery data. Creates an unweighted score function using the the class method 'create_unweighed_scorefunction'. The scorefunction used to get the interaction energies of the rotamers is the one that's created here. More...
 
void collect_rotamer_energies_from_slave_cpus ()
 Helper method for collecting energies. Calls collect_rotamer_energies_from_slave_cpu for all CPU's being used. More...
 
void collect_rotamer_energies_from_slave_cpu (core::Size const which_cpu)
 For a calling master node, collects the rotamer energies that were calculated on a slave CPU. More...
 
void send_rotamer_energies_to_master_cpu ()
 Used by all slave nodes; sends the rotamer energies (according to the protocol we've set up here) to the master node. More...
 
void optimize_weights ()
 Optimizes weights using either a standard minimizer or a ParticleSwarmMinimizer (which is significantly better!). More...
 
void score_position_data ()
 
utility::vector1< Realread_reference_energies_from_file (std::string const &fname) const
 
void write_new_scorefile ()
 send new score file via MPI instead of writing to disk. More...
 
void test_sequence_recovery ()
 Calls run_design on all pdbs and collects the results from slave cpus if MPI is in use. More...
 
void collect_sequence_recovery_data_from_slave_cpus ()
 Helper method for master node. Calls collect_recovery_data_from_slave_cpu on all slave CPUs. More...
 
void collect_sequence_recovery_data_from_slave_cpu (core::Size const which_cpu)
 
void run_design_on_assigned_pdbs ()
 Runs design on the pdbs assigned to this node/cpu. More...
 
void send_sequence_recovery_data_to_master_cpu ()
 
void repack_assigned_pdbs ()
 
void collect_rotamer_recovery_data_from_slave_cpus ()
 Helper method for master node. Calls collect_rotamer_recovery_data_from_slave_cpu on all slave CPUs. More...
 
void collect_rotamer_recovery_data_from_slave_cpu (core::Size const which_cpu)
 
void send_rotamer_recovery_data_to_master_cpu ()
 
bool decide_if_sequence_recovery_improved ()
 The final function call of the go() method. After all the pdbs have been designed and repacked, and the recovery data collected, decide if this new set of weights improved the sequence recovery. More...
 
void test_weight_sensitivity (OptEMultifunc const &func, core::optimization::Multivec const &dofs) const
 
std::string get_scorefile_name ()
 
void barrier ()
 
void exit_gracefully ()
 
utility::vector1< std::string > get_native_pdb_names ()
 Reads in the list of pdb file names to use for the optimization. Uses basic::options::start_file which returns a vector1 of strings. Unfortunately, this method reads data out of the return value of start_file() which is why you have to use a listfile with the -s option for things to work correctly. More...
 
void zero_aa_counts ()
 Set the counts for the amino acid frequencies (observed and expected) to zero. More...
 
Real measure_sequence_recovery (utility::vector1< std::string > const &native_pdb_names, utility::vector1< std::string > const &names_for_output_pdbs, core::scoring::ScoreFunctionOP sfxn, core::Size &npos, core::Size &nrecovered)
 
Real measure_rotamer_recovery (utility::vector1< std::string > const &native_pdb_names, utility::vector1< std::string > const &names_for_output_pdbs, core::scoring::ScoreFunctionOP sfxn, core::Size &npos, core::Size &nrecovered)
 
Real opte_weight_mixing_factor (core::Size outer_loop_counter, core::Size inner_loop_counter)
 
void initialize_free_and_fixed (core::scoring::EnergyMap &free_parameters, core::scoring::EnergyMap &fixed_parameters)
 Reads in the files specified by opt_e::free and opt_e::fixed. Figures out what ScoreType the user placed on each line of the file and then sets the free_parameters array with that ScoreType. If the user does not place a starting weight, a random starting weight is given for that type. Also sets the fixed terms in fixed_parameters. Both of these EnergyMap references that are passed in are actually vectors of EnergyMaps? Either way, the free and fixed params are set in this method. If no fixed or free files are found, then there are some hardcoded defaults that get used. More...
 
bool converged (core::scoring::EnergyMap &free_parameters_prev, core::scoring::EnergyMap &free_parameters_curr, utility::vector1< Real > const &reference_energies_prev, utility::vector1< Real > const &reference_energies_curr)
 This function is not used. More...
 
void setup_pdbnames_next_round (core::Size const outer_loop_counter, utility::vector1< std::string > &pdbs_next_round, utility::vector1< std::string > const &native_pdb_names)
 
void write_parameters_to_std_out (core::scoring::EnergyMap &free_parameters, utility::vector1< Real > const &reference_energies)
 
void get_nat_aa_opte_data (std::string const &pdb_name, core::pose::Pose &pose, core::pose::Pose &native_pose, core::scoring::ScoreFunction const &scorefxn, ScoreTypes &score_list, ScoreTypes &fixed_score_vec, OptEData &opte_data)
 refactor this into an optE common... More...
 
void get_nat_rot_opte_data (std::string const &pdb_name, core::pose::Pose &pose, core::pose::Pose &native_pose, utility::vector1< bool > include_rsd, core::scoring::ScoreFunction const &scorefxn, ScoreTypes &score_list, ScoreTypes &fixed_score_vec, OptEData &opte_data)
 Similar to get_nat_aa_opte_data. See comments there for more info. More...
 
void set_aa_periodicity (PNatRotOptEPositionDataOP pos_data, core::chemical::AA aa) const
 
bool residue_has_unacceptably_bad_dunbrack_energy (core::pose::Pose const &pose, core::Size const resid) const
 True/False: a particular residue be skipped for inclusion into the native-rotamer recovery test because its dunbrack energy is really high. More...
 
bool residue_has_bad_bfactor (core::pose::Pose const &pose, core::Size const resid) const
 True/False: a particular residue be skipped for inclusion into the native-rotamer recovery test because it contains an atom with a high B-factor. More...
 
core::scoring::EnergyMap free_terms_energy_map_from_dofs (core::optimization::Multivec const &dofs) const
 Expand free variables and combine with fixed to make an Energy Map. More...
 
void free_weights_and_refEs_from_vars (utility::vector1< Real > const &vars, core::scoring::EnergyMap &weights, utility::vector1< Real > &reference_energies) const
 
core::scoring::ScoreFunctionOP configure_new_scorefunction () const
 Sets functional forms (e.g. soft-rep) but doesn't set any weights. If the option -optE::optE_soft_rep is specified, then an empty scorefunction with the FA_STANDARD_SOFT etable is returned. Another option is -optE::optE_no_protein_fa_elec. This excludes protein_protein_fa_elec in the the scorefunction energy method options. More...
 
core::scoring::ScoreFunctionOP create_unweighted_scorefunction () const
 Takes a std::string and a destination and constructs the MPI_Send call. Does this include the reference energy term somehow? I don't believe it does. More...
 
core::scoring::ScoreFunctionOP create_weighted_scorefunction () const
 
void collect_decoy_discrimination_data ()
 Collect optE data for decoy discrimination. Similar to the get_nat_aa_opte_data method. More...
 
SingleStructureDataOP single_structure_data_for_pose (core::scoring::ScoreFunctionOP scorefxn, core::pose::Pose &pose, core::pose::Pose const &crystal_native, utility::vector1< Real > &free_data, utility::vector1< Real > &fixed_data, std::string const &structure_tag="") const
 
AddStatus add_structure_based_on_rms (SingleStructureDataOP ssd, PNatStructureOptEDataOP structure_data, bool intended_native) const
 
void compute_rotamers_around_ligands ()
 Ligand stuff. More...
 
void collect_ligand_discrimination_data ()
 Ligand stuff. More...
 
core::scoring::EnergyMap score_ligand_interface (core::scoring::ScoreFunction const &scorefxn, core::pose::Pose &pose)
 Ligand stuff. More...
 
SingleStructureDataOP make_simple_ssd_from_pdb (std::string const &pdb_filename, core::scoring::ScoreFunctionOP sfxn, bool pretend_no_fa_rep=false) const
 Helper function to reduce code duplication. More...
 
void collect_dG_of_binding_data ()
 dG optimization optE data collection. More...
 
void collect_ddG_of_mutation_data ()
 ddG optimization optE data collection. More...
 
void collect_ddG_of_binding_data ()
 The calculations for ddG of binding for interfaces doesn't really fit with the ddG stability and dG binding optE modes. This functions loads all of the necessary structures for optimization of ddG of binding into the optE framework. More...
 
void load_pssm_data (std::string const &native_filename, core::Size const which_protein)
 
core::pack::task::PackerTaskOP copy_native_packertask_logic (core::pose::Pose native_pose, core::pose::Pose context_pose, core::pack::task::TaskFactoryOP native_taskfactory)
 Copies the logic in the native task factory from the native_pose to the context pose The context pose should be filled with a parsable file that does NOT restrict any residues that might be packable in the native. More...
 
void repack_and_minimize_pose (core::pose::Pose &pose, core::scoring::ScoreFunctionOP sfxn) const
 
std::string node_name (int rank)
 
void print_energies (core::pose::Pose &, core::scoring::ScoreFunctionOP, std::ostream &os=std::cout)
 
void output_weighted_unfolded_energies ()
 Multiply out the unweighted unfolded energies with the current free and fixed term weights. More...
 

Private Attributes

core::pack::task::TaskFactoryOP task_factory_
 
utility::vector1< std::string > native_pdbs_
 
utility::vector1
< core::pose::Pose
native_poses_
 
utility::vector1
< core::pose::Pose
context_poses_
 
utility::vector1< std::string > pdbs_this_round_
 
utility::vector1< std::string > next_iteration_pdbs_
 
utility::vector1
< core::pose::Pose
rotamer_recovery_context_poses_
 
utility::vector1< std::string > ligand_repack_pdbs_
 For rotamer recovery around ligands. More...
 
utility::vector1
< core::pose::Pose
ligand_repack_native_poses_
 
utility::vector1< std::pair
< std::string, std::string > > 
decdisc_native_decoy_pairs_
 
utility::vector1< std::string > decdisc_crystal_natives_
 
utility::vector1
< utility::vector1
< core::pose::Pose > > 
decdisc_native_poses_
 
utility::vector1
< utility::vector1
< core::pose::Pose > > 
decdisc_decoy_poses_
 
utility::vector1
< core::pose::Pose
decdisc_xtal_natives_
 
utility::vector1< std::pair
< std::string, std::string > > 
ligand_native_decoy_pairs_
 
utility::vector1< std::string > ligand_crystal_natives_
 
utility::vector1< std::pair
< std::string, std::string > > 
ddg_mut_wt_pairs_
 
utility::vector1< RealddGs_
 
utility::vector1
< utility::vector1
< std::string > > 
ddG_bind_files_
 A list of lists for use in optimizing ddG binding predictions. More...
 
utility::vector1< RealddGs_binding_
 
utility::vector1< std::pair
< std::string, std::string > > 
dG_bound_unbound_pairs_
 
utility::vector1< RealdG_binding_
 
OptEDataOP decoy_discrim_data_
 preserve the decoy scores by component between iterations to minimize I/O. More...
 
OptEDataOP ligand_discrim_data_
 preserve the decoy scores by component between iterations to minimize I/O. More...
 
OptEDataOP dG_binding_data_
 preserve the dGbinding data between iterations to minimize I/O More...
 
OptEDataOP ddG_mutation_data_
 preserve the ddMutation data between iterations to minimize I/O More...
 
OptEDataOP ddG_bind_optE_data_
 preserve the ddG bind mutation data between iterations to minimize I/O More...
 
EnergyMap free_parameters_
 These two get set by the user. More...
 
EnergyMap fixed_parameters_
 
EnergyMap include_terms_
 These get updated from the above two. More...
 
core::Size include_count_
 
core::Size fixed_count_
 
core::Size free_count_
 
ScoreTypes free_score_list_
 
ScoreTypes fixed_score_list_
 
utility::vector1< Realcomponent_weights_
 
utility::vector1
< utility::vector1< std::pair
< core::chemical::AA,
utility::vector1< Real > > > > 
all_pssm_data_
 store the PSSM data so it's only read once. More...
 
utility::vector1< std::pair
< core::chemical::AA,
utility::vector1< Real > > > 
pssm_data_
 
core::Size MPI_rank_
 
core::Size MPI_nprocs_
 
core::Size outer_loop_counter_
 
core::Size inner_loop_counter_
 
OptEDataOP optE_data_
 
core::Size total_positions_
 
core::Size count_recovered_
 
utility::vector1< core::Sizeaa_obs_
 
utility::vector1< core::Sizeaa_exp_
 the counts for each amino acid from the previous round of design (observed) More...
 
utility::vector1< Realaa_freq_obs_
 the counts for each amino acid in the input data set (expected) More...
 
utility::vector1< Realaa_freq_exp_
 the frequency for each amino acid from the previous round of design More...
 
core::Size total_rotamer_positions_
 the frequency for each amino acid in the input data set More...
 
core::Size count_rotamers_recovered_
 
utility::vector1< Realbefore_minimization_reference_energies_
 
utility::vector1< Realafter_minimization_reference_energies_
 
utility::vector1< Realreference_energies_inner_loop_
 
WrapperOptEMultifuncOP wrapped_opt_min_
 
utility::vector1< Realminimizer_dofs_before_minimization_
 
utility::vector1< Realminimizer_dofs_after_minimization_
 
utility::vector1< Realminimizer_dofs_mixed_
 
EnergyMap free_weights_before_minimization_
 
EnergyMap free_weights_after_minimization_
 
EnergyMap free_weights_inner_loop_
 
Real mixing_factor_
 
Real outer_loop_last_sequence_recovery_rate_
 
Real outer_loop_seq_profile_cross_entropy_
 
Real inner_loop_sequence_recovery_rate_
 
Real inner_loop_rotamer_recovery_rate_
 
bool using_unfolded_energy_term_
 

Member Typedef Documentation

Constructor & Destructor Documentation

protocols::optimize_weights::IterativeOptEDriver::IterativeOptEDriver ( )
protocols::optimize_weights::IterativeOptEDriver::~IterativeOptEDriver ( )
default

Member Function Documentation

AddStatus protocols::optimize_weights::IterativeOptEDriver::add_structure_based_on_rms ( SingleStructureDataOP  ssd,
PNatStructureOptEDataOP  structure_data,
bool  intended_native 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::barrier ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_ddG_of_binding_data ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_ddG_of_mutation_data ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_decoy_discrimination_data ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_dG_of_binding_data ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_ligand_discrimination_data ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_rotamer_energies ( )
private
void protocols::optimize_weights::IterativeOptEDriver::collect_rotamer_energies_from_slave_cpu ( core::Size const  which_cpu)
private

For a calling master node, collects the rotamer energies that were calculated on a slave CPU.

References protocols::optimize_weights::OptEPositionDataFactory::create_position_data(), fixed_parameters_, free_parameters_, core::scoring::n_score_types, and optE_data_.

Referenced by collect_rotamer_energies_from_slave_cpus().

void protocols::optimize_weights::IterativeOptEDriver::collect_rotamer_energies_from_slave_cpus ( )
private

Helper method for collecting energies. Calls collect_rotamer_energies_from_slave_cpu for all CPU's being used.

References collect_rotamer_energies_from_slave_cpu(), MPI_nprocs_, optE_data_, protocols::analysis::total, and protocols::optimize_weights::TR().

Referenced by collect_rotamer_energies(), optimize_weights(), and score_position_data().

void protocols::optimize_weights::IterativeOptEDriver::collect_rotamer_recovery_data_from_slave_cpu ( core::Size const  which_cpu)
private
void protocols::optimize_weights::IterativeOptEDriver::collect_rotamer_recovery_data_from_slave_cpus ( )
private

Helper method for master node. Calls collect_rotamer_recovery_data_from_slave_cpu on all slave CPUs.

References collect_rotamer_recovery_data_from_slave_cpu(), count_rotamers_recovered_, inner_loop_rotamer_recovery_rate_, MPI_nprocs_, total_rotamer_positions_, and protocols::optimize_weights::TR().

Referenced by test_sequence_recovery().

void protocols::optimize_weights::IterativeOptEDriver::collect_sequence_recovery_data_from_slave_cpu ( core::Size const  which_cpu)
private
void protocols::optimize_weights::IterativeOptEDriver::collect_sequence_recovery_data_from_slave_cpus ( )
private
void protocols::optimize_weights::IterativeOptEDriver::compute_rotamer_energies_for_assigned_pdbs ( )
private

Computes the rotamer energies for all positions for all pdbs given (in the call to get_nat_aa_opte_data()). Also, optionally, does the same for native rotamer recovery data. Creates an unweighted score function using the the class method 'create_unweighed_scorefunction'. The scorefunction used to get the interaction energies of the rotamers is the one that's created here.

Note: Surface is a PackerTask option. No repacking/design is done here. Just scoring. So the surface energies would not be included here in the optEdata. If surface was made into a ScoreType, then it could be added. -ronj Update: Surface score is now it's own EnergyMethod. If 'surface' is detected in the ScoreFunction, then the EnergyMethod calculates the surface energy of the pose. You don't get per-residue surface energies this way, but you do get the total pose surface energy. -ronj

References core::import_pose::centroid_pose_from_pdb(), context_poses_, create_unweighted_scorefunction(), fixed_score_list_, free_score_list_, get_nat_aa_opte_data(), get_nat_rot_opte_data(), core::chemical::ResidueTypeBase::is_protein(), load_pssm_data(), MPI_rank_, native_pdbs_, native_poses_, node_name(), optE_data_, outer_loop_counter_, core::import_pose::PDB_file, core::import_pose::pose_from_file(), core::pose::Pose::residue_type(), rotamer_recovery_context_poses_, core::pose::Pose::size(), protocols::optimize_weights::TR(), and protocols::optimize_weights::TR_VERBOSE().

Referenced by collect_rotamer_energies().

void protocols::optimize_weights::IterativeOptEDriver::compute_rotamers_around_ligands ( )
private
ScoreFunctionOP protocols::optimize_weights::IterativeOptEDriver::configure_new_scorefunction ( ) const
private
bool protocols::optimize_weights::IterativeOptEDriver::converged ( core::scoring::EnergyMap free_parameters_prev,
core::scoring::EnergyMap free_parameters_curr,
utility::vector1< Real > const &  reference_energies_prev,
utility::vector1< Real > const &  reference_energies_curr 
)
private
core::pack::task::PackerTaskOP protocols::optimize_weights::IterativeOptEDriver::copy_native_packertask_logic ( core::pose::Pose  native_pose,
core::pose::Pose  context_pose,
core::pack::task::TaskFactoryOP  native_taskfactory 
)
private

Copies the logic in the native task factory from the native_pose to the context pose The context pose should be filled with a parsable file that does NOT restrict any residues that might be packable in the native.

References read_tagfile_to_taskfactory().

Referenced by get_nat_aa_opte_data(), get_nat_rot_opte_data(), measure_rotamer_recovery(), and measure_sequence_recovery().

ScoreFunctionOP protocols::optimize_weights::IterativeOptEDriver::create_unweighted_scorefunction ( ) const
private

Takes a std::string and a destination and constructs the MPI_Send call. Does this include the reference energy term somehow? I don't believe it does.

References configure_new_scorefunction(), include_terms_, and core::scoring::n_score_types.

Referenced by collect_ddG_of_binding_data(), collect_ddG_of_mutation_data(), collect_decoy_discrimination_data(), collect_dG_of_binding_data(), collect_ligand_discrimination_data(), compute_rotamer_energies_for_assigned_pdbs(), and compute_rotamers_around_ligands().

core::scoring::ScoreFunctionOP protocols::optimize_weights::IterativeOptEDriver::create_weighted_scorefunction ( ) const
private

Construct a score function: set etable type, set weights, set reference weights.

References configure_new_scorefunction(), fixed_parameters_, free_weights_inner_loop_, core::scoring::n_score_types, core::scoring::ref, and reference_energies_inner_loop_.

Referenced by collect_decoy_discrimination_data().

bool protocols::optimize_weights::IterativeOptEDriver::decide_if_sequence_recovery_improved ( )
private
void protocols::optimize_weights::IterativeOptEDriver::divide_up_pdbs ( )
private
void protocols::optimize_weights::IterativeOptEDriver::exit_gracefully ( )
private
core::scoring::EnergyMap protocols::optimize_weights::IterativeOptEDriver::free_terms_energy_map_from_dofs ( core::optimization::Multivec const &  dofs) const
private

Expand free variables and combine with fixed to make an Energy Map.

This dofs Multivec is the list of weights that the OptEMultifunc sees; do not confuse this set of dofs with the set of dofs that the Minimizer and the WrappedOptEMultifunc use.

References free_score_list_.

Referenced by free_weights_and_refEs_from_vars().

void protocols::optimize_weights::IterativeOptEDriver::free_weights_and_refEs_from_vars ( utility::vector1< Real > const &  vars,
core::scoring::EnergyMap weights,
utility::vector1< Real > &  reference_energies 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::get_nat_aa_opte_data ( std::string const &  pdb_name,
core::pose::Pose pose,
core::pose::Pose native_pose,
core::scoring::ScoreFunction const &  scorefxn,
ScoreTypes score_list,
ScoreTypes fixed_score_vec,
OptEData opte_data 
)
private

refactor this into an optE common...

This function is the heart of the optE protocol. For each position of the protein, we're going to create a new PackerTask that only tries all of the various amino acids at that position. (It also uses any packer task related flags on the command line.) opte_data is a container class for optE data objects. So each position is going to have a PNatAAOptEPositionData object. For each rotamer that's built for each position, the energies for the fixed and free energy terms are stored in a PNatAAOptERotamerData object which gets added to the PNatAAOptEPositionData object. So at the end of this function we have one optEData object which has position info for all position and rotamer data for all rotamers at each position.

References protocols::cluster::calibur::aa, core::conformation::Residue::aa(), protocols::optimize_weights::OptEData::add_position_data(), core::pack::task::operation::InitializeFromCommandline::apply(), copy_native_packertask_logic(), core::pack::create_packer_graph(), core::pose::Pose::energies(), core::scoring::fa_rep, core::conformation::Residue::is_protein(), core::chemical::ResidueTypeBase::name3(), core::chemical::name_from_aa(), core::chemical::num_canonical_aas, core::pose::Pose::pdb_info(), core::scoring::ScoreFunction::prepare_rotamers_for_packing(), pssm_data_, core::scoring::UnfoldedStatePotential::raw_unfolded_state_energymap(), core::pose::Pose::residue(), core::pose::Pose::residue_type(), core::scoring::ScoreFunction::setup_for_packing(), core::pose::Pose::size(), task_factory_, core::scoring::Energies::tenA_neighbor_graph(), protocols::optimize_weights::TR(), core::scoring::UNFOLDED_SCORE12, and using_unfolded_energy_term_.

Referenced by compute_rotamer_energies_for_assigned_pdbs().

void protocols::optimize_weights::IterativeOptEDriver::get_nat_rot_opte_data ( std::string const &  pdb_name,
core::pose::Pose pose,
core::pose::Pose native_pose,
utility::vector1< bool include_rsd,
core::scoring::ScoreFunction const &  scorefxn,
ScoreTypes score_list,
ScoreTypes fixed_score_vec,
OptEData opte_data 
)
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::get_native_pdb_names ( )
private

Reads in the list of pdb file names to use for the optimization. Uses basic::options::start_file which returns a vector1 of strings. Unfortunately, this method reads data out of the return value of start_file() which is why you have to use a listfile with the -s option for things to work correctly.

Referenced by divide_up_pdbs().

std::string protocols::optimize_weights::IterativeOptEDriver::get_scorefile_name ( )
private
Remarks
IMPORTANT IMPORTANT IMPORTANT: requires weightdir having been created before launching the program.

References outer_loop_counter_.

Referenced by write_new_scorefile().

void protocols::optimize_weights::IterativeOptEDriver::go ( )
void protocols::optimize_weights::IterativeOptEDriver::initialize_free_and_fixed ( core::scoring::EnergyMap free_parameters,
core::scoring::EnergyMap fixed_parameters 
)
private

Reads in the files specified by opt_e::free and opt_e::fixed. Figures out what ScoreType the user placed on each line of the file and then sets the free_parameters array with that ScoreType. If the user does not place a starting weight, a random starting weight is given for that type. Also sets the fixed terms in fixed_parameters. Both of these EnergyMap references that are passed in are actually vectors of EnergyMaps? Either way, the free and fixed params are set in this method. If no fixed or free files are found, then there are some hardcoded defaults that get used.

References core::scoring::cenpack, core::scoring::dslf_ca_dih, core::scoring::dslf_cs_ang, core::scoring::dslf_ss_dih, core::scoring::dslf_ss_dst, core::scoring::env, core::scoring::envsmooth, core::scoring::fa_atr, core::scoring::fa_dun, core::scoring::fa_rep, core::scoring::hbond_lr_bb, core::scoring::hbond_sr_bb, MPI_rank_, core::scoring::n_score_types, core::scoring::name_from_score_type(), core::scoring::p_aa_pp, core::scoring::pair, core::scoring::rama, core::scoring::rg, core::scoring::score_type_from_name(), core::pack::task::tokenize_line(), protocols::optimize_weights::TR_VERBOSE(), and core::scoring::vdw.

Referenced by intialize_free_and_fixed_energy_terms().

void protocols::optimize_weights::IterativeOptEDriver::intialize_free_and_fixed_energy_terms ( )
private

Calls the method initialize_free_and_fixed() which reads in the files free and fixed and sets the EnergyMap vectors free_parameters_ and fixed_parameters_. Also here the reference energies array gets init'd. Finally, setup_derived_free_and_fixed_data gets called which.

References before_minimization_reference_energies_, fixed_parameters_, free_parameters_, initialize_free_and_fixed(), MPI_rank_, core::chemical::num_canonical_aas, and setup_derived_free_and_fixed_data().

Referenced by IterativeOptEDriver().

void protocols::optimize_weights::IterativeOptEDriver::load_pose ( core::pose::Pose pose,
std::string const &  filename,
bool  ignore_centroid_input_flag = false 
)
private
void protocols::optimize_weights::IterativeOptEDriver::load_pssm_data ( std::string const &  native_filename,
core::Size const  which_protein 
)
private
SingleStructureDataOP protocols::optimize_weights::IterativeOptEDriver::make_simple_ssd_from_pdb ( std::string const &  pdb_filename,
core::scoring::ScoreFunctionOP  sfxn,
bool  pretend_no_fa_rep = false 
) const
private
Real protocols::optimize_weights::IterativeOptEDriver::measure_rotamer_recovery ( utility::vector1< std::string > const &  native_pdb_names,
utility::vector1< std::string > const &  names_for_output_pdbs,
core::scoring::ScoreFunctionOP  sfxn,
core::Size npos,
core::Size nrecovered 
)
private
Real protocols::optimize_weights::IterativeOptEDriver::measure_sequence_recovery ( utility::vector1< std::string > const &  native_pdb_names,
utility::vector1< std::string > const &  names_for_output_pdbs,
core::scoring::ScoreFunctionOP  sfxn,
core::Size nresidues_designed,
core::Size nresidues_recovered 
)
private
std::string protocols::optimize_weights::IterativeOptEDriver::node_name ( int  rank)
private
Size protocols::optimize_weights::IterativeOptEDriver::num_inner_iterations ( ) const
private
Size protocols::optimize_weights::IterativeOptEDriver::num_outer_iterations ( ) const
private

Referenced by go().

Real protocols::optimize_weights::IterativeOptEDriver::opte_weight_mixing_factor ( core::Size  outer_loop_counter,
core::Size  inner_loop_counter 
)
private

Referenced by write_new_scorefile().

void protocols::optimize_weights::IterativeOptEDriver::optimize_weights ( )
private

Optimizes weights using either a standard minimizer or a ParticleSwarmMinimizer (which is significantly better!).

Assuming the ParticleSwarmMinimizer is used... Each particle traverses weight space and comes up with a set of values, then it evaluates the fitness function (which basically calls all of the appropriate underlying get_score() methods) to see how good the new weights are. The particles then update their direction and velocity and come up with a new set of weights to evaluate. This is done with a set number of particles and a set number of cycles. Currently using on the order of 100 particles and 20 cycles. (No tests have been done to determine the optimum number of particles and/or cycles, although ronj likes to use more particles whenever possible.)

References after_minimization_reference_energies_, barrier(), before_minimization_reference_energies_, collect_rotamer_energies_from_slave_cpus(), component_weights_, protocols::optimize_weights::OptEMultifunc::declare_minimization_over(), core::chemical::element::F, protocols::optimize_weights::OptEMultifunc::fix_reference_energies(), fixed_parameters_, fixed_score_list_, free_count_, free_parameters_, free_score_list_, free_weights_after_minimization_, free_weights_before_minimization_, protocols::optimize_weights::OptEMultifunc::get_dofs_from_energy_map(), protocols::optimize_weights::OptEMultifunc::get_energy_map_from_dofs(), protocols::optimize_weights::OptEMultifunc::get_reference_energies_from_dofs(), include_terms_, inner_loop_counter_, protocols::mean_field::max(), protocols::mean_field::min(), minimizer_dofs_after_minimization_, minimizer_dofs_before_minimization_, minimizer_dofs_mixed_, MPI_rank_, protocols::optimize_weights::n_optE_data_types, core::scoring::n_score_types, core::scoring::name_from_score_type(), core::chemical::num_canonical_aas, optE_data_, protocols::optimize_weights::OptEPositionDataFactory::optE_type_name(), outer_loop_counter_, read_reference_energies_from_file(), core::optimization::ParticleSwarmMinimizer::run(), core::optimization::Minimizer::run(), send_rotamer_energies_to_master_cpu(), protocols::loops::start, test_weight_sensitivity(), core::id::to_string(), protocols::optimize_weights::TR(), protocols::optimize_weights::TR_VERBOSE(), using_unfolded_energy_term_, protocols::optimize_weights::OptEMultifunc::wait_for_remote_vars(), and wrapped_opt_min_.

Referenced by go().

void protocols::optimize_weights::IterativeOptEDriver::output_weighted_unfolded_energies ( )
private
void protocols::optimize_weights::IterativeOptEDriver::print_energies ( core::pose::Pose pose,
core::scoring::ScoreFunctionOP  sfxn,
std::ostream &  os = std::cout 
)
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::read_reference_energies_from_file ( std::string const &  fname) const
private
void protocols::optimize_weights::IterativeOptEDriver::read_tagfile_to_taskfactory ( std::string  tagfile_name,
core::pack::task::TaskFactoryOP  task_factory 
)
private

Reads in an XML formatted task operation and puts builds a task factory from it.

Referenced by copy_native_packertask_logic(), and IterativeOptEDriver().

void protocols::optimize_weights::IterativeOptEDriver::repack_and_minimize_pose ( core::pose::Pose pose,
core::scoring::ScoreFunctionOP  sfxn 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::repack_assigned_pdbs ( )
private
bool protocols::optimize_weights::IterativeOptEDriver::residue_has_bad_bfactor ( core::pose::Pose const &  pose,
core::Size const  resid 
) const
private

True/False: a particular residue be skipped for inclusion into the native-rotamer recovery test because it contains an atom with a high B-factor.

pose must have been read from a pdb.

References core::pose::Pose::pdb_info().

Referenced by get_nat_rot_opte_data().

bool protocols::optimize_weights::IterativeOptEDriver::residue_has_unacceptably_bad_dunbrack_energy ( core::pose::Pose const &  pose,
core::Size const  resid 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::run_design_on_assigned_pdbs ( )
private
core::scoring::EnergyMap protocols::optimize_weights::IterativeOptEDriver::score_ligand_interface ( core::scoring::ScoreFunction const &  scorefxn,
core::pose::Pose pose 
)
private
void protocols::optimize_weights::IterativeOptEDriver::score_position_data ( )
private
void protocols::optimize_weights::IterativeOptEDriver::send_rotamer_energies_to_master_cpu ( )
private

Used by all slave nodes; sends the rotamer energies (according to the protocol we've set up here) to the master node.

References fixed_parameters_, free_parameters_, core::scoring::n_score_types, and optE_data_.

Referenced by collect_rotamer_energies(), optimize_weights(), and score_position_data().

void protocols::optimize_weights::IterativeOptEDriver::send_rotamer_recovery_data_to_master_cpu ( )
private
void protocols::optimize_weights::IterativeOptEDriver::send_sequence_recovery_data_to_master_cpu ( )
private
void protocols::optimize_weights::IterativeOptEDriver::set_aa_periodicity ( PNatRotOptEPositionDataOP  pos_data,
core::chemical::AA  aa 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::setup_derived_free_and_fixed_data ( )
private

include_terms_ is an EnergyMap, as well. I think this function sets up the free and fixed score lists which are just a vector1 of ScoreType objects. include_, fixed_ and free_count_ are just (core::Size) member variables.

References fixed_count_, fixed_parameters_, fixed_score_list_, free_count_, free_parameters_, free_score_list_, include_count_, include_terms_, and core::scoring::n_score_types.

Referenced by intialize_free_and_fixed_energy_terms().

void protocols::optimize_weights::IterativeOptEDriver::setup_pdbnames_next_round ( core::Size const  outer_loop_counter,
utility::vector1< std::string > &  pdbs_next_round,
utility::vector1< std::string > const &  native_pdb_names 
)
private

This method takes the filenames from the current round and creates new filenames based on what iteration of the outer_loop_counter we're on. So, each iteration we want to use the newest pdbs. This method ensures the filename get updated.

Remarks
Requires workdir_{0..MPI_numprocs_ - 1 } directories already exist.

References MPI_rank_, and core::id::to_string().

Referenced by collect_rotamer_energies(), and divide_up_pdbs().

SingleStructureDataOP protocols::optimize_weights::IterativeOptEDriver::single_structure_data_for_pose ( core::scoring::ScoreFunctionOP  scorefxn,
core::pose::Pose pose,
core::pose::Pose const &  crystal_native,
utility::vector1< Real > &  free_data,
utility::vector1< Real > &  fixed_data,
std::string const &  structure_tag = "" 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::task_factory ( core::pack::task::TaskFactoryCOP  tf)

take care when using a custom TaskFactory: TaskOperations must not 'accumulate state' as they will be reused repeatedly

References task_factory_.

void protocols::optimize_weights::IterativeOptEDriver::test_sequence_recovery ( )
private
void protocols::optimize_weights::IterativeOptEDriver::test_weight_sensitivity ( OptEMultifunc const &  func,
core::optimization::Multivec const &  dofs 
) const
private
void protocols::optimize_weights::IterativeOptEDriver::write_new_scorefile ( )
private
void protocols::optimize_weights::IterativeOptEDriver::write_parameters_to_std_out ( core::scoring::EnergyMap free_parameters,
utility::vector1< Real > const &  reference_energies 
)
private
void protocols::optimize_weights::IterativeOptEDriver::zero_aa_counts ( )
private

Set the counts for the amino acid frequencies (observed and expected) to zero.

References aa_exp_, aa_freq_exp_, aa_freq_obs_, and aa_obs_.

Referenced by run_design_on_assigned_pdbs().

Member Data Documentation

utility::vector1< core::Size > protocols::optimize_weights::IterativeOptEDriver::aa_exp_
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::aa_freq_exp_
private

the frequency for each amino acid from the previous round of design

Referenced by collect_sequence_recovery_data_from_slave_cpus(), decide_if_sequence_recovery_improved(), write_new_scorefile(), and zero_aa_counts().

utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::aa_freq_obs_
private

the counts for each amino acid in the input data set (expected)

Referenced by collect_sequence_recovery_data_from_slave_cpus(), decide_if_sequence_recovery_improved(), write_new_scorefile(), and zero_aa_counts().

utility::vector1< core::Size > protocols::optimize_weights::IterativeOptEDriver::aa_obs_
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::after_minimization_reference_energies_
private
utility::vector1< utility::vector1< std::pair< core::chemical::AA, utility::vector1< Real > > > > protocols::optimize_weights::IterativeOptEDriver::all_pssm_data_
private

store the PSSM data so it's only read once.

Referenced by load_pssm_data().

utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::before_minimization_reference_energies_
private

Hold the result of minimization – interpolate between the before and after weight sets during iterative sequence recovery.

Referenced by decide_if_sequence_recovery_improved(), intialize_free_and_fixed_energy_terms(), IterativeOptEDriver(), optimize_weights(), score_position_data(), and write_new_scorefile().

utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::component_weights_
private
utility::vector1< core::pose::Pose > protocols::optimize_weights::IterativeOptEDriver::context_poses_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::count_recovered_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::count_rotamers_recovered_
private
utility::vector1< utility::vector1< std::string > > protocols::optimize_weights::IterativeOptEDriver::ddG_bind_files_
private

A list of lists for use in optimizing ddG binding predictions.

Referenced by collect_ddG_of_binding_data(), and divide_up_pdbs().

OptEDataOP protocols::optimize_weights::IterativeOptEDriver::ddG_bind_optE_data_
private

preserve the ddG bind mutation data between iterations to minimize I/O

Referenced by collect_ddG_of_binding_data().

utility::vector1< std::pair< std::string, std::string > > protocols::optimize_weights::IterativeOptEDriver::ddg_mut_wt_pairs_
private

A list of file-list pairs: first = list of relaxed mutant pdbs; second = list of native pdbs

Referenced by collect_ddG_of_mutation_data(), and divide_up_pdbs().

OptEDataOP protocols::optimize_weights::IterativeOptEDriver::ddG_mutation_data_
private

preserve the ddMutation data between iterations to minimize I/O

Referenced by collect_ddG_of_mutation_data().

utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::ddGs_
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::ddGs_binding_
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::decdisc_crystal_natives_
private
utility::vector1< utility::vector1< core::pose::Pose > > protocols::optimize_weights::IterativeOptEDriver::decdisc_decoy_poses_
private
utility::vector1< std::pair< std::string, std::string > > protocols::optimize_weights::IterativeOptEDriver::decdisc_native_decoy_pairs_
private

A list of file-list pairs. first = list of relaxed-native pdbs; second = list of decoy pdbs.

Referenced by collect_decoy_discrimination_data(), and divide_up_pdbs().

utility::vector1< utility::vector1< core::pose::Pose > > protocols::optimize_weights::IterativeOptEDriver::decdisc_native_poses_
private
utility::vector1< core::pose::Pose > protocols::optimize_weights::IterativeOptEDriver::decdisc_xtal_natives_
private
OptEDataOP protocols::optimize_weights::IterativeOptEDriver::decoy_discrim_data_
private

preserve the decoy scores by component between iterations to minimize I/O.

Referenced by collect_decoy_discrimination_data().

utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::dG_binding_
private
OptEDataOP protocols::optimize_weights::IterativeOptEDriver::dG_binding_data_
private

preserve the dGbinding data between iterations to minimize I/O

Referenced by collect_dG_of_binding_data().

utility::vector1< std::pair< std::string, std::string > > protocols::optimize_weights::IterativeOptEDriver::dG_bound_unbound_pairs_
private

A list of PDB file pairs: first = "bound" structure; second = "unbound" structure with partners well separated

Referenced by collect_dG_of_binding_data(), and divide_up_pdbs().

core::Size protocols::optimize_weights::IterativeOptEDriver::fixed_count_
private
EnergyMap protocols::optimize_weights::IterativeOptEDriver::fixed_parameters_
private
ScoreTypes protocols::optimize_weights::IterativeOptEDriver::fixed_score_list_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::free_count_
private
EnergyMap protocols::optimize_weights::IterativeOptEDriver::free_parameters_
private
ScoreTypes protocols::optimize_weights::IterativeOptEDriver::free_score_list_
private
EnergyMap protocols::optimize_weights::IterativeOptEDriver::free_weights_after_minimization_
private
EnergyMap protocols::optimize_weights::IterativeOptEDriver::free_weights_before_minimization_
private
EnergyMap protocols::optimize_weights::IterativeOptEDriver::free_weights_inner_loop_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::include_count_
private
EnergyMap protocols::optimize_weights::IterativeOptEDriver::include_terms_
private

These get updated from the above two.

Referenced by create_unweighted_scorefunction(), optimize_weights(), and setup_derived_free_and_fixed_data().

core::Size protocols::optimize_weights::IterativeOptEDriver::inner_loop_counter_
private
Real protocols::optimize_weights::IterativeOptEDriver::inner_loop_rotamer_recovery_rate_
private
Real protocols::optimize_weights::IterativeOptEDriver::inner_loop_sequence_recovery_rate_
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::ligand_crystal_natives_
private
OptEDataOP protocols::optimize_weights::IterativeOptEDriver::ligand_discrim_data_
private

preserve the decoy scores by component between iterations to minimize I/O.

Referenced by collect_ligand_discrimination_data().

utility::vector1< std::pair< std::string, std::string > > protocols::optimize_weights::IterativeOptEDriver::ligand_native_decoy_pairs_
private

A list of file-list pairs. first = list of relaxed-native pdbs; second = list of decoy pdbs.

Referenced by collect_ligand_discrimination_data(), and divide_up_pdbs().

utility::vector1< core::pose::Pose > protocols::optimize_weights::IterativeOptEDriver::ligand_repack_native_poses_
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::ligand_repack_pdbs_
private

For rotamer recovery around ligands.

Referenced by compute_rotamers_around_ligands(), and divide_up_pdbs().

utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::minimizer_dofs_after_minimization_
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::minimizer_dofs_before_minimization_
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::minimizer_dofs_mixed_
private
Real protocols::optimize_weights::IterativeOptEDriver::mixing_factor_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::MPI_nprocs_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::MPI_rank_
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::native_pdbs_
private
utility::vector1< core::pose::Pose > protocols::optimize_weights::IterativeOptEDriver::native_poses_
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::next_iteration_pdbs_
private
OptEDataOP protocols::optimize_weights::IterativeOptEDriver::optE_data_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::outer_loop_counter_
private
Real protocols::optimize_weights::IterativeOptEDriver::outer_loop_last_sequence_recovery_rate_
private
Real protocols::optimize_weights::IterativeOptEDriver::outer_loop_seq_profile_cross_entropy_
private
utility::vector1< std::string > protocols::optimize_weights::IterativeOptEDriver::pdbs_this_round_
private
utility::vector1< std::pair< core::chemical::AA, utility::vector1< Real > > > protocols::optimize_weights::IterativeOptEDriver::pssm_data_
private
utility::vector1< Real > protocols::optimize_weights::IterativeOptEDriver::reference_energies_inner_loop_
private
utility::vector1< core::pose::Pose > protocols::optimize_weights::IterativeOptEDriver::rotamer_recovery_context_poses_
private
core::pack::task::TaskFactoryOP protocols::optimize_weights::IterativeOptEDriver::task_factory_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::total_positions_
private
core::Size protocols::optimize_weights::IterativeOptEDriver::total_rotamer_positions_
private
bool protocols::optimize_weights::IterativeOptEDriver::using_unfolded_energy_term_
private
WrapperOptEMultifuncOP protocols::optimize_weights::IterativeOptEDriver::wrapped_opt_min_
private

When using the optEMultifunc wrapper, hold on to the dofs that the minimizer has access to and interpolate in the space of those dofs; then convert the interpolated dofs into weights. Interpolating the weights directly might result in weights that violate the mixing rules for the wrapper.

Referenced by optimize_weights(), and write_new_scorefile().


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