Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
core::scoring::netcharge_energy::NetChargeEnergySetup Class Reference

NetChargeEnergySetup, a helper class for the NetChargeEnergy energy method that stores all of its setup data. More...

#include <NetChargeEnergySetup.hh>

Inheritance diagram for core::scoring::netcharge_energy::NetChargeEnergySetup:
Inheritance graph
[legend]

Public Member Functions

 NetChargeEnergySetup ()
 Default constructor for NetChargeEnergySetup. More...
 
 ~NetChargeEnergySetup () override
 Default destructor for NetChargeEnergySetup. More...
 
virtual NetChargeEnergySetupOP clone () const
 Clone: create a copy of this object, and return an owning pointer to the copy. More...
 
void reset ()
 Reset all data in this data storage object. More...
 
void initialize_from_file (std::string const &filename)
 Initialize from a .charge file. More...
 
void initialize_from_file_contents (std::string const &filecontents)
 Initialize from a string in the format of a .charge file. More...
 
std::string get_tailfunction_name (TailFunction const tf) const
 Get tail function name from enum. More...
 
TailFunction get_tailfunction_from_name (std::string const &name) const
 Get tail function enum from name. More...
 
unsigned long int desired_charge () const
 Get the desired charge. More...
 
core::Real penalty (signed long const observed) const
 Look up the penalty given the net charge observed. More...
 
std::string report () const
 Get a summary of the data stored in this object. More...
 

Private Member Functions

void parse_a_penalty_definition (utility::vector1< std::string > const &lines)
 Parse out penalty definition from a single block of lines from file. More...
 
void check_data () const
 Do some final checks to ensure that data were loaded properly. More...
 
core::Real out_of_bounds_func (signed long const observed, bool const before) const
 Calculate the out-of-bounds behaviour of the penalty function and return the penalty value. More...
 
core::Real const_out_of_bounds_func (bool const before) const
 Return a constant value for an out-of-bounds behaviour. More...
 
core::Real linear_out_of_bounds_func (bool const before, signed long const observed) const
 Return a linear value for an out-of-bounds behaviour. More...
 
core::Real quadratic_out_of_bounds_func (bool const before, signed long const observed) const
 Return a quadratic value for an out-of-bounds behaviour. More...
 

Private Attributes

signed long int desired_charge_
 The desired net charge. More...
 
std::pair< signed long int,
signed long int > 
charge_penalties_range_
 The lower and upper ends of the charge range specified in the penalties. More...
 
utility::vector1< core::Realpenalties_
 Penalties for each residue count (relative to expected). More...
 
std::pair< TailFunction,
TailFunction
tailfunctions_
 The behaviours at the end of the user-defined range. More...
 

Detailed Description

NetChargeEnergySetup, a helper class for the NetChargeEnergy energy method that stores all of its setup data.

Constructor & Destructor Documentation

core::scoring::netcharge_energy::NetChargeEnergySetup::NetChargeEnergySetup ( )

Default constructor for NetChargeEnergySetup.

core::scoring::netcharge_energy::NetChargeEnergySetup::~NetChargeEnergySetup ( )
overridedefault

Default destructor for NetChargeEnergySetup.

Member Function Documentation

void core::scoring::netcharge_energy::NetChargeEnergySetup::check_data ( ) const
private
NetChargeEnergySetupOP core::scoring::netcharge_energy::NetChargeEnergySetup::clone ( ) const
virtual

Clone: create a copy of this object, and return an owning pointer to the copy.

core::Real core::scoring::netcharge_energy::NetChargeEnergySetup::const_out_of_bounds_func ( bool const  before) const
inlineprivate

Return a constant value for an out-of-bounds behaviour.

Inputs are:

Parameters
[in]beforeIf true, this is beyond the low range of penalty values. If false, we're beyond the high range.

References penalties_.

Referenced by out_of_bounds_func().

unsigned long int core::scoring::netcharge_energy::NetChargeEnergySetup::desired_charge ( ) const
inline

Get the desired charge.

References desired_charge_.

Referenced by parse_a_penalty_definition().

TailFunction core::scoring::netcharge_energy::NetChargeEnergySetup::get_tailfunction_from_name ( std::string const &  name) const

Get tail function enum from name.

This is slow; it calls get_tailfunction_name repeatedly. Intended only for use during setup. Returns tf_unknown if tail function couldn't be parsed.

References get_tailfunction_name(), core::scoring::netcharge_energy::tf_end_of_list, and core::scoring::netcharge_energy::tf_unknown.

Referenced by parse_a_penalty_definition().

