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::helical_bundle_predict::HBPHelixAssignments Class Reference

A class for storing the helix assignments for a pose. This can represent those proposed from an input file, or those at the current state of a trajectory. More...

#include <HBPHelixAssignments.hh>

Inheritance diagram for protocols::helical_bundle_predict::HBPHelixAssignments:
Inheritance graph
[legend]

Public Member Functions

 HBPHelixAssignments ()
 Default constructor. More...
 
 HBPHelixAssignments (HBPHelixAssignments const &src)
 Copy constructor. More...
 
 ~HBPHelixAssignments () override
 Destructor. More...
 
HBPHelixAssignmentsOP clone () const
 Create a copy of this object and return an owning pointer to the copy. More...
 
HBPHelixAssignmentsoperator= (HBPHelixAssignments const &src)
 Assignment operator. More...
 
void clear ()
 Reset this object. More...
 
void initialize_from_file_contents (std::string const &file_contents)
 Set this object up from the contents of a file. More...
 
bool is_in_helix (core::Size const sequence_index) const
 Given a sequence index, determine whether it is in a helix. More...
 
bool try_nucleating_helix (core::Size const seqpos, core::pose::Pose const &pose, HBPHelixAssignments const &reference_helix_assignments)
 Roll a die and decide whether to nucleate a helix at the present position. More...
 
bool try_elongating_helix (core::Size const seqpos, core::pose::Pose const &pose, HBPHelixAssignments const &reference_helix_assignments)
 Roll a die and decide whether to elongate a helix at the present position. More...
 
bool try_retracting_helix (core::Size const seqpos, core::pose::Pose const &pose, HBPHelixAssignments const &reference_helix_assignments)
 Roll a die and decide whether to contract a helix at the present position. More...
 
bool try_perturbing_global_helix_parameters ()
 Try perturbing the parameters for all helices. More...
 
bool try_perturbing_local_helix_parameters ()
 Try perturbing the parameters of individual helices, that are not set to copy globals. More...
 
bool confine_to_user_defined_helices () const
 Are we supposed to keep sampled helices within the user-defined ranges? More...
 
bool generate_torsion_values_for_helices (utility::vector1< std::map< core::id::TorsionID, core::Real > > &torsion_values_out, core::pose::Pose const &pose_for_reference) const
 Generate a map of torsion ID -> torsion value for each helix, and return a vector of these maps. More...
 
core::Size get_containing_helix_index (core::Size const seqpos) const
 Given a sequence position, get the helix index that contains it. More...
 

Private Member Functions

HBPHelixOP helix_from_seqpos (core::Size const position)
 Get a nonconst owning pointer to the helix containing a given sequence position. More...
 
HBPHelixCOP helix_from_seqpos (core::Size const position) const
 Get a const owning pointer to the helix containing a given sequence position. More...
 
HBPHelixOP find_adjacent_helix (core::Size seqpos)
 Loop through all helices and find a helix that this sequence position is adjacent to. More...
 
bool helix_types_match (HBPHelix const &first_helix, HBPHelix const &second_helix) const
 Are two helices of the same type? More...
 
void check_for_helix_merges (HBPHelixCOP const current_helix=nullptr)
 Check whether the addition or elongation of current_helix causes a new contiguous stretch of helix, and if so, replace helix records in the helices_ list with a single contiguous helix. More...
 
void merge_helices (core::Size const first_helix_index, core::Size const second_helix_index, HBPHelixCOP const current_helix=nullptr)
 Merge two helices together. More...
 
void resolve_mismatching_helix_overlap (core::Size const helix1_index, core::Size const helix2_index)
 Given two overlapping helices of different types, prevent them from overlapping. More...
 
void pull_out_global_block (std::string const &file_contents, std::string &global_block) const
 Given file contents, pull out the first BEGIN_GLOBALS...END_GLOBALS block, and throw an error message if any other occurrences of this exist in the file. More...
 
void initialize_global_options_from_file_contents (std::string const &file_contents)
 Read the BEGIN_GLOBALS...END_GLOBALS block in the file contents and set up global options. More...
 
