Rosetta Protocols  2014.35
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
protocols::loop_modeling::LoopMover Class Reference

Base class for loop-sampling algorithms. More...

#include <LoopMover.hh>

Public Member Functions

 LoopMover ()
 Default constructor. More...
 
 ~LoopMover ()
 Default destructor. More...
 
void apply (Pose &pose)
 Sample the pose in the regions specified by get_loops(). More...
 
virtual string get_name () const
 Return the name of this mover. More...
 
bool was_successful () const
 Return true if the previous move was successful. More...
 
Loops get_loops () const
 Return the loops to be sampled on the next call to apply(). More...
 
core::scoring::ScoreFunctionCOP get_score_function () const
 Return the score function to be used on the next call to apply(). More...
 
core::scoring::ScoreFunctionOP get_score_function ()
 Return the score function to be used on the next call to apply() (non-const access). More...
 
void set_loop (Loop const &loop)
 Set the loop to be sampled on the next call to apply(). More...
 
void set_loops (Loops const &loops)
 Set the loops to be sampled on the next call to apply(). More...
 
void set_score_function (core::scoring::ScoreFunctionOP sfxn)
 Set the score function to be used on the next call to apply(). More...
 
virtual FoldTreeRequest request_fold_tree () const
 Return an enum representing the kind of fold tree that is compatible with this mover. More...
 
void trust_fold_tree ()
 Promise that the calling code will setup a fold tree compatible with request_fold_tree(). If this method is not called, most movers will setup a fold tree on their own the first time apply() is called. More...
 
- Public Member Functions inherited from protocols::moves::Mover
 Mover ()
 
virtual ~Mover ()
 
virtual MoverSP create ()
 
virtual void apply (core::io::serialization::PipeMap &pmap)
 
virtual void parse_state (SerializableState const &state)
 
virtual void parse_def (utility::lua::LuaObject const &def, utility::lua::LuaObject const &score_fxns, utility::lua::LuaObject const &tasks, MoverCacheSP cache)
 
virtual void save_state (SerializableState &state)
 
 Mover (std::string const &type_name)
 sets the type for a mover; name_ has been removed (2010/05/14) More...
 
 Mover (Mover const &other)
 
Moveroperator= (Mover const &other)
 assignment operator More...
 
virtual core::Real last_proposal_density_ratio ()
 
std::string const & type () const
 
void set_type (std::string const &setting)
 
std::string get_current_tag () const
 A tag is a unique identifier used to identify structures produced by this Mover. get_current_tag() returns the tag, and set_current_tag( std::string tag ) sets the tag. This functionality is not intended for use with the 2008 job distributor. More...
 
void set_current_tag (std::string const &new_tag)
 
virtual void set_input_pose (PoseCOP pose)
 setter for poses contained for rms More...
 
virtual void set_native_pose (PoseCOP pose)
 setter for native poses contained for rms -— we should get rid of this method? it is widely used, but a bit unsafe More...
 
PoseCOP get_input_pose () const
 
PoseCOP get_native_pose () const
 
virtual void test_move (Pose &pose)
 : Unit test support function. Apply one move to a given pose. Allows extra test specific functions to be called before applying More...
 
void type (const std::string &type_in)
 
virtual MoverOP clone () const
 Return a clone of the Mover object. More...
 
virtual void parse_my_tag (TagCOP tag, basic::datacache::DataMap &data, Filters_map const &filters, Movers_map const &movers, Pose const &pose)
 Called by MoverFactory when constructing new Movers. Takes care of the specific mover's parsing. More...
 
std::string get_type () const
 
MoverStatus get_last_move_status () const
 end parser interface, start Job Distributor interface///////////// More...
 
void reset_status ()
 resets status to SUCCESS, meant to be used before an apply(). The job distributor (august 08 vintage) uses this to ensure non-accumulation of status across apply()s. More...
 
virtual core::pose::PoseOP get_additional_output ()
 Mechanism by which a mover may return multiple output poses from a single input pose. More...
 
virtual void clear_info ()
 Strings container can be used to return miscellaneous info (as std::string) from a mover, such as notes about the results of apply(). The job distributor (Apr 09 vintage) will check this function to see if your protocol wants to add string info to the Job that ran this mover. One way this can be useful is that later, a JobOutputter may include/append this info to an output file. More...
 
virtual Stringsinfo ()
 non-const accessor More...
 
virtual Strings const & info () const
 const accessor More...
 
