Skip to content

Commit

Permalink
Merge pull request #2165 from RosettaCommons/aleaverfay/npd_hbond
Browse files Browse the repository at this point in the history
Fix off-rotamer-packer bugs w/ LK_Ball term

Old repository SHA1: ba51e675f75aa8b96e1b9e48a27269bced1d6f02

Co-authored-by: Jack Maguire <[email protected]>
  • Loading branch information
aleaverfay and Jack Maguire authored Apr 12, 2017
1 parent 86edc70 commit 7f15b0e
Show file tree
Hide file tree
Showing 88 changed files with 10,954 additions and 370 deletions.
25 changes: 9 additions & 16 deletions source/code_templates/src/task_operation/TaskOp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
#include <--path--/--class--Creator.hh>

#include <core/pack/task/operation/TaskOperation.hh>
#include <core/pack/task/operation/TaskOperations.hh>
#include <core/pack/task/operation/task_op_schemas.hh>
#include <core/pack/task/PackerTask.hh>
#include <core/pose/Pose.hh>

#include <basic/Tracer.hh>

// Utility headers
#include <utility/tag/Tag.hh>
#include <utility/tag/XMLSchemaGeneration.hh>


static THREAD_LOCAL basic::Tracer TR( "--namespace_dot--.--class--" );
Expand Down Expand Up @@ -57,7 +60,7 @@ void


void
--class--::apply( const core::pose::Pose& pose, core::pack::task::PackerTask& ) const {
--class--::apply( core::pose::Pose const & pose, core::pack::task::PackerTask & ) const {


}
Expand All @@ -68,8 +71,10 @@ std::string
}

void
--class--::provide_xml_schema( XMLSchemaDefinition & xsd )
--class--::provide_xml_schema( utility::tag::XMLSchemaDefinition & xsd )
{
using namespace utility::tag;

}

core::pack::task::operation::TaskOperationOP
Expand All @@ -85,22 +90,10 @@ std::string
}

void
--class--Creator::provide_xml_schema( XMLSchemaDefinition & xsd )
--class--Creator::provide_xml_schema( utility::tag::XMLSchemaDefinition & xsd ) const
{
--class--::provide_xml_schema( xsd );
}





--end_namespace--









5 changes: 3 additions & 2 deletions source/code_templates/src/task_operation/TaskOp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

// Utility headers
#include <utility/tag/Tag.fwd.hh>
#include <utility/tag/XMLSchemaGeneration.fwd.hh>

--namespace--

Expand All @@ -35,7 +36,7 @@ public:
~--class--() override;

core::pack::task::operation::TaskOperationOP
clone() const;
clone() const override;

/// @brief Configure from a RosettaScripts XML tag.
void
Expand All @@ -52,7 +53,7 @@ public:
static std::string keyname();

/// @brief Describe the format of XML file used to initialize this TaskOperation
static void provide_xml_schema( XMLSchemaDefinition & xsd );
static void provide_xml_schema( utility::tag::XMLSchemaDefinition & xsd );

private:

Expand Down
12 changes: 6 additions & 6 deletions source/code_templates/src/task_operation/TaskOpCreator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
// (c) addressed to University of Washington CoMotion, email: [email protected].

/// @file --path--/--class--.cc
/// @brief --brief--
/// @file --path--/--class--.cc
/// @brief Creator for --brief--
/// @author --name-- (--email--)

+#ifndef INCLUDED_--path_underscore--_--class--_hh
+#define INCLUDED_--path_underscore--_--class--_hh
#ifndef INCLUDED_--path_underscore--_--class--Creator_HH
#define INCLUDED_--path_underscore--_--class--Creator_HH

#include <core/pack/task/operation/TaskOperationCreator.hh>

Expand All @@ -25,12 +25,12 @@ class --class--Creator : public core::pack::task::operation::TaskOperationCreato
public:
core::pack::task::operation::TaskOperationOP create_task_operation() const override;
std::string keyname() const override;
void provide_xml_schema( XMLSchemaDefinition & xsd ) override;
void provide_xml_schema( utility::tag::XMLSchemaDefinition & xsd ) const override;
};



--end_namespace--