void pull_out_helix_blocks (std::string const &file_contents, utility::vector1< std::string > &helix_blocks) const
 Given file contents, pull out all of the stuff in between the BEGIN_HELIX and END_HELIX lines. More...
 
void initialize_helices_from_file_contents (std::string const &file_contents)
 Read BEGIN_HELIX...END_HELIX blocks in the file contents and set up local helix options. More...
 
HBPHelixOP add_helix ()
 Add a helix and return an owning pointer to it. More...
 
HBPHelixOP add_helix (core::Size const startpos, core::Size const endpos, HBPHelix const &reference_helix)
 Add a helix and return an owning pointer to it, initializing its start, end, and parameters. More...
 
void remove_helix (HBPHelixOP helix_to_remove)
 Remove a helix. More...
 

Private Attributes

utility::vector1< HBPHelixOPhelices_
 Stored helices. More...
 
protocols::helical_bundle::BundleParametrizationCalculatorOP global_bundle_calculator_
 A calculator object for the Crick equations. More...
 
bool common_r0_
 Is r0 shared among all helices? More...
 
bool common_omega0_
 Is omega0 shared among all helices? More...
 
bool common_delta_omega1_
 Is delta_omega1 shared among all helices? More...
 
bool confine_to_user_defined_helices_
 Prevent expansion of helices beyond user-defined helices? More...
 
core::Real global_r0_min_
 Global min setting for r0. Can be overridden in individual helices. More...
 
core::Real global_r0_max_
 Global max setting for r0. Can be overridden in individual helices. More...
 
core::Real global_omega0_min_
 Global min setting for omega0. Can be overridden in individual helices. More...
 
core::Real global_omega0_max_
 Global max setting for omega0. Can be overridden in individual helices. More...
 
core::Real global_delta_omega1_min_
 Global min setting for delta_omega1. Can be overridden in individual helices. More...
 
core::Real global_delta_omega1_max_
 Global max setting for delta_omega1. Can be overridden in individual helices. More...
 
std::string global_crick_params_file_
 The global Crick parameters file name. More...
 
core::Real nucleation_prob_
 Probability of nucleating a helix. More...
 
core::Real extension_prob_
 Probability of extending a helix. More...
 
core::Real retraction_prob_
 Probability of retracting a helix. More...
 
core::Real global_perturbation_prob_
 The probability of doing a global Crick parameter perturbation move. More...
 
core::Real global_fractional_perturbation_magnitude_
 The magnitude of parameter perturbations. More...
 

Friends

class ::HBPHelixAssignmentsTests
 

Detailed Description

A class for storing the helix assignments for a pose. This can represent those proposed from an input file, or those at the current state of a trajectory.

Author
Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org).

Constructor & Destructor Documentation

protocols::helical_bundle_predict::HBPHelixAssignments::HBPHelixAssignments ( )

Default constructor.

References clear().

protocols::helical_bundle_predict::HBPHelixAssignments::HBPHelixAssignments ( HBPHelixAssignments const &  src)

Copy constructor.

Note explicit deep-copy.

References global_bundle_calculator_, and helices_.

protocols::helical_bundle_predict::HBPHelixAssignments::~HBPHelixAssignments ( )
override

Destructor.

Member Function Documentation

HBPHelixOP protocols::helical_bundle_predict::HBPHelixAssignments::add_helix ( )
private
HBPHelixOP protocols::helical_bundle_predict::HBPHelixAssignments::add_helix ( core::Size const  startpos,
core::Size const  endpos,
HBPHelix const &  reference_helix 
)
private

Add a helix and return an owning pointer to it, initializing its start, end, and parameters.

Parameters are initialized from reference_helix.

References helices_.

void protocols::helical_bundle_predict::HBPHelixAssignments::check_for_helix_merges ( HBPHelixCOP const  current_helix = nullptr)
private

Check whether the addition or elongation of current_helix causes a new contiguous stretch of helix, and if so, replace helix records in the helices_ list with a single contiguous helix.

When helices are merged, the helix contributing parameters is chosen randomly. If current_helix is not nullptr, then we do not allow that helix to contribute the parameters – i.e. they are chosen randomly from one of the other helices, or we just use the other helix if there's only one.

References helices_, helix_types_match(), merge_helices(), and resolve_mismatching_helix_overlap().