std::string core::scoring::netcharge_energy::NetChargeEnergySetup::get_tailfunction_name ( TailFunction const  tf) const
void core::scoring::netcharge_energy::NetChargeEnergySetup::initialize_from_file ( std::string const &  filename)
void core::scoring::netcharge_energy::NetChargeEnergySetup::initialize_from_file_contents ( std::string const &  filecontents)

Initialize from a string in the format of a .charge file.

Allows external code to initialize object without having it read directly from disk.

References check_data(), parse_a_penalty_definition(), reset(), and core::scoring::netcharge_energy::TR().

core::Real core::scoring::netcharge_energy::NetChargeEnergySetup::linear_out_of_bounds_func ( bool const  before,
signed long const  observed 
) const
inlineprivate

Return a linear value for an out-of-bounds behaviour.

This fits the first two or last two points to a straight line, then extends it. Inputs are:

Parameters
[in]beforeIf true, this is beyond the low range of penalty values. If false, we're beyond the high range.
[in]observedThe observed count.

References protocols::match::upstream::b, charge_penalties_range_, and penalties_.

Referenced by out_of_bounds_func().

core::Real core::scoring::netcharge_energy::NetChargeEnergySetup::out_of_bounds_func ( signed long const  observed,
bool const  before 
) const
inlineprivate

Calculate the out-of-bounds behaviour of the penalty function and return the penalty value.

Inputs are:

Parameters
[in]observedThe observed count.
[in]beforeIf true, this is beyond the low range of penalty values. If false, we're beyond the high range.

References const_out_of_bounds_func(), linear_out_of_bounds_func(), quadratic_out_of_bounds_func(), tailfunctions_, core::scoring::netcharge_energy::tf_constant, core::scoring::netcharge_energy::tf_linear, core::scoring::netcharge_energy::tf_quadratic, and core::scoring::netcharge_energy::tf_unknown.

Referenced by penalty().

void core::scoring::netcharge_energy::NetChargeEnergySetup::parse_a_penalty_definition ( utility::vector1< std::string > const &  lines)
private

Parse out penalty definition from a single block of lines from file.

The lines vector should be the lines BETWEEN the PENALTY_DEFINITION and END_PENALTY_DEFINITION lines.

References charge_penalties_range_, check_data(), desired_charge(), desired_charge_, get_tailfunction_from_name(), penalties_, tailfunctions_, core::scoring::netcharge_energy::tf_quadratic, and core::scoring::netcharge_energy::tf_unknown.

Referenced by initialize_from_file(), and initialize_from_file_contents().

core::Real core::scoring::netcharge_energy::NetChargeEnergySetup::penalty ( signed long const  observed) const
inline

Look up the penalty given the net charge observed.

References charge_penalties_range_, out_of_bounds_func(), and penalties_.

core::Real core::scoring::netcharge_energy::NetChargeEnergySetup::quadratic_out_of_bounds_func ( bool const  before,
signed long const  observed 
) const
inlineprivate

Return a quadratic value for an out-of-bounds behaviour.

This fits the first two or the last two values to a parabola centred on the origin, then extends it. Inputs are:

Parameters
[in]beforeIf true, this is beyond the low range of penalty values. If false, we're beyond the high range.
[in]observedThe observed count.

References core::pose::motif::a(), protocols::match::upstream::b, charge_penalties_range_, desired_charge_, and penalties_.

Referenced by out_of_bounds_func().

std::string core::scoring::netcharge_energy::NetChargeEnergySetup::report ( ) const

Get a summary of the data stored in this object.

References charge_penalties_range_, desired_charge_, get_tailfunction_name(), penalties_, and tailfunctions_.

Referenced by check_data().

void core::scoring::netcharge_energy::NetChargeEnergySetup::reset ( )

Member Data Documentation

std::pair< signed long int, signed long int > core::scoring::netcharge_energy::NetChargeEnergySetup::charge_penalties_range_
private

The lower and upper ends of the charge range specified in the penalties.

Referenced by check_data(), linear_out_of_bounds_func(), parse_a_penalty_definition(), penalty(), quadratic_out_of_bounds_func(), report(), and reset().

signed long int core::scoring::netcharge_energy::NetChargeEnergySetup::desired_charge_
private
utility::vector1< core::Real > core::scoring::netcharge_energy::NetChargeEnergySetup::penalties_
private
std::pair<TailFunction, TailFunction > core::scoring::netcharge_energy::NetChargeEnergySetup::tailfunctions_
private

The behaviours at the end of the user-defined range.

By default, past the user-defined range, the energy increases quadratically with increasing deviations from ideal sequence composition. The user can set this to be linear or constant, though.

Referenced by out_of_bounds_func(), parse_a_penalty_definition(), report(), and reset().


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