Rosetta
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
protocols::simple_moves::SampleSequenceFromProbabilities Class Reference

A class to sample sequences from a PerResidueProbabilitiesMetric and thread them onto the pose. More...

#include <SampleSequenceFromProbabilities.hh>

Inheritance diagram for protocols::simple_moves::SampleSequenceFromProbabilities:
Inheritance graph
[legend]

Public Member Functions

 SampleSequenceFromProbabilities ()
 Constructors ///. More...
 
 ~SampleSequenceFromProbabilities () override
 Destructor (important for properly forward-declaring smart-pointer members) More...
 
void apply (core::pose::Pose &pose) override
 Mover Methods ///. More...
 
void show (std::ostream &output=std::cout) const override
 Show the contents of the Mover. More...
 
void set_metric (core::simple_metrics::PerResidueProbabilitiesMetricCOP metric)
 Set the PerResidueProbabilitiesMetric that will be used to calculate the pseudo-perplexity. More...
 
void set_use_cached_data (bool use_cache, std::string const &prefix="", std::string const &suffix="")
 Set a boolean to attempt to find cached data matching the name/custom_type of the passed in simple_metric. Optionally pass any set prefix/suffix. More...
 
void set_fail_on_missing_cache (bool fail)
 If use_cache is set to false, do we fail if no data is found in the pose? Default True. More...
 
void set_pos_temp (core::Real pos_temp)
 Set the positional temperature option. More...
 
void set_aa_temp (core::Real aa_temp)
 Set the amino acid temperature option. More...
 
void set_prob_cutoff (core::Real prob_cutoff)
 Set the probability cutoff option. More...
 
void set_delta_prob_cutoff (core::Real delta_prob_cutoff)
 Set the delta probability cutoff option. More...
 
void set_max_mutations (core::Size max_mutations)
 Set the maximum number of mutations allowed option. More...
 
void set_packing (bool packing)
 Set a bool to define whether we repack. More...
 
void set_task_factory (core::pack::task::TaskFactoryOP &task_factory)
 Set the taskfactory option. More...
 
void parse_my_tag (utility::tag::TagCOP tag, basic::datacache::DataMap &data) override
 Rosetta Scripts Support ///. More...
 
protocols::moves::MoverOP fresh_instance () const override
 required in the context of the parser/scripting scheme More...
 
protocols::moves::MoverOP clone () const override
 required in the context of the parser/scripting scheme More...
 
std::string get_name () const override
 Each derived class must specify its name. The class name. More...
 
void provide_citation_info (basic::citation_manager::CitationCollectionList &citations) const override
 This mover is unpublished. It returns Moritz Ertelt as its author. More...
 
- Public Member Functions inherited from protocols::moves::Mover
 Mover ()
 
virtual MoverOP create ()
 
MoverCOP get_self_ptr () const
 
MoverOP get_self_ptr ()
 
MoverCAP get_self_weak_ptr () const
 
MoverAP get_self_weak_ptr ()
 
 Mover (std::string const &type_name)
 sets the type for a mover; name_ has been removed (2010/05/14) More...
 
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...
 
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...
 
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...
 
void set_type (std::string const &setting)
 Set the 'type' string. More...
 
std::string get_type () const
 
void type (const std::string &type_in)
 Set the 'type' string. More...
 
std::string const & type () const
 Get the set 'type' string. More...
 
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
 
void set_current_job (protocols::jobdist::BasicJobCOP job)
 
jobdist::BasicJobCOP get_current_job () const
 
virtual void set_current_tag (std::string const &new_tag)
 
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...
 
virtual core::Real last_proposal_density_ratio ()
 
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...
 

Static Public Member Functions

static std::string mover_name ()
 
static void provide_xml_schema (utility::tag::XMLSchemaDefinition &xsd)
 
- 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...
 

Private Member Functions

std::map< core::Size, core::chemical::AAsample_mutations (std::map< core::Size, std::map< core::chemical::AA, core::Real >> &values, core::pose::Pose const &pose) const
 Main function to sample mutations from a probability distribution. More...
 
std::vector< core::Sizesample_positions (std::map< core::Size, std::map< core::chemical::AA, core::Real >> &values, core::pose::Pose const &pose) const
 Helper function to get the ranked positions based on maximum difference in probabilities. More...
 