Referenced by try_elongating_helix(), and try_nucleating_helix().

void protocols::helical_bundle_predict::HBPHelixAssignments::clear ( )
HBPHelixAssignmentsOP protocols::helical_bundle_predict::HBPHelixAssignments::clone ( ) const

Create a copy of this object and return an owning pointer to the copy.

bool protocols::helical_bundle_predict::HBPHelixAssignments::confine_to_user_defined_helices ( ) const
inline

Are we supposed to keep sampled helices within the user-defined ranges?

References confine_to_user_defined_helices_.

Referenced by try_elongating_helix(), and try_nucleating_helix().

HBPHelixOP protocols::helical_bundle_predict::HBPHelixAssignments::find_adjacent_helix ( core::Size  seqpos)
private

Loop through all helices and find a helix that this sequence position is adjacent to.

. If the position is adjacent to no helix, returns nullptr. If the position is adjacent to two helices (i.e. it bridges two helices separated by one residue), we pick one with 50/50 odds.

References helices_, and is_in_helix().

Referenced by try_elongating_helix().

bool protocols::helical_bundle_predict::HBPHelixAssignments::generate_torsion_values_for_helices ( utility::vector1< std::map< core::id::TorsionID, core::Real > > &  torsion_values_out,
core::pose::Pose const &  pose_for_reference 
) const

Generate a map of torsion ID -> torsion value for each helix, and return a vector of these maps.

Returns
True for FAILURE, false for success.

References helices_.

Referenced by protocols::helical_bundle_predict::HBP_HelixCoilMoveGenerator::add_helix_update_moves().

core::Size protocols::helical_bundle_predict::HBPHelixAssignments::get_containing_helix_index ( core::Size const  seqpos) const

Given a sequence position, get the helix index that contains it.

Returns zero if no helix contains this sequence position.

References helices_.

Referenced by protocols::helical_bundle_predict::HBP_HelixCoilMoveGenerator::add_helix_update_moves().

HBPHelixOP protocols::helical_bundle_predict::HBPHelixAssignments::helix_from_seqpos ( core::Size const  position)
private

Get a nonconst owning pointer to the helix containing a given sequence position.

Returns nullptr if no helix contains that sequence position.

References helices_.

Referenced by try_nucleating_helix(), and try_retracting_helix().

HBPHelixCOP protocols::helical_bundle_predict::HBPHelixAssignments::helix_from_seqpos ( core::Size const  position) const
private

Get a const owning pointer to the helix containing a given sequence position.

Returns nullptr if no helix contains that sequence position.

References helices_.

bool protocols::helical_bundle_predict::HBPHelixAssignments::helix_types_match ( HBPHelix const &  first_helix,
HBPHelix const &  second_helix 
) const
private

Are two helices of the same type?

References protocols::helical_bundle_predict::HBPHelix::crick_params_filename().

Referenced by check_for_helix_merges().

void protocols::helical_bundle_predict::HBPHelixAssignments::initialize_from_file_contents ( std::string const &  file_contents)

Set this object up from the contents of a file.

Warning! Reads Crick params files from disk!

References clear(), initialize_global_options_from_file_contents(), and initialize_helices_from_file_contents().

Referenced by protocols::helical_bundle_predict::HBP_HelixCoilMoveGenerator::set_up_user_helix_assignments().

void protocols::helical_bundle_predict::HBPHelixAssignments::initialize_global_options_from_file_contents ( std::string const &  file_contents)
private
void protocols::helical_bundle_predict::HBPHelixAssignments::initialize_helices_from_file_contents ( std::string const &  file_contents)
private

Read BEGIN_HELIX...END_HELIX blocks in the file contents and set up local helix options.

Warning! Triggers read from disk if Crick params file is set.

References add_helix(), common_delta_omega1_, common_omega0_, common_r0_, pull_out_helix_blocks(), and protocols::hybridization::val.

Referenced by initialize_from_file_contents().

bool protocols::helical_bundle_predict::HBPHelixAssignments::is_in_helix ( core::Size const  sequence_index) const
void protocols::helical_bundle_predict::HBPHelixAssignments::merge_helices ( core::Size const  first_helix_index,
core::Size const  second_helix_index,
HBPHelixCOP const  current_helix = nullptr 
)
private

