Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
protocols::mean_field::MeanField Class Reference

#include <MeanField.hh>

Inheritance diagram for protocols::mean_field::MeanField:
Inheritance graph
[legend]

Public Member Functions

 MeanField (core::Size const option, core::pose::PoseOPs &poses, utility::vector1< core::pack::task::PackerTaskOP > const &tasks, core::scoring::ScoreFunctionOP scfxn)
 
 MeanField (core::Size const option, core::pose::PoseOPs &poses, utility::vector1< core::pack::task::PackerTaskOP > const &tasks, core::scoring::ScoreFunctionOP scfxn, core::Real lambda_mem, core::Real tolerance, core::Real temp, core::Real threshold)
 
 ~MeanField () override
 Destructor. More...
 
void show (std::ostream &output=std::cout) const
 Generate string representation of MeanField for debugging purposes. More...
 
void converge ()
 tries to converge to a final RotMatrix More...
 
virtual void process ()
 simply calls the converge method to find a converged RotMatrix More...
 
void build_rot_matrix_for_pose (core::Size pose_ind)
 build a RotMatrix for a specific pose in poses_ More...
 
virtual void delete_pose (core::Size pose_ind)
 delete a pose More...
 
virtual RotMatrixCOP rot_matrix () const
 returns const pointer to RotMatrix More...
 
RotMatrixCOP alt_rot_matrix () const
 returns const pointer to alternate RotMatrix More...
 
jagged_array< core::Real > const & energies_matrix () const
 returns const reference to energies_matrix More...
 
core::Real lambda_memory () const
 get lambda memory, used in convergence process More...
 
core::Real tolerance () const
 get tolerance, used to determine if converged More...
 
core::Real temperature () const
 get temperature (kT) More...
 
core::Real threshold () const
 get threshold More...
 
core::Real init_option () const
 get init option (used to initialize RotMatrix) More...
 
core::Size num_poses () const
 get number of poses More...
 
core::Size num_packed () const
 get number of residues that are packable More...
 

Private Member Functions

 MeanField ()
 
 MeanField (MeanField const &object_to_copy)
 
MeanFieldoperator= (MeanField const &object_to_copy)
 
void calc_alt_rot_matrix ()
 calculate alt_rot_matrix_ by calculating an energies_matrix_ and then converting energies to Boltzmann probs More...
 
void calc_energies_matrix ()
 calculates energies_matrix_ based on the energies in pig_ and the weights in rot_matrix_ More...
 
void convert_energies_to_alt_rm ()
 converts the energies_matrix_ to the alt_rot_matrix_ by calculating the Boltzmann probabilities More...
 
bool has_converged () const
 returns a bool, based on whether the maximum difference after rmsd-ing rot_matrix_ with alt_rot_matrix_ is < tolerance_ More...
 

Private Attributes

RotMatrixOP rot_matrix_
 
RotMatrixOP alt_rot_matrix_
 
jagged_array< core::Realenergies_matrix_
 
core::Real lambda_memory_
 
core::Real tolerance_
 
core::Real temperature_
 
core::Real init_option_
 
core::Real threshold_
 
core::pack::interaction_graph::FixedBBInteractionGraphOP pig_
 
core::pose::PoseOPsposes_
 
utility::vector1
< core::pack::task::PackerTaskOP
tasks_
 
core::scoring::ScoreFunctionOP scfxn_
 

Friends

std::ostream & operator<< (std::ostream &output, MeanField const &object_to_output)
 Insertion operator (overloaded so that MeanField can be "printed" in PyRosetta). More...
 

Detailed Description

calculator which conducts mean-field algorithm on either a single, non-designable pose or used as base class of other MeanFields

Constructor & Destructor Documentation