#endif //INCLUDED_--path--_--class--_hh
#endif //INCLUDED_--path--_--class--Creator_HH
4 changes: 3 additions & 1 deletion source/src/basic/options/options_rosetta.py
Original file line number Diff line number Diff line change
Expand Up @@ -6260,6 +6260,7 @@
Option( 'no_hb_env_dependence', 'Boolean', desc='Disable environmental dependent weighting of hydrogen bond terms'),
Option( 'no_hb_env_dependence_DNA', 'Boolean', desc='Disable environmental dependent weighting of hydrogen bonds involving DNA'),
Option( 'optE_no_protein_fa_elec', 'Boolean', desc='Instruct the IterativeOptEDriver to use the soft-repulsion etable', default='false' ),
Option( 'include_intra_res_protein', 'Boolean', desc='Instruct the IterativeOptEDriver to turn on intra-residue interactions (needed for BetaNov15 score function)', default='false' ),
Option( 'centroid_rot', 'Boolean', desc='Use CENTROID_ROT vdw radii', default='false' ),
Option( 'centroid_rot_min', 'Boolean', desc='Use CENTROID_ROT_MIN vdw radii', default='false' ),
Option( 'design_first', 'Boolean', desc='Do not optimize the weights in the context of the native structure, but rather, start by designing the protein with the input weight set. Requires that all score types listed in -optE::free have specificed weights.'),
Expand Down Expand Up @@ -6305,7 +6306,8 @@
Option( 'fit_reference_energies_to_aa_profile_recovery', 'Boolean', desc='In the inner-loop sequence recovery/weight tweaking stage, accept/reject weight sets based on both the sequence recovery rate, and the mutual information between the expected and observed amino acid frequency distributions'),
Option( 'starting_refEs', 'File', desc='IterativeOptEDriver flag: specify a weights file to read reference energies from; do not optimize reference energies in the first round of weight fitting'),
Option( 'repeat_swarm_optimization_until_fitness_improves', 'Boolean', desc='After the first time though the particle swarm optimization phase, if the end fitness is not better than the start fitness, recreate the swarm around the start dofs and repeat the swarm optimization.', default='false'),
Option( 'design_with_minpack', 'Boolean', desc='Use the min-packer to design in the sequence recovery stages.', default='false'),
Option( 'design_with_minpack', 'Boolean', desc='Use the min-packer to design during the sequence recovery stages.', default='false'),
Option( 'design_with_offrotpack', 'Boolean', desc='Use the off-rotamer-packer to design during the sequence recovery stages.', default='false'),
Option( 'limit_bad_scores', 'Boolean', desc='Quit after 100,000 inf or NaN errors in optE objective function'),
Option('no_design_pdb_output','Boolean',desc='Do not write out the designed pdbs to the workdir_ directories over the course of the optE run'),
Option_Group( 'rescore',
Expand Down
2 changes: 2 additions & 0 deletions source/src/core.3.src.settings
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ sources = {
"hbonds_geom",
"HBondSet",
"HBondTypeManager",
"NPDHBondSet",
"NPDHBondEnergy",
"polynomial",
"types",
],
Expand Down
3 changes: 3 additions & 0 deletions source/src/core.4.src.settings
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ sources = {
"InteractionGraphFactory",
"LazyInteractionGraph",
"LinearMemoryInteractionGraph",
"NPDHBondInteractionGraph",
"NPDHBSimpleInteractionGraph",
"MultiplexedAnnealableGraph",
"OnTheFlyInteractionGraph",
"PDInteractionGraph",
Expand Down Expand Up @@ -163,6 +165,7 @@ sources = {
"RNA_ResidueLevelTask",
],
"core/pack/task/operation": [
"EnableMultiCoolAnnealer",
"NoRepackDisulfides",
"OperateOnCertainResidues",
"OperateOnResidueSubset",
Expand Down
4 changes: 4 additions & 0 deletions source/src/core/init/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <core/scoring/etable/EtableEnergyCreator.hh>

#include <core/scoring/hbonds/HBondEnergyCreator.hh>
#include <core/scoring/hbonds/NPDHBondEnergyCreator.hh>
#include <core/scoring/methods/EnergyMethodRegistrator.hh>
#include <core/scoring/methods/AspartimidePenaltyEnergyCreator.hh>
#include <core/scoring/methods/CenPairEnergyCreator.hh>
Expand Down Expand Up @@ -253,6 +254,7 @@
// for registering TaskOperations, ResLvlTaskOperations, and ResFilters
#include <core/pack/task/operation/TaskOperationRegistrator.hh>
#include <core/pack/task/operation/TaskOperationCreators.hh>
#include <core/pack/task/operation/EnableMultiCoolAnnealerCreator.hh>
#include <core/pack/task/operation/OperateOnCertainResiduesCreator.hh>
#include <core/pack/task/operation/OperateOnResidueSubsetCreator.hh>
#include <core/pack/task/operation/NoRepackDisulfidesCreator.hh>
Expand Down Expand Up @@ -383,6 +385,7 @@ static EnergyMethodRegistrator< scoring::disulfides::FullatomDisulfideEnergyCrea
static EnergyMethodRegistrator< scoring::etable::EtableEnergyCreator > EtableEnergyCreator_registrator;
static EnergyMethodRegistrator< scoring::etable::EtableClassicIntraEnergyCreator > EtableClassicIntraEnergyCreator_registrator;
static EnergyMethodRegistrator< scoring::hbonds::HBondEnergyCreator > HBondEnergyCreator_registrator;
static EnergyMethodRegistrator< scoring::hbonds::NPDHBondEnergyCreator > NPDHBondEnergyCreator_registrator;
static EnergyMethodRegistrator< scoring::aa_repeat_energy::AARepeatEnergyCreator > AARepeatEnergyCreator_registrator;
static EnergyMethodRegistrator< scoring::aa_composition_energy::AACompositionEnergyCreator > AACompositionEnergyCreator_registrator;
static EnergyMethodRegistrator< scoring::methods::AspartimidePenaltyEnergyCreator > AspartimidePenaltyEnergyCreator_registrator;
Expand Down Expand Up @@ -637,6 +640,7 @@ static TaskOperationRegistrator< PreventRepackingCreator > PreventRepackingCreat
static TaskOperationRegistrator< PreserveCBetaCreator > PreserveCBetaCreator_registrator;
static TaskOperationRegistrator< AppendRotamerSetCreator > AppendRotamerSetCreator_registrator;
static TaskOperationRegistrator< AppendRotamerCreator > AppendRotamerCreator_registrator;
static TaskOperationRegistrator< EnableMultiCoolAnnealerCreator > EnableMultiCoolAnnealerCreator_registrator;
static TaskOperationRegistrator< ExtraRotamersCreator > ExtraRotamersCreator_registrator;
static TaskOperationRegistrator< ExtraChiCutoffCreator > ExtraChiCutoffCreator_registrator;
static TaskOperationRegistrator< SetRotamerCouplingsCreator > SetRotamerCouplingsCreator_registrator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ protected:
}

inline
BackgroundToFirstClassEdge< V, E, G >* get_edge_to_bg_node( int index ) const {
BackgroundToFirstClassEdge< V, E, G > const * get_edge_to_bg_node( int index ) const {
debug_assert( bg_edge_vector_up_to_date_ );
return bg_edge_vector_[ index ];
}

inline
BackgroundToFirstClassEdge< V, E, G > * get_edge_to_bg_node( int index ) {
debug_assert( bg_edge_vector_up_to_date_ );
return bg_edge_vector_[ index ];
}
Expand All @@ -87,7 +93,13 @@ protected:
}

inline
BackgroundNode< V, E, G >* get_adjacent_background_node( int index ) const {
BackgroundNode< V, E, G > const * get_adjacent_background_node( int index ) const {
debug_assert( bg_edge_vector_up_to_date_ );
return bg_node_vector_[ index ];
}

inline
BackgroundNode< V, E, G > * get_adjacent_background_node( int index ) {
debug_assert( bg_edge_vector_up_to_date_ );
return bg_node_vector_[ index ];
}
Expand Down
45 changes: 36 additions & 9 deletions source/src/core/pack/interaction_graph/DensePDInteractionGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int DensePDNode::get_current_state() const
}

/// @brief returns the one body energy for the state the node is currently assigned
core::PackerEnergy DensePDNode::get_one_body_energy_current_state()
core::PackerEnergy DensePDNode::get_one_body_energy_current_state() const
{ return curr_state_one_body_energy_;}


Expand Down Expand Up @@ -286,6 +286,16 @@ void DensePDNode::update_internal_vectors()
return;
}

void
DensePDNode::calc_deltaEpd( int alternate_state )
{
//std::cout << "PDNode::calc_deltaEpd" << std::endl;

float dummy(0.0f);
project_deltaE_for_substitution( alternate_state, dummy );
}


/// @brief outputs to standard error the bookkeeping energies for the node in its
/// current state assignment
void DensePDNode::print_internal_energies() const
Expand Down Expand Up @@ -468,16 +478,9 @@ void DensePDEdge::prepare_for_simulated_annealing()
{
if ( ! energies_updated_since_last_prep_for_simA_ ) return;


energies_updated_since_last_prep_for_simA_ = false;

bool any_non_zero = false;
unsigned int const num_energies = two_body_energies_.size();
for ( unsigned int ii = 0; ii < num_energies; ++ii ) {
if ( two_body_energies_[ ii ] != 0.0f ) { any_non_zero = true; break;}
}

if ( ! any_non_zero ) delete this;
if ( pd_edge_table_all_zeros() ) delete this;
}

/// @brief returns the two body energy corresponding to the current states assigned to
Expand Down Expand Up @@ -627,6 +630,25 @@ DensePDEdge::swap_edge_energies(
two_body_energies_.swap( new_edge_table );
}

void
DensePDEdge::prepare_for_simulated_annealing_no_deletion()
{
energies_updated_since_last_prep_for_simA_ = false;
}

void
DensePDEdge::declare_energies_final_no_deletion(){}

bool DensePDEdge::pd_edge_table_all_zeros()
{
unsigned int const num_energies = two_body_energies_.size();
for ( unsigned int ii = 0; ii < num_energies; ++ii ) {
if ( two_body_energies_[ ii ] != 0.0f ) { return false; }
}

return true;
}


//----------------------------------------------------------------------------//
//--------- Dense Pairwise Decomposable Interaction Graph Class --------------//
Expand Down Expand Up @@ -761,6 +783,11 @@ core::PackerEnergy DensePDInteractionGraph::get_energy_current_state_assignment(
return total_energy_current_state_assignment_;
}

float DensePDInteractionGraph::get_energy_PD_current_state_assignment()
{
return total_energy_current_state_assignment_;
}


/// @details Iterates across nodes and then edges to look-up the energies
/// for the current state assignmnet removing any numerical drift which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ namespace core {
namespace pack {
namespace interaction_graph {

class DensePDNode;
class DensePDEdge;
class DensePDInteractionGraph;

typedef utility::pointer::shared_ptr< DensePDInteractionGraph > DensePDInteractionGraphOP;
typedef utility::pointer::shared_ptr< DensePDInteractionGraph const > DensePDInteractionGraphCOP;

Expand Down
26 changes: 22 additions & 4 deletions source/src/core/pack/interaction_graph/DensePDInteractionGraph.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ namespace pack {
namespace interaction_graph {

// belongs in DensePDInteractionGraph.fwd.hh
class DensePDNode;
class DensePDEdge;
class DensePDInteractionGraph;

class DensePDNode : public PrecomputedPairEnergiesNode
{
Expand All @@ -68,7 +65,7 @@ public:
virtual bool state_unassigned() const { return current_state_ == 0;}
void assign_state(int new_state);
int get_current_state() const;
core::PackerEnergy get_one_body_energy_current_state();
core::PackerEnergy get_one_body_energy_current_state() const;
inline core::PackerEnergy project_deltaE_for_substitution
(
int alternate_state,
Expand Down Expand Up @@ -130,6 +127,17 @@ public:
protected:
void update_internal_vectors();

//Hooks for SASANode< V, E, G > class
core::PackerEnergy get_curr_pd_energy_total() const { return curr_state_total_energy_;}
core::PackerEnergy get_alt_pd_energy_total() const { return alternate_state_total_energy_;}
void set_alternate_state( int alt ) { alternate_state_ = alt; }
int get_alternate_state() const { return alternate_state_; }
void calc_deltaEpd( int alternate_state );
bool considering_alternate_state() const
{
return alternate_state_is_being_considered_;
}

private:

inline DensePDEdge * get_incident_dpd_edge( int index );
Expand Down Expand Up @@ -239,6 +247,13 @@ public:
ObjexxFCL::FArray2D< core::PackerEnergy > & new_edge_table
);

protected:

// Hook for NPD classes
void prepare_for_simulated_annealing_no_deletion();
void declare_energies_final_no_deletion();
bool pd_edge_table_all_zeros();

private:

inline DensePDNode * get_dpd_node( int index );
Expand Down Expand Up @@ -286,6 +301,9 @@ public:
/// @brief removes all accumulated numerical drift and returns the
/// energy for the current state assignment.
virtual core::PackerEnergy get_energy_current_state_assignment();
/// @brief Hook for classes derived from AdditionalBackgroundNodesInteractionGraph
core::PackerEnergy get_energy_PD_current_state_assignment();

/// @brief returns the number of floats used in all edge two-body energy tables
virtual int get_edge_memory_usage() const;

Expand Down
Loading

0 comments on commit 7f15b0e

Please sign in to comment.