Merge two helices together.

If current_helix is not nullptr, then we randomly pick one of the two helices to provide the parameters. If current_helix is nullptr and it matches one of the two helices, then the other provides the parameters.

References add_helix(), helices_, protocols::mean_field::max(), protocols::mean_field::min(), and remove_helix().

Referenced by check_for_helix_merges().

HBPHelixAssignments & protocols::helical_bundle_predict::HBPHelixAssignments::operator= ( HBPHelixAssignments const &  src)
void protocols::helical_bundle_predict::HBPHelixAssignments::pull_out_global_block ( std::string const &  file_contents,
std::string &  global_block 
) const
private

Given file contents, pull out the first BEGIN_GLOBALS...END_GLOBALS block, and throw an error message if any other occurrences of this exist in the file.

Omits the BEGIN_GLOBALS and END_GLOBALS lines.

Referenced by initialize_global_options_from_file_contents().

void protocols::helical_bundle_predict::HBPHelixAssignments::pull_out_helix_blocks ( std::string const &  file_contents,
utility::vector1< std::string > &  helix_blocks 
) const
private

Given file contents, pull out all of the stuff in between the BEGIN_HELIX and END_HELIX lines.

Omits the BEGIN_HELIX and END_HELIX lines.

Referenced by initialize_helices_from_file_contents().

void protocols::helical_bundle_predict::HBPHelixAssignments::remove_helix ( HBPHelixOP  helix_to_remove)
private

Remove a helix.

References helices_.

Referenced by merge_helices(), resolve_mismatching_helix_overlap(), and try_retracting_helix().

void protocols::helical_bundle_predict::HBPHelixAssignments::resolve_mismatching_helix_overlap ( core::Size const  helix1_index,
core::Size const  helix2_index 
)
private

Given two overlapping helices of different types, prevent them from overlapping.

The cutoff point is randomly chosen within the overlap region.

References helices_, and remove_helix().

Referenced by check_for_helix_merges().

bool protocols::helical_bundle_predict::HBPHelixAssignments::try_elongating_helix ( core::Size const  seqpos,
core::pose::Pose const &  pose,
HBPHelixAssignments const &  reference_helix_assignments 
)

Roll a die and decide whether to elongate a helix at the present position.

If we do it, then we add one residue to the helix (updating the helices_ list). The probabilities for elongation are taken from the adjacent helix.

Note
Does nothing if the present position is not adjacent to a helix. Automatically merges helices if the present position bridges two helices, and we decide to elongate. In this case, the parameters of one helix are randomly chosen as the parameters to keep.
Returns
True if we elongated here, false otherwise.

References check_for_helix_merges(), confine_to_user_defined_helices(), find_adjacent_helix(), and is_in_helix().

Referenced by protocols::helical_bundle_predict::HBP_HelixCoilMoveGenerator::add_helix_elongation_moves().

bool protocols::helical_bundle_predict::HBPHelixAssignments::try_nucleating_helix ( core::Size const  seqpos,
core::pose::Pose const &  pose,
HBPHelixAssignments const &  reference_helix_assignments 
)

Roll a die and decide whether to nucleate a helix at the present position.

If we do it, then we add one turn of helix as a new helix (updating the helices_ list), and we copy helix parameters from reference_helix_assignments. The probabilities for nucleation are taken from reference_helix_assignments.

Note
Automatically merges helices if the set of residues in question overlaps with another helix. In this case, the parameters of the other helix are chosen as the parameters to keep.
Returns
True if we nucleated here, false otherwise.

If we do it, then we add one turn of helix as a new helix (updating the helices_ list), and we copy helix paramters from reference_helix_assignments. The probabilities for nucleation are taken from reference_helix_assignments.

Returns
True if we nucleated here, false otherwise.

References add_helix(), protocols::helical_bundle::BPC_delta_omega1, protocols::helical_bundle::BPC_omega0, protocols::helical_bundle::BPC_r0, check_for_helix_merges(), common_delta_omega1_, common_omega0_, common_r0_, confine_to_user_defined_helices(), helix_from_seqpos(), is_in_helix(), and core::pose::Pose::total_residue().