core::chemical::AA sample_amino_acid (std::map< core::chemical::AA, core::Real > const &aa_probs) const
 Helper function to sample an amino acid from a transformed probability distribution. More...
 
utility::vector1< std::pair< core::Size, core::Real > > calculate_position_diffs (std::map< core::Size, std::map< core::chemical::AA, core::Real >> &probabilities, core::pose::Pose const &pose) const
 Helper function to calculate differences between current and other AAs, as well as disabling unwanted AAs. More...
 
std::vector< core::Sizeget_ranked_positions (utility::vector1< std::pair< core::Size, core::Real >> &position_diffs, core::pose::Pose const &pose) const
 Helper function to return positions ranked based on their delta_probability value to the current AA. More...
 

Static Private Member Functions

static std::string construct_modified_sequence (core::pose::Pose &pose, std::map< core::Size, core::chemical::AA > &mutations)
 Helper function to return a string of three amino acid letters from the proposed mutations for the SimpleThreadingMover. More...
 
static bool is_aa_allowed_by_task (core::pack::task::ResidueLevelTask const &rlt, core::chemical::AA aa)
 Helper function to check whether the AA is set to designable in the Packer. More...
 

Private Attributes

core::simple_metrics::PerResidueProbabilitiesMetricCOP metric_ = nullptr
 
core::Real pos_temp_ = 1.0
 
core::Real aa_temp_ = 1.0
 
core::Real prob_cutoff_ = 0.0001
 
core::Real delta_prob_cutoff_ = 0.0
 
core::Size max_mutations_ = 10000
 
bool packing_ = true
 
bool use_cache_ = false
 
std::string cache_prefix_
 
std::string cache_suffix_
 
bool fail_on_missing_cache_ = true
 
core::pack::task::TaskFactoryOP task_factory_
 

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 std::list< std::string > Strings
 
- 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...
 

Detailed Description

A class to sample sequences from a PerResidueProbabilitiesMetric and thread them onto the pose.

Constructor & Destructor Documentation

◆ SampleSequenceFromProbabilities()

protocols::simple_moves::SampleSequenceFromProbabilities::SampleSequenceFromProbabilities ( )

Constructors ///.

Default constructor

◆ ~SampleSequenceFromProbabilities()

protocols::simple_moves::SampleSequenceFromProbabilities::~SampleSequenceFromProbabilities ( )
overridedefault

Destructor (important for properly forward-declaring smart-pointer members)

Member Function Documentation

◆ apply()

void protocols::simple_moves::SampleSequenceFromProbabilities::apply ( core::pose::Pose pose)
overridevirtual

◆ calculate_position_diffs()

utility::vector1< std::pair< core::Size, core::Real > > protocols::simple_moves::SampleSequenceFromProbabilities::calculate_position_diffs ( std::map< core::Size, std::map< core::chemical::AA, core::Real >> &  probabilities,
core::pose::Pose const &  pose 
) const
private

Helper function to calculate differences between current and other AAs, as well as disabling unwanted AAs.

References core::conformation::Residue::aa(), protocols::cluster::calibur::aa, delta_prob_cutoff_, is_aa_allowed_by_task(), prob_cutoff_, core::pose::Pose::residue(), task_factory_, and protocols::simple_moves::TR().

Referenced by sample_positions().

◆ clone()

protocols::moves::MoverOP protocols::simple_moves::SampleSequenceFromProbabilities::clone ( ) const
overridevirtual

required in the context of the parser/scripting scheme

Reimplemented from protocols::moves::Mover.

◆ construct_modified_sequence()

std::string protocols::simple_moves::SampleSequenceFromProbabilities::construct_modified_sequence ( core::pose::Pose pose,
std::map< core::Size, core::chemical::AA > &  mutations 
)
staticprivate

Helper function to return a string of three amino acid letters from the proposed mutations for the SimpleThreadingMover.

References core::conformation::Residue::aa(), protocols::cluster::calibur::aa, core::chemical::name_from_aa(), core::pose::Pose::residue(), and core::pose::Pose::total_residue().

Referenced by apply().

◆ fresh_instance()

protocols::moves::MoverOP protocols::simple_moves::SampleSequenceFromProbabilities::fresh_instance ( ) const
overridevirtual