protocols::mean_field::MeanField::MeanField ( core::Size const  option,
core::pose::PoseOPs poses,
utility::vector1< core::pack::task::PackerTaskOP > const &  tasks,
core::scoring::ScoreFunctionOP  scfxn 
)
protocols::mean_field::MeanField::MeanField ( core::Size const  option,
core::pose::PoseOPs poses,
utility::vector1< core::pack::task::PackerTaskOP > const &  tasks,
core::scoring::ScoreFunctionOP  scfxn,
core::Real  lambda_mem,
core::Real  tolerance,
core::Real  temp,
core::Real  threshold 
)
protocols::mean_field::MeanField::~MeanField ( )
overridedefault

Destructor.

protocols::mean_field::MeanField::MeanField ( )
private
protocols::mean_field::MeanField::MeanField ( MeanField const &  object_to_copy)
private

Member Function Documentation

RotMatrixCOP protocols::mean_field::MeanField::alt_rot_matrix ( ) const
inline

returns const pointer to alternate RotMatrix

References alt_rot_matrix_.

void protocols::mean_field::MeanField::build_rot_matrix_for_pose ( core::Size  pose_ind)

build a RotMatrix for a specific pose in poses_

builds a RotMatrix for a specific pose by initializing RotamerSets and using pack_rotamers_setup

also builds an IG for use in calculating energies_matrix

References alt_rot_matrix_, energies_matrix_, init_option_, core::pack::pack_rotamers_setup(), pig_, poses_, rot_matrix_, scfxn_, tasks_, and protocols::mean_field::TR().

Referenced by protocols::mean_field::FlexBBMeanField::process(), and process().

void protocols::mean_field::MeanField::calc_alt_rot_matrix ( )
private

calculate alt_rot_matrix_ by calculating an energies_matrix_ and then converting energies to Boltzmann probs

used by public methods of algorithm

calculates the next conformational matrix (RM)

i.e. if RotMatrix is RM(i), prints out RM(i+1)

first calculates energies matrix based on RM, then converts energies to Boltzmann weights (RM)

References calc_energies_matrix(), and convert_energies_to_alt_rm().

Referenced by converge().

void protocols::mean_field::MeanField::calc_energies_matrix ( )
private

calculates energies_matrix_ based on the energies in pig_ and the weights in rot_matrix_

calculates energies matrix from RM and IG

