![]() |
Rosetta
2021.16
|
NetChargeEnergySetup, a helper class for the NetChargeEnergy energy method that stores all of its setup data. More...
#include <NetChargeEnergySetup.hh>

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::Real > | penalties_ |
| 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... | |
NetChargeEnergySetup, a helper class for the NetChargeEnergy energy method that stores all of its setup data.
| core::scoring::netcharge_energy::NetChargeEnergySetup::NetChargeEnergySetup | ( | ) |
Default constructor for NetChargeEnergySetup.
|
overridedefault |
Default destructor for NetChargeEnergySetup.
|
private |
Do some final checks to ensure that data were loaded properly.
References charge_penalties_range_, desired_charge_, penalties_, report(), and core::scoring::netcharge_energy::TR().
Referenced by initialize_from_file(), initialize_from_file_contents(), and parse_a_penalty_definition().
|
virtual |
Clone: create a copy of this object, and return an owning pointer to the copy.
|
inlineprivate |
Return a constant value for an out-of-bounds behaviour.
Inputs are:
| [in] | before | If 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().
|
inline |
| 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 |
Get tail function name from enum.
References core::scoring::netcharge_energy::tf_constant, core::scoring::netcharge_energy::tf_linear, and core::scoring::netcharge_energy::tf_quadratic.
Referenced by get_tailfunction_from_name(), and report().
| void core::scoring::netcharge_energy::NetChargeEnergySetup::initialize_from_file | ( | std::string const & | filename | ) |
Initialize from a .charge file.
References check_data(), protocols::abinitio::filename(), parse_a_penalty_definition(), reset(), and core::scoring::netcharge_energy::TR().
| 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().
|
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:
| [in] | before | If true, this is beyond the low range of penalty values. If false, we're beyond the high range. |
| [in] | observed | The observed count. |
References protocols::match::upstream::b, charge_penalties_range_, and penalties_.
Referenced by out_of_bounds_func().
|
inlineprivate |
Calculate the out-of-bounds behaviour of the penalty function and return the penalty value.
Inputs are:
| [in] | observed | The observed count. |
| [in] | before | If 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().
|
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().
|
inline |
Look up the penalty given the net charge observed.
References charge_penalties_range_, out_of_bounds_func(), and penalties_.
|
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:
| [in] | before | If true, this is beyond the low range of penalty values. If false, we're beyond the high range. |
| [in] | observed | The 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 | ( | ) |
Reset all data in this data storage object.
References charge_penalties_range_, desired_charge_, penalties_, tailfunctions_, and core::scoring::netcharge_energy::tf_quadratic.
Referenced by initialize_from_file(), and initialize_from_file_contents().
|
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().
|
private |
The desired net charge.
Referenced by check_data(), desired_charge(), parse_a_penalty_definition(), quadratic_out_of_bounds_func(), report(), and reset().
|
private |
Penalties for each residue count (relative to expected).
Referenced by check_data(), const_out_of_bounds_func(), linear_out_of_bounds_func(), parse_a_penalty_definition(), penalty(), quadratic_out_of_bounds_func(), report(), and reset().
|
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().
1.8.7