required in the context of the parser/scripting scheme

Reimplemented from protocols::moves::Mover.

◆ get_name()

std::string protocols::simple_moves::SampleSequenceFromProbabilities::get_name ( ) const
overridevirtual

Each derived class must specify its name. The class name.

Implements protocols::moves::Mover.

References mover_name().

◆ get_ranked_positions()

std::vector< core::Size > protocols::simple_moves::SampleSequenceFromProbabilities::get_ranked_positions ( utility::vector1< std::pair< core::Size, core::Real >> &  position_diffs,
core::pose::Pose const &  pose 
) const
private

Helper function to return positions ranked based on their delta_probability value to the current AA.

References max_mutations_, pos_temp_, core::scoring::rg, core::id::swap(), and core::pose::Pose::total_residue().

Referenced by sample_positions().

◆ is_aa_allowed_by_task()

bool protocols::simple_moves::SampleSequenceFromProbabilities::is_aa_allowed_by_task ( core::pack::task::ResidueLevelTask const &  rlt,
core::chemical::AA  aa 
)
staticprivate

◆ mover_name()

std::string protocols::simple_moves::SampleSequenceFromProbabilities::mover_name ( )
static

◆ parse_my_tag()

void protocols::simple_moves::SampleSequenceFromProbabilities::parse_my_tag ( utility::tag::TagCOP  tag,
basic::datacache::DataMap data 
)
overridevirtual

◆ provide_citation_info()

void protocols::simple_moves::SampleSequenceFromProbabilities::provide_citation_info ( basic::citation_manager::CitationCollectionList &  citations) const
overridevirtual

This mover is unpublished. It returns Moritz Ertelt as its author.

Reimplemented from protocols::moves::Mover.

◆ provide_xml_schema()

void protocols::simple_moves::SampleSequenceFromProbabilities::provide_xml_schema ( utility::tag::XMLSchemaDefinition &  xsd)
static

◆ sample_amino_acid()

core::chemical::AA protocols::simple_moves::SampleSequenceFromProbabilities::sample_amino_acid ( std::map< core::chemical::AA, core::Real > const &  aa_probs) const
private

Helper function to sample an amino acid from a transformed probability distribution.

References aa_temp_, core::kinematics::distance(), and protocols::simple_moves::TR().

Referenced by sample_mutations().

◆ sample_mutations()

std::map< core::Size, core::chemical::AA > protocols::simple_moves::SampleSequenceFromProbabilities::sample_mutations ( std::map< core::Size, std::map< core::chemical::AA, core::Real >> &  values,
core::pose::Pose const &  pose 
) const
private

Main function to sample mutations from a probability distribution.

Creates a discrete distribution based on the delta_prob (curr_AA - max_prob_AA) of each position and draws from that distribution taking into a account the pos_temp_ which controls the randomness. The idea behind this is that positions with the larges disagreement between current AA and predicted AAs will be mutated first. Also checks the probability_cutoff_, delta_probability_cutoff and present TaskOperations and sets probabilities not meeting the requirements to zero. Returns as many positions with their proposed AA as are set through the max_mutation_ option set by the user. The randomness of choice of AA is controlled by the aa_temp_ option.

Parameters
[in]poseUses the pose to get the current residues and check for TaksOps.
[in]valuesThe values of a PerResidueProbabilitiesMetric.
Returns
A map containing positions and their proposed AA drawn from the input probabilities.

References sample_amino_acid(), sample_positions(), and protocols::simple_moves::TR().

Referenced by apply().

◆ sample_positions()

std::vector< core::Size > protocols::simple_moves::SampleSequenceFromProbabilities::sample_positions ( std::map< core::Size, std::map< core::chemical::AA, core::Real >> &  values,
core::pose::Pose const &  pose 
) const
private

Helper function to get the ranked positions based on maximum difference in probabilities.

private methods ///

References calculate_position_diffs(), and get_ranked_positions().

Referenced by sample_mutations().

◆ set_aa_temp()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_aa_temp ( core::Real  aa_temp)

Set the amino acid temperature option.

References aa_temp_.

Referenced by parse_my_tag().

◆ set_delta_prob_cutoff()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_delta_prob_cutoff ( core::Real  delta_prob_cutoff)