Referenced by protocols::helical_bundle_predict::HBP_HelixCoilMoveGenerator::add_helix_nucleation_moves().

bool protocols::helical_bundle_predict::HBPHelixAssignments::try_perturbing_global_helix_parameters ( )
bool protocols::helical_bundle_predict::HBPHelixAssignments::try_perturbing_local_helix_parameters ( )
bool protocols::helical_bundle_predict::HBPHelixAssignments::try_retracting_helix ( core::Size const  seqpos,
core::pose::Pose const &  pose,
HBPHelixAssignments const &  reference_helix_assignments 
)

Roll a die and decide whether to contract a helix at the present position.

If we do it, then we subtract one residue from the helix (updating the helices_ list). The probabilities for retraction are taken from the adjacent helix. If the helix shrinks to zero size, then we remove it from the helices_ list.

Note
Does nothing if the present position is not at one of the ends of a helix.
Returns
True if we retracted here, false otherwise.

References helix_from_seqpos(), is_in_helix(), and remove_helix().

Referenced by protocols::helical_bundle_predict::HBP_HelixCoilMoveGenerator::add_helix_retraction_moves().

Friends And Related Function Documentation

friend class ::HBPHelixAssignmentsTests
friend

Member Data Documentation

bool protocols::helical_bundle_predict::HBPHelixAssignments::common_delta_omega1_
private
bool protocols::helical_bundle_predict::HBPHelixAssignments::common_omega0_
private
bool protocols::helical_bundle_predict::HBPHelixAssignments::common_r0_
private
bool protocols::helical_bundle_predict::HBPHelixAssignments::confine_to_user_defined_helices_
private

Prevent expansion of helices beyond user-defined helices?

True by default.

Referenced by clear(), confine_to_user_defined_helices(), initialize_global_options_from_file_contents(), and operator=().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::extension_prob_
private

Probability of extending a helix.

Defaults to 5%

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), and operator=().

protocols::helical_bundle::BundleParametrizationCalculatorOP protocols::helical_bundle_predict::HBPHelixAssignments::global_bundle_calculator_
private
std::string protocols::helical_bundle_predict::HBPHelixAssignments::global_crick_params_file_
private

The global Crick parameters file name.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), and operator=().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_delta_omega1_max_
private

Global max setting for delta_omega1. Can be overridden in individual helices.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), operator=(), and try_perturbing_global_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_delta_omega1_min_
private

Global min setting for delta_omega1. Can be overridden in individual helices.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), operator=(), and try_perturbing_global_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_fractional_perturbation_magnitude_
private

The magnitude of parameter perturbations.

This is expressed as a fraction of the difference between the minimum and maximum parameter values. The actual magnitude of perturbation is a random Gaussian times this value.

Referenced by clear(), initialize_global_options_from_file_contents(), operator=(), try_perturbing_global_helix_parameters(), and try_perturbing_local_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_omega0_max_
private

Global max setting for omega0. Can be overridden in individual helices.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), operator=(), and try_perturbing_global_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_omega0_min_
private

Global min setting for omega0. Can be overridden in individual helices.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), operator=(), and try_perturbing_global_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_perturbation_prob_
private

The probability of doing a global Crick parameter perturbation move.

Referenced by clear(), initialize_global_options_from_file_contents(), operator=(), try_perturbing_global_helix_parameters(), and try_perturbing_local_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_r0_max_
private

Global max setting for r0. Can be overridden in individual helices.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), operator=(), and try_perturbing_global_helix_parameters().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::global_r0_min_
private

Global min setting for r0. Can be overridden in individual helices.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), operator=(), and try_perturbing_global_helix_parameters().

utility::vector1< HBPHelixOP > protocols::helical_bundle_predict::HBPHelixAssignments::helices_
private
core::Real protocols::helical_bundle_predict::HBPHelixAssignments::nucleation_prob_
private

Probability of nucleating a helix.

Defaults to 1%.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), and operator=().

core::Real protocols::helical_bundle_predict::HBPHelixAssignments::retraction_prob_
private

Probability of retracting a helix.

Defaults to 3%.

Referenced by add_helix(), clear(), initialize_global_options_from_file_contents(), and operator=().


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