virtual bool reinitialize_for_each_job () const
 Inform the Job Distributor (August '08 vintage) whether this object needs to be freshly regenerated on each use. More...
 
virtual bool reinitialize_for_new_input () const
 Inform the Job Distributor (August '08 vintage) whether this object needs to be regenerated when the input pose is about to change, (for example, if the Mover has special code on the first apply() that is only valid for that one input pose). More...
 
virtual MoverOP fresh_instance () const
 Generates a new Mover object freshly created with the default ctor. More...
 
void set_current_job (protocols::jobdist::BasicJobCOP job)
 
jobdist::BasicJobCOP get_current_job () const
 
virtual void show (std::ostream &output=std::cout) const
 Outputs details about the Mover, including current settings. More...
 

Static Public Member Functions

static void setup_fold_tree (Pose &pose, Loops const &loops, FoldTreeRequest request)
 Setup the given pose with a fold tree that is compatible with the given loops and requests. More...
 
- Static Public Member Functions inherited from protocols::moves::Mover
static std::string name ()
 
static void register_options ()
 Overload this static method if you access options within the mover. More...
 

Protected Member Functions

virtual bool do_apply (Pose &pose)
 Perform the loop sampling move. This method can be overwritten in child classes. More...
 
virtual bool do_apply (Pose &pose, Loop const &loop)
 Perform the loop sampling move. This method can be overwritten in child classes. More...
 
void dont_manage_score_function ()
 Disable all the LoopMover score function related methods. More...
 
template<class LoopMoverSubclassOP >
LoopMoverSubclassOP register_nested_loop_mover (LoopMoverSubclassOP mover)
 Indicate that the given loop mover is used within do_apply(). More...
 
void deregister_nested_loop_movers ()
 Drop association with any currently registered loop movers. More...
 
vector1< LoopMoverOP > const & get_nested_loop_movers () const
 Return a reference to the list of nested loop movers. More...
 
- Protected Member Functions inherited from protocols::moves::Mover
void set_last_move_status (MoverStatus status)
 nonvirtual setter for MoverStatus last_status_. Protected means that only the mover itself will be able to change its own status. The job distributor (august 08 vintage) is aware of status set with this function and will do what the MoverStatus says. More...
 

Private Attributes

bool trust_fold_tree_
 
bool manage_score_function_
 
bool was_successful_
 
Loops loops_
 
core::scoring::ScoreFunctionOP score_function_
 
vector1< LoopMoverOPnested_movers_
 

Additional Inherited Members

- Public Types inherited from protocols::moves::Mover
typedef utility::tag::TagCOP TagCOP
 
typedef core::pose::Pose Pose
 
typedef core::pose::PoseCOP PoseCOP
 
typedef
protocols::filters::Filters_map 
Filters_map
 
typedef std::list< std::stringStrings
 

Detailed Description

Base class for loop-sampling algorithms.

Classes that inherit from LoopMover can plug into the LoopProtocol framework. The only method that subclasses need to provide is do_apply(). Note that the apply() method itself cannot be overwritten, because LoopMover uses it to do some useful setup and teardown work. Instead, there are two versions of do_apply() that subclasses may implement. Both return a boolean to indicate whether or not the move succeeded. The first version of do_apply() accepts only a Pose and is expected to operate on all of the loops returned by get_loops(). The second version accepts a Pose and a Loop, and is only expected to operate on the given loop. By default, the first version simply iterates through the loops provided by get_loops() and calls the second version on each one. This means that if the first version is overwritten, the second version will no longer be called. If neither method is reimplemented, a runtime error will be thrown.

LoopMover provides a handful of features that could be useful to a loop sampling algorithm. As mentioned above, the get_loops() method returns the loops that should be sampled. There are also a number of methods provided for controlling how the fold tree is setup up. The request_fold_tree() method can be reimplemented to return an enum telling what kind of fold tree this mover requires. When apply() is called for the first time, a compatible fold tree will be configured. This behavior is disabled if trust_fold_tree() is called beforehand, in which case responsibility for constructing a compatible fold tree is passed to the calling code.

Constructor & Destructor Documentation

protocols::loop_modeling::LoopMover::LoopMover ( )

Default constructor.

protocols::loop_modeling::LoopMover::~LoopMover ( )

Default destructor.

Member Function Documentation

void protocols::loop_modeling::LoopMover::apply ( Pose pose)
virtual

Sample the pose in the regions specified by get_loops().

The parent class apply() method automatically sets up a fold tree (if necessary) and keeps track of whether or not the move succeeded. Child classes should reimplement do_apply() instead of this method.

Implements protocols::moves::Mover.

References protocols::loops::add_cutpoint_variants(), do_apply(), protocols::loops::Loops::empty(), core::pose::Pose::fold_tree(), utility::pointer::owning_ptr< T >::get(), core::scoring::get_score_function(), loops_, protocols::loops::remove_cutpoint_variants(), request_fold_tree(), score_function_, set_score_function(), setup_fold_tree(), trust_fold_tree_, utility_exit_with_message, and was_successful_.

void protocols::loop_modeling::LoopMover::deregister_nested_loop_movers ( )
protected

Drop association with any currently registered loop movers.

References nested_movers_.

bool protocols::loop_modeling::LoopMover::do_apply ( Pose pose)
protectedvirtual
bool protocols::loop_modeling::LoopMover::do_apply ( Pose pose,
Loop const &  loop 
)
protectedvirtual

Perform the loop sampling move. This method can be overwritten in child classes.

Reimplemented in protocols::kinematic_closure::KicMover, protocols::loop_modeling::LoopBuilder, and protocols::loop_modeling::samplers::LegacyKicSampler.

References utility_exit_with_message.

void protocols::loop_modeling::LoopMover::dont_manage_score_function ( )
protected

Disable all the LoopMover score function related methods.

This is useful in LoopMover subclasses like LoopModeler that don't fit the "one score function" paradigm. When score function management is disabled, the get_score_function() and set_score_function() methods print a warning to the tracer and not do anything else. Nested loop movers will need to be manually given score functions.

References manage_score_function_.

Loops protocols::loop_modeling::LoopMover::get_loops ( ) const

Return the loops to be sampled on the next call to apply().

References loops_.

virtual string protocols::loop_modeling::LoopMover::get_name ( ) const
inlinevirtual
vector1< LoopMoverOP > const & protocols::loop_modeling::LoopMover::get_nested_loop_movers ( ) const
protected

Return a reference to the list of nested loop movers.

References nested_movers_.

ScoreFunctionCOP protocols::loop_modeling::LoopMover::get_score_function ( ) const

Return the score function to be used on the next call to apply().

References manage_score_function_, score_function_, and protocols::loop_modeling::TR.

ScoreFunctionOP protocols::loop_modeling::LoopMover::get_score_function ( )

Return the score function to be used on the next call to apply() (non-const access).

References manage_score_function_, score_function_, and protocols::loop_modeling::TR.

template<class LoopMoverSubclassOP >
LoopMoverSubclassOP protocols::loop_modeling::LoopMover::register_nested_loop_mover ( LoopMoverSubclassOP  mover)
inlineprotected

Indicate that the given loop mover is used within do_apply().

Once registered, the nested mover will be always be configured with the same loops, the same score function, and the same fold tree as this loop mover. Fold tree requests made by nested movers will be taken into account by the parent. This synchronization is entirely managed by LoopMover, so subclasses don't need to do anything special.

References loops_, nested_movers_, and score_function_.

Referenced by protocols::loop_modeling::utilities::RepeatedMover::RepeatedMover().

FoldTreeRequest protocols::loop_modeling::LoopMover::request_fold_tree ( ) const
virtual

Return an enum representing the kind of fold tree that is compatible with this mover.

The FoldTreeRequest enum values can be combined using the bitwise logical operators. For example, you can request either the standard fold tree or a simple fold tree with FTR_LOOPS_WITH_CUTS | FTR_SIMPLE_TREE.

Reimplemented in protocols::kinematic_closure::KicMover.

References protocols::loop_modeling::FTR_DONT_CARE, and nested_movers_.

Referenced by apply().

void protocols::loop_modeling::LoopMover::set_loop ( Loop const &  loop)

Set the loop to be sampled on the next call to apply().

References protocols::loops::Loops::add_loop(), and set_loops().

void protocols::loop_modeling::LoopMover::set_loops ( Loops const &  loops)

Set the loops to be sampled on the next call to apply().

References loops_, and nested_movers_.

Referenced by set_loop().

void protocols::loop_modeling::LoopMover::set_score_function ( core::scoring::ScoreFunctionOP  sfxn)

Set the score function to be used on the next call to apply().

References manage_score_function_, nested_movers_, score_function_, and protocols::loop_modeling::TR.

Referenced by apply().

void protocols::loop_modeling::LoopMover::setup_fold_tree ( Pose pose,
Loops const &  loops,
FoldTreeRequest  request 
)
static
void protocols::loop_modeling::LoopMover::trust_fold_tree ( )

Promise that the calling code will setup a fold tree compatible with request_fold_tree(). If this method is not called, most movers will setup a fold tree on their own the first time apply() is called.

References trust_fold_tree_.

bool protocols::loop_modeling::LoopMover::was_successful ( ) const

Return true if the previous move was successful.

References was_successful_.

Referenced by do_apply().

Member Data Documentation

Loops protocols::loop_modeling::LoopMover::loops_
private
bool protocols::loop_modeling::LoopMover::manage_score_function_
private
vector1<LoopMoverOP> protocols::loop_modeling::LoopMover::nested_movers_
private
core::scoring::ScoreFunctionOP protocols::loop_modeling::LoopMover::score_function_
private
bool protocols::loop_modeling::LoopMover::trust_fold_tree_
private

Referenced by apply(), and trust_fold_tree().

bool protocols::loop_modeling::LoopMover::was_successful_
private

Referenced by apply(), and was_successful().


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