Set the delta probability cutoff option.

References delta_prob_cutoff_.

Referenced by parse_my_tag().

◆ set_fail_on_missing_cache()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_fail_on_missing_cache ( bool  fail)

If use_cache is set to false, do we fail if no data is found in the pose? Default True.

References fail_on_missing_cache_.

Referenced by parse_my_tag().

◆ set_max_mutations()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_max_mutations ( core::Size  max_mutations)

Set the maximum number of mutations allowed option.

References max_mutations_.

Referenced by parse_my_tag().

◆ set_metric()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_metric ( core::simple_metrics::PerResidueProbabilitiesMetricCOP  metric)

Set the PerResidueProbabilitiesMetric that will be used to calculate the pseudo-perplexity.

References metric_.

Referenced by parse_my_tag().

◆ set_packing()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_packing ( bool  packing)

Set a bool to define whether we repack.

References packing_.

Referenced by parse_my_tag().

◆ set_pos_temp()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_pos_temp ( core::Real  pos_temp)

Set the positional temperature option.

References pos_temp_.

Referenced by parse_my_tag().

◆ set_prob_cutoff()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_prob_cutoff ( core::Real  prob_cutoff)

Set the probability cutoff option.

References prob_cutoff_.

Referenced by parse_my_tag().

◆ set_task_factory()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_task_factory ( core::pack::task::TaskFactoryOP task_factory)

Set the taskfactory option.

References task_factory_.

Referenced by parse_my_tag().

◆ set_use_cached_data()

void protocols::simple_moves::SampleSequenceFromProbabilities::set_use_cached_data ( bool  use_cache,
std::string const &  prefix = "",
std::string const &  suffix = "" 
)

Set a boolean to attempt to find cached data matching the name/custom_type of the passed in simple_metric. Optionally pass any set prefix/suffix.

This will allow the filter to re-use previously calculated data.

References cache_prefix_, cache_suffix_, protocols::simple_moves::TR(), and use_cache_.

Referenced by parse_my_tag().

◆ show()

void protocols::simple_moves::SampleSequenceFromProbabilities::show ( std::ostream &  output = std::cout) const
overridevirtual

Show the contents of the Mover.

Reimplemented from protocols::moves::Mover.

References protocols::moves::Mover::show().

Referenced by protocols::simple_moves::operator<<().

Member Data Documentation

◆ aa_temp_

core::Real protocols::simple_moves::SampleSequenceFromProbabilities::aa_temp_ = 1.0
private

◆ cache_prefix_

std::string protocols::simple_moves::SampleSequenceFromProbabilities::cache_prefix_
private

Referenced by apply(), and set_use_cached_data().

◆ cache_suffix_

std::string protocols::simple_moves::SampleSequenceFromProbabilities::cache_suffix_
private

Referenced by apply(), and set_use_cached_data().

◆ delta_prob_cutoff_

core::Real protocols::simple_moves::SampleSequenceFromProbabilities::delta_prob_cutoff_ = 0.0
private

◆ fail_on_missing_cache_

bool protocols::simple_moves::SampleSequenceFromProbabilities::fail_on_missing_cache_ = true
private

◆ max_mutations_

core::Size protocols::simple_moves::SampleSequenceFromProbabilities::max_mutations_ = 10000
private

◆ metric_

core::simple_metrics::PerResidueProbabilitiesMetricCOP protocols::simple_moves::SampleSequenceFromProbabilities::metric_ = nullptr
private

Referenced by apply(), and set_metric().

◆ packing_

bool protocols::simple_moves::SampleSequenceFromProbabilities::packing_ = true
private

Referenced by apply(), and set_packing().

◆ pos_temp_

core::Real protocols::simple_moves::SampleSequenceFromProbabilities::pos_temp_ = 1.0
private

◆ prob_cutoff_

core::Real protocols::simple_moves::SampleSequenceFromProbabilities::prob_cutoff_ = 0.0001
private

◆ task_factory_

core::pack::task::TaskFactoryOP protocols::simple_moves::SampleSequenceFromProbabilities::task_factory_
private

◆ use_cache_

bool protocols::simple_moves::SampleSequenceFromProbabilities::use_cache_ = false
private

Referenced by apply(), and set_use_cached_data().


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