uses equation EM[i][j] = one_body_energy[ii][jj] + sum(two_body_energy[jj][n] where:

ii = node (position) of residue

jj = state (rotamer) of residue

n = other rotamers that interact with [ii][jj]

sum is over all rotamers of other residues that interact with [ii][jj]

References energies_matrix_, core::pack::interaction_graph::EdgeBase::get_other_ind(), pig_, rot_matrix_, and threshold_.

Referenced by calc_alt_rot_matrix().

void protocols::mean_field::MeanField::converge ( )

tries to converge to a final RotMatrix

runs mean-field algorithm until convergence is reached or 1000 rounds of convergence has been run

Remarks
1000 is currently arbitrary - should possibly be changed later

References calc_alt_rot_matrix(), protocols::pack_daemon::error_message, has_converged(), lambda_memory(), rot(), rot_matrix_, and protocols::mean_field::TR().

Referenced by protocols::mean_field::FlexBBMeanField::process(), and process().

void protocols::mean_field::MeanField::convert_energies_to_alt_rm ( )
private

converts the energies_matrix_ to the alt_rot_matrix_ by calculating the Boltzmann probabilities

calculates Boltzmann weights from energies_matrix_ to form alt_rot_matrix_

References alt_rot_matrix_, energies_matrix_, protocols::buns::energy, rot(), temperature_, and threshold_.

Referenced by calc_alt_rot_matrix().

void protocols::mean_field::MeanField::delete_pose ( core::Size  pose_ind)
virtual

delete a pose

delete pose from the list of poses

Remarks
used if a pose fails to converge

Reimplemented in protocols::mean_field::FlexBBDesignMeanField, and protocols::mean_field::FlexBBMeanField.

References poses_, and tasks_.

Referenced by protocols::mean_field::FlexBBMeanField::delete_pose().

jagged_array< core::Real > const& protocols::mean_field::MeanField::energies_matrix ( ) const
inline
bool protocols::mean_field::MeanField::has_converged ( ) const
private

returns a bool, based on whether the maximum difference after rmsd-ing rot_matrix_ with alt_rot_matrix_ is < tolerance_

checks if algorithm has converged by checking if RMSmat < tolerance

References alt_rot_matrix_, energies_matrix_, protocols::simple_moves::bb_sampler::probability, rot(), rot_matrix_, tolerance_, and protocols::analysis::total.

Referenced by converge().

core::Real protocols::mean_field::MeanField::init_option ( ) const
inline

get init option (used to initialize RotMatrix)

References init_option_.

core::Real protocols::mean_field::MeanField::lambda_memory ( ) const
inline

get lambda memory, used in convergence process

References lambda_memory_.

Referenced by converge().

Size protocols::mean_field::MeanField::num_packed ( ) const

get number of residues that are packable

uses task_ to determine number of residues to be packed

References tasks_.

Referenced by protocols::mean_field::FlexBBMeanField::delete_pose().

core::Size protocols::mean_field::MeanField::num_poses ( ) const
inline
MeanField& protocols::mean_field::MeanField::operator= ( MeanField const &  object_to_copy)
private
void protocols::mean_field::MeanField::process ( )
virtual

simply calls the converge method to find a converged RotMatrix

required so that it can be overridden in derived classes which perform many more functions while processing

Reimplemented in protocols::mean_field::FlexBBDesignMeanField, protocols::mean_field::DesignMeanField, and protocols::mean_field::FlexBBMeanField.

References build_rot_matrix_for_pose(), and converge().

Referenced by protocols::mean_field::DesignMeanField::process().

RotMatrixCOP protocols::mean_field::MeanField::rot_matrix ( ) const
virtual

returns const pointer to RotMatrix

Remarks
virtual because can be overridden by FlexBBMeanField

Reimplemented in protocols::mean_field::FlexBBMeanField.

References rot_matrix_.

Referenced by protocols::mean_field::DesignMeanField::init_aa_matrix(), protocols::mean_field::FlexBBMeanField::process(), and show().

void protocols::mean_field::MeanField::show ( std::ostream &  output = std::cout) const

Generate string representation of MeanField for debugging purposes.

prints out RotMatrix, Energies Matrix, and Alt RotMatrix

References alt_rot_matrix_, energies_matrix_, rot_matrix(), and protocols::mean_field::jagged_array< T, A >::show().

Referenced by protocols::mean_field::operator<<(), and protocols::mean_field::DesignMeanField::show().

core::Real protocols::mean_field::MeanField::temperature ( ) const
inline
core::Real protocols::mean_field::MeanField::threshold ( ) const
inline

get threshold

References threshold_.

core::Real protocols::mean_field::MeanField::tolerance ( ) const
inline

get tolerance, used to determine if converged

References tolerance_.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
MeanField const &  object_to_output 
)
friend

Insertion operator (overloaded so that MeanField can be "printed" in PyRosetta).

Member Data Documentation

RotMatrixOP protocols::mean_field::MeanField::alt_rot_matrix_
private
jagged_array< core::Real > protocols::mean_field::MeanField::energies_matrix_
private
core::Real protocols::mean_field::MeanField::init_option_
private
core::Real protocols::mean_field::MeanField::lambda_memory_
private

Referenced by lambda_memory().

core::pack::interaction_graph::FixedBBInteractionGraphOP protocols::mean_field::MeanField::pig_
private
core::pose::PoseOPs& protocols::mean_field::MeanField::poses_
private
RotMatrixOP protocols::mean_field::MeanField::rot_matrix_
private
core::scoring::ScoreFunctionOP protocols::mean_field::MeanField::scfxn_
private
utility::vector1< core::pack::task::PackerTaskOP > protocols::mean_field::MeanField::tasks_
private
core::Real protocols::mean_field::MeanField::temperature_
private
core::Real protocols::mean_field::MeanField::threshold_
private
core::Real protocols::mean_field::MeanField::tolerance_
private

Referenced by has_converged(), and tolerance().


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