Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScoreFunction.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/ScoreFunction.hh
11 /// @brief Score function class
12 /// @author Phil Bradley
13 
14 
15 #ifndef INCLUDED_core_scoring_ScoreFunction_hh
16 #define INCLUDED_core_scoring_ScoreFunction_hh
17 
18 // Unit header
20 
21 // C/C++ headers
22 #include <map>
23 #include <string>
24 
25 // Utility headers
26 #include <ObjexxFCL/FArray2D.fwd.hh>
27 #include <utility/pointer/ReferenceCount.hh>
28 
29 // Project headers
30 #include <core/pose/Pose.fwd.hh>
31 #include <core/id/DOF_ID.fwd.hh>
32 #include <core/id/AtomID.fwd.hh>
33 #include <core/id/TorsionID.fwd.hh>
38 
39 // Package headers
57 
58 #include <utility/vector1.hh>
59 
60 
61 #ifdef WIN32 //VC++ needs full class declaration
62 #include <core/scoring/methods/EnergyMethod.hh> // WIN32 INCLUDE
63 #include <core/scoring/methods/EnergyMethodOptions.hh> // WIN32 INCLUDE
70 #include <core/scoring/methods/LongRangeTwoBodyEnergy.hh> // WIN32 INCLUDE
71 #include <core/scoring/methods/TwoBodyEnergy.hh> // WIN32 INCLUDE
72 #include <core/scoring/methods/WholeStructureEnergy.hh> // WIN32 INCLUDE
73 #endif
74 
75 #ifdef USELUA
76 #include <lua.hpp>
77 #include <luabind/luabind.hpp>
78 #endif
79 
80 namespace core {
81 namespace scoring {
82 
83 #ifdef USELUA
84 void lregister_ScoreFunction( lua_State * lstate );
85 #endif
86 
87 /// @brief This object defines a ScoreFunction, it contains methods for
88 /// calculating the various scoring components (called ScoreType's) used in
89 /// Rosetta. It also contains weights that are applied to each of those
90 /// components. Only scoring components with non-zero weights are calculated.
92 {
93 
94  /////////////////////////////////////////////////////////////////////////////
95  // typedefs
96  /////////////////////////////////////////////////////////////////////////////
97 
98 public:
100 
110 
117 
118 public:
119 
120  /// ctor
121  ScoreFunction();
122 
123  virtual ~ScoreFunction();
124 
125  ScoreFunction &
126  operator=( ScoreFunction const & );
127 
128  ScoreFunction( ScoreFunction const & );
129 
130  virtual ScoreFunctionOP clone() const;
131 
132  /// @brief Resets the ScoreFunction to default values
133  void
134  reset();
135 
136  /// @brief Randomly perturbs non-zero score function weights
137  void perturb_weights();
138 
139  /// @brief Serializes the non-zero score function term weights
140  /// Format: { term : weight, ... }
142 
143  /// @brief Initializes this ScoreFunction from the given <filename>
144  void
146 
147  /// @brief Initializes this ScoreFunction from the given <filename>
148  /// no lookup in database directory
149  void
150  _add_weights_from_file( std::string const & filename, bool patch=false );
151 
152  /// @brief Resets everything before reading the <filename>
153  void
155 
156  /// @brief Applies a patch from the given <filename>
157  void
159 
160  /// @brief Given a <filename> (represented by a std::string), set the
161  /// e_table for this ScoreFunction.
162  void
163  set_etable( std::string const & etable_name );
164 
165  ///
166  void
167  set_method_weights( ScoreType const & t, utility::vector1< Real > const & wts );
168 
169 
170  /// @brief Returns the EnergyMethodOptions object contained in this
171  /// ScoreFunction (const access)
174  {
175  return *energy_method_options_;
176  }
177 
178 
179  // NO LONGER IN USE! Users trying to take advantage of this saw some non-intuitive behavior.
180  /// Returns the EnergyMethodOptions object contained in this ScoreFunction.
181  // methods::EnergyMethodOptions &
182  // energy_method_options()
183  // {
184  // return *energy_method_options_;
185  // }
186 
187  /// Sets the EnergyMethodOptions object contained in this ScoreFunction.
188  /// with appropriate update of all the energy methods.
189  void
192  energy_method_options_in
193  );
194 
195  void
197 
198  /////////////////////////////////////////////////////////////////////////////
199  // score
200  /////////////////////////////////////////////////////////////////////////////
201  /// @brief Scores the given <pose> using this ScoreFunction. Alters the
202  /// Energies object within <pose>, but does not alter this ScoreFunction
203  virtual Real
204  operator ()( pose::Pose & pose ) const;
205 
206  /// @brief Scores the given <pose> using this ScoreFunction. Alters the
207  /// Energies object within <pose>, but does not alter this ScoreFunction
208  /// @note: Synonym for () operator. Makes code look a little nicer. Doesn't
209  /// do anything but call () operator.
210  virtual Real
211  score( pose::Pose & pose ) const;
212 
213  /// @brief Score the structure and store the component energies in the EnergyGraph
214  /// without requiring a second evaluation of the short-ranged two body energies.
215  /// Note: pose copy operations do not copy the EnergyGraph, so cloning or copying a pose
216  /// that has had it's components scored will not copy over the component energies.
217  //virtual Real
218  //score_components( pose::Pose & pose ) const;
219 
220  /// @brief return an object to describe abstractly the methods contained in this
221  /// ScoreFunction so that class Energies can ensure that the ScoreFunction is
222  /// properly evaluated (ie, no obsolete cashed data is used )
224  info() const;
225 
226  /// Returns the largest atomic interaction cutoff required by the
227  /// EnergyMethods
228  Distance
230 
231  /// find which context graphs the energy methods require
232  void indicate_required_context_graphs( utility::vector1< bool > & context_graphs_required ) const;
233 
234 
235  /// @brief Determine if two residues could have non-zero interaction energy after possibly changing rotamers/chi
236  /// @brief angles; uses any_lr_residue_pair_energy, combines with max_atomic_interaction_cutoff.
237  /// @note Includes long-range energies like constraints, gb...
238 
239  /// @brief Returns true if the <pose> positions <pos1> and <pos2>
240  /// are neighbors
241  bool
242  are_they_neighbors( pose::Pose const & pose, Size const pos1, Size const pos2 ) const;
243 
244  /////////////////////////////////////////////////////////////////////////////
245  // access and/or set the weights
246  /////////////////////////////////////////////////////////////////////////////
247 
248 
249  /// @brief Returns the weight of the ScoreType <t>
250  ///
251  /// example(s):
252  /// scorefxn[fa_sol]
253  /// See also:
254  /// ScoreFunction
255  /// ScoreFunction.get_weight
256  /// ScoreFunction.set_weight
257  /// ScoreFunction.weights
258  /// ScoreType
259  /// create_score_function
260  /// name_from_score_type
261  /// score_type_from_name
262  Real
263  operator []( ScoreType const & t ) const
264  {
265  return weights_[ t ];
266  }
267 
268  /// @brief Returns an EnergyMap of the current set of weights
269  ///
270  /// example(s):
271  /// scorefxn.weights()
272  /// See also:
273  /// ScoreFunction
274  /// ScoreFunction.get_weight
275  /// ScoreFunction.set_weight
276  /// ScoreFunction.weights
277  /// ScoreType
278  /// create_score_function
279  /// name_from_score_type
280  /// score_type_from_name
281  EnergyMap const &
282  weights() const
283  {
284  return weights_;
285  }
286 
287  /// @brief Returns true if the ScoreType <t> has a weight of zero,
288  ///
289  /// example(s):
290  /// scorefxn.has_zero_weight(fa_sol)
291  /// See also:
292  /// ScoreFunction
293  /// ScoreFunction.get_weight
294  /// ScoreFunction.has_nonzero_weight
295  /// ScoreFunction.set_weight
296  /// ScoreFunction.weights
297  /// ScoreType
298  /// create_score_function
299  /// name_from_score_type
300  /// score_type_from_name
301  bool
302  has_zero_weight( ScoreType const & t ) const
303  {
304  return ( weights_[t] == Real( 0.0 ) );
305  }
306 
307  /// @brief Returns true if the ScoreType <t> has a non-zero weight
308  ///
309  /// example(s):
310  /// scorefxn.has_nonzero_weight(fa_sol)
311  /// See also:
312  /// ScoreFunction
313  /// ScoreFunction.get_weight
314  /// ScoreFunction.has_zero_weight
315  /// ScoreFunction.set_weight
316  /// ScoreFunction.weights
317  /// ScoreType
318  /// create_score_function
319  /// name_from_score_type
320  /// score_type_from_name
321  bool
322  has_nonzero_weight( ScoreType const & t ) const
323  {
324  return ( weights_[t] != Real( 0.0 ) );
325  }
326 
327  /// @brief Returns a list of the ScoreTypes which are non-zero with
328  /// their current weights
329  ///
330  /// example(s):
331  /// scorefxn.get_nonzero_weighted_scoretypes()
332  /// See also:
333  /// ScoreFunction
334  /// ScoreFunction.get_weight
335  /// ScoreFunction.set_weight
336  /// ScoreFunction.weights
337  /// ScoreType
338  /// create_score_function
339  /// name_from_score_type
340  /// score_type_from_name
341  ScoreTypes
343  ScoreTypes scoretypes;
344  for ( int i=1; i<= n_score_types; ++i ) {
345  if ( has_nonzero_weight( ScoreType(i) ) ) {
346  scoretypes.push_back( ScoreType(i) );
347  }
348  }
349  return scoretypes;
350  }
351 
352  /// @brief Sets the weight for ScoreType <t> to <setting>
353  ///
354  /// example(s):
355  /// scorefxn.set_weight(fa_sol,.5)
356  /// See also:
357  /// ScoreFunction
358  /// ScoreFunction.get_weight
359  /// ScoreFunction.weights
360  /// ScoreType
361  /// create_score_function
362  /// name_from_score_type
363  /// score_type_from_name
364  void
365  set_weight( ScoreType const & t, Real const & setting );
366 
367  /// @brief Returns the weight for ScoreType <t>
368  ///
369  /// examples(s):
370  /// scorefxn.get_weight(fa_sol)
371  /// See also:
372  /// ScoreFunction
373  /// ScoreFunction.set_weight
374  /// ScoreType
375  /// create_score_function
376  /// name_from_score_type
377  /// score_type_from_name
378  Real
379  get_weight( ScoreType const & t ) const;
380 
381 
382  /// @brief Adds a scoring method that is not necessarily included in
383  /// the core library
384  void
386  ScoreType const & new_type,
387  Real const new_weight,
388  methods::EnergyMethod const & new_method
389  );
390 
391  /// @brief Adds a scoring method that is not necessarily included in
392  /// the core library
393  void
395  std::map< ScoreType, Real > const & new_weights,
396  methods::EnergyMethod const & new_method
397  );
398 
399  /// @brief Initializes a MinimizationGraph and caches it in
400  /// Energies object of <pose>
401  /// @note: for use during minimization
402  virtual
403  void
405  pose::Pose & pose,
406  kinematics::MinimizerMapBase const & min_map
407  ) const;
408 
409  /// @brief Initialize a single node of a MinimizationGraph with the one-body and two-body
410  /// energy methods that are held within this ScoreFunction object.
411  virtual
412  void
414  MinimizationNode & min_node,
415  conformation::Residue const & rsd,
416  kinematics::MinimizerMapBase const & min_map,
417  pose::Pose & pose, // context
418  bool accumulate_fixed_energies,
419  EnergyMap & fixed_energies
420  ) const;
421 
422  void
424  MinimizationNode & min_node,
425  conformation::Residue const & rsd,
426  kinematics::MinimizerMapBase const & min_map,
427  pose::Pose & pose // context
428  ) const;
429 
430  /// @brief Initialize a single MinimizationEdge for a particular part of residues, storing
431  /// sr2b energy method pointers on the edge for those sr2b energy methods in this ScoreFunction
432  void
434  conformation::Residue const & res1,
435  conformation::Residue const & res2,
436  MinimizationEdge & min_edge,
437  kinematics::MinimizerMapBase const & min_map,
438  pose::Pose & pose,
439  bool const res_moving_wrt_eachother,
440  bool accumulate_fixed_energies,
441  EnergyEdge const * energy_edge,
442  EnergyMap & fixed_energies,
443  Real const edge_weight = 1.0
444  ) const;
445 
446  /// @brief Initialize an edge in the MinimizationGraph with a particular long-range two body
447  void
449  conformation::Residue const & res1,
450  conformation::Residue const & res2,
452  MinimizationGraph & g,
453  kinematics::MinimizerMapBase const & min_map,
454  pose::Pose & p,
455  bool const res_moving_wrt_eachother,
456  bool accumulate_fixed_energies,
458  EnergyMap & fixed_energies,
459  Real const edge_weight = 1.0
460  ) const;
461 
462  /// @brief For external scorers: Let the energy methods prepare for
463  /// evaluating their scores on a particular structure
464  /// @note: invoked during scoring.
465  void
467  pose::Pose & pose
468  ) const;
469 
470 
471  /// @brief Lets the scoring functions cache anything they need to calculate
472  /// energies in a packing step (rotamer_trials or pack_rotamers)
473  /// @note: the Etable caches tries for each of the residues, the
474  /// hydrogen bond function caches backbone/backbone hydrogen bonds
475  void
476  setup_for_packing( pose::Pose & pose, utility::vector1< bool > const & residues_repacking, utility::vector1< bool > const & residues_designing ) const;
477 
478  /// @brief Lets the scoring functions cache anything they need to rapidly
479  /// calculate rotamer pair energies used in packing (like a trie, e.g.)
480  void
482 
483  /// @brief If inside packing, the pose changes conformation, inform the
484  /// scoring functions that any data they have cached in the Energies object
485  /// is out of date. In particular, this is to update the trie(s) during
486  /// rotamer trials.
487  void
488  update_residue_for_packing( pose::Pose & pose, Size resid ) const;
489 
490  ///
491  //void
492  //setup_for_scoring( pose::Pose & pose ) const;
493 
494  /// @brief
495  virtual
496  void
497  setup_for_derivatives( pose::Pose & pose ) const;
498 
499  /// @brief
500  virtual
501  void
502  finalize_after_derivatives( pose::Pose & pose ) const;
503 
504 
505  /// @brief Compute the score for subset of residues
506  core::Real
508  pose::Pose const & pose,
509  utility::vector1< bool > const & residue_mask ) const;
510 
511  /// @brief Compute the score for subset of residues
512  void
514  pose::Pose const & pose,
515  utility::vector1< bool > const & residue_mask,
516  EnergyMap & emap) const;
517 
518  /// @brief Compute the score for subset of residues
519  core::Real
521  pose::Pose & pose,
522  utility::vector1< bool > const & residue_mask ) const;
523 
524  /// @brief Compute the score for subset of residues
525  void
527  pose::Pose & pose,
528  utility::vector1< bool > const & residue_mask,
529  EnergyMap & emap) const;
530 
531 
532  /// @brief Compute the score for subset of residues
533  core::Real
535  pose::Pose const & pose,
536  utility::vector1< core::Size > const & exclude_list ) const;
537 
538  /// @brief Compute the score for subset of residues
539  void
541  pose::Pose const & pose,
542  utility::vector1< core::Size > const & exclude_list,
543  EnergyMap & emap) const;
544 
545  /// @brief Compute the score for subset of residues
546  core::Real
548  pose::Pose & pose,
549  utility::vector1< core::Size > const & exclude_list ) const;
550 
551  /// @brief Compute the score for subset of residues
552  void
554  pose::Pose & pose,
555  utility::vector1< core::Size > const & exclude_list,
556  EnergyMap & emap) const;
557 
558 
559  /// @brief
560  virtual
561  void
563 
564  /// @brief
565  virtual
566  void
568 
570  all_energies_begin() const;
571 
573  all_energies_end() const;
574 
577 
579  long_range_energies_end() const;
580 
582  ci_2b_intrares_begin() const;
583 
585  ci_2b_intrares_end() const;
586 
588  cd_2b_intrares_begin() const;
589 
591  cd_2b_intrares_end() const;
592 
593  CI_2B_Methods::const_iterator
594  ci_2b_begin() const;
595 
596  CI_2B_Methods::const_iterator
597  ci_2b_end() const;
598 
599  CD_2B_Methods::const_iterator
600  cd_2b_begin() const;
601 
602  CD_2B_Methods::const_iterator
603  cd_2b_end() const;
604 
606  ci_lr_2b_methods_begin() const;
607 
609  ci_lr_2b_methods_end() const;
610 
612  cd_lr_2b_methods_begin() const;
613 
615  cd_lr_2b_methods_end() const;
616 
618  ws_methods_begin() const;
619 
621  ws_methods_end() const;
622 
623  /// @brief
624  virtual
625  void
626  eval_onebody_energies( pose::Pose & pose ) const;
627 
628  /// This is now handled lazily by the Energies object itself
629  /// void
630  /// accumulate_residue_total_energies( pose::Pose & pose ) const;
631 
632  /// @brief
633  void
634  show( std::ostream & out ) const;
635 
636  /// @brief Merges in the weights of another score function
637  ///
638  /// example(s):
639  /// scorefxn.merge(scorefxn2)
640  /// See also:
641  /// ScoreFunction
642  /// ScoreFunction.weights
643  /// Energies
644  /// create_score_function
645  void
646  merge( const ScoreFunction scorefxn_to_be_merged );
647 
648  /// @brief Scores <pose> and shows the raw and weighted scores for each
649  /// non-zero ScoreType
650  ///
651  /// example(s):
652  /// scorefxn.show(pose)
653  /// See also:
654  /// ScoreFunction
655  /// ScoreFunction.weights
656  /// Energies
657  /// create_score_function
658  void
659  show( std::ostream & out, pose::Pose & pose ) const;
660 
661  /// @brief similar output as show( ostream, pose ) but without the pose
662  void
663  show_pretty( std::ostream & out ) const;
664 
665 
666  /// @brief Scores <pose> and shows the raw and weighted scores for each
667  /// non-zero ScoreType
668  /// @note: this function is mostly for convenience in PyRosetta
669  ///
670  /// example(s):
671  /// scorefxn.show(pose)
672  /// See also:
673  /// ScoreFunction
674  /// ScoreFunction.weights
675  /// Energies
676  /// create_score_function
677  void
678  show(pose::Pose & pose ) const { show(std::cout, pose); };
679 
680 
681  ///
682  void
683  show_line_headers( std::ostream & out ) const;
684 
685  ///
686  void
687  show_line( std::ostream & out, pose::Pose const & pose ) const;
688 
689  /// @brief Accumulates the unweighted one body energies of all context
690  /// independent one body energies for <pose> Residue <rsd> into
691  /// EnergyMap <emap>
692  /// @note: EnergyMap is an EMapVector
693 
694  void name( std::string const & weights_tag ) { name_ = weights_tag; }
695  std::string get_name() const { return name_; }
696 
697  void
698  eval_ci_1b(
699  conformation::Residue const & rsd,
700  pose::Pose const & pose,
701  EnergyMap & emap
702  ) const;
703 
704  /// @brief Accumulates the unweighted one body energies of all context
705  /// dependent one body energies for <pose> Residue <rsd> into
706  /// EnergyMap <emap>
707  /// @note: EnergyMap is an EMapVector
708  virtual
709  void
710  eval_cd_1b(
711  conformation::Residue const & rsd,
712  pose::Pose const & pose,
713  EnergyMap & emap
714  ) const;
715 
716  /// @brief Accumulates the unweighted context independent two body
717  /// interaction energies of <pose> between Residue <rsd1> and Residue
718  /// <rsd2> into EnergyMap <emap>
719  /// @note: EnergyMap is an EMapVector
720  void
721  eval_ci_2b(
722  conformation::Residue const & rsd1,
723  conformation::Residue const & rsd2,
724  pose::Pose const & pose,
725  EnergyMap & emap
726  ) const;
727 
728  /// @brief Accumulates the unweighted context independent two body
729  /// interaction energies of <pose> between the backbones of Residue
730  /// <rsd1> and Residue <rsd2> into EnergyMap <emap>
731  /// @note: EnergyMap is an EMapVector
732  void
734  conformation::Residue const & rsd1,
735  conformation::Residue const & rsd2,
736  pose::Pose const & pose,
737  EnergyMap & emap
738  ) const;
739 
740  /// @brief Accumulates the unweighted short range context independent two
741  /// body interaction energies of <pose> between the backbone of Residue
742  /// <rsd1> and the sidechain of Residue <rsd2> into EnergyMap <emap>
743  /// @note: EnergyMap is an EMapVector
744  void
746  conformation::Residue const & rsd1,
747  conformation::Residue const & rsd2,
748  pose::Pose const & pose,
749  EnergyMap & emap
750  ) const;
751 
752  /// @brief Accumulates the unweighted short range context dependent two body
753  /// interaction energies of <pose> between the sidechains of Residue <rsd1>
754  /// and Residue <rsd2> into Energymap <emap>
755  /// @note: EnergyMap is an EMapVector
756  void
758  conformation::Residue const & rsd1,
759  conformation::Residue const & rsd2,
760  pose::Pose const & pose,
761  EnergyMap & emap
762  ) const;
763 
764 
765  /// @brief Accumulate the unweighted short range context dependent two body
766  /// interaction energies of <pose> between Residue <rsd1> and Residue
767  /// <rsd2> into EnergyMap <emap>
768  /// @note: EnergyMap is an EMapVector
769  virtual
770  void
771  eval_cd_2b(
772  conformation::Residue const & rsd1,
773  conformation::Residue const & rsd2,
774  pose::Pose const & pose,
775  EnergyMap & emap
776  ) const;
777 
778 
779  /// @brief Accumulates the unweighted short ranged context dependent two body
780  /// interaction energies of <pose> between the backbones of Residue
781  /// <rsd1> and <rsd2> into EnergyMap <emap>
782  /// @note: EnergyMap is an EMapVector
783  void
785  conformation::Residue const & rsd1,
786  conformation::Residue const & rsd2,
787  pose::Pose const & pose,
788  EnergyMap & emap
789  ) const;
790 
791  /// @brief Accumulates the unweighted short ranged context dependent two body
792  /// interaction energies of <pose> between the backbone of Residue <rsd1>
793  /// and the sidechain of Residue <rsd2> into EnergyMap <emap>
794  /// @note: EnergyMap is an EMapVector
795  void
797  conformation::Residue const & rsd1,
798  conformation::Residue const & rsd2,
799  pose::Pose const & pose,
800  EnergyMap & emap
801  ) const;
802 
803  /// @brief Accumulates the unweighted short ranged context dependent two body
804  /// interaction energies of <pose> between the sidechains of Residue
805  /// <rsd1> and Residue <rsd2> into EnergyMap <emap>
806  /// @note: EnergyMap is an EMapVector
807  void
809  conformation::Residue const & rsd1,
810  conformation::Residue const & rsd2,
811  pose::Pose const & pose,
812  EnergyMap & emap
813  ) const;
814 
815  /// @brief Accumulates for rsd the unweighted intra-residue one body energies
816  /// for all context dependent and context independent two body terms that
817  /// define intra-residue energies
818  /// @note: EnergyMap is an EMapVector
819  void
821  conformation::Residue const & rsd,
822  pose::Pose const & pose,
823  EnergyMap & emap
824  ) const;
825 
826  /// @brief Accumulates the unweighted intra-residue one body energies for all
827  /// context independent two body terms that define intra-residue energies of
828  /// <pose> Residue <rsd> into EnergyMap <emap>
829  /// @note: EnergyMap is an EMapVector
830  void
832  conformation::Residue const & rsd,
833  pose::Pose const & pose,
834  EnergyMap & emap
835  ) const;
836 
837  /// @brief Accumulates the unweighted intra-residue one body energies for all
838  /// context dependent two body terms that define intra-residue energies of
839  /// <pose> Residue <rsd> into EnergyMap <emap>
840  /// @note: EnergyMap is an EMapVector
841  virtual
842  void
844  conformation::Residue const & rsd,
845  pose::Pose const & pose,
846  EnergyMap & emap
847  ) const;
848 
849  ///
850  void
852  conformation::Residue const & rsd1,
853  conformation::Residue const & rsd2,
854  pose::Pose const & pose,
855  EnergyMap & emap
856  ) const;
857 
858 
859  /// @brief Scores the sidechain from <pose> Residue <rsd1> against the
860  /// backbone of Residue <rsd2>
861  void
863  conformation::Residue const & rsd1,
864  conformation::Residue const & rsd2,
865  pose::Pose const & pose,
866  EnergyMap & emap
867  ) const;
868 
869  void
871  conformation::RotamerSetBase const & set,
872  pose::Pose const & pose,
874  ) const;
875 
876  void
878  conformation::RotamerSetBase const & set,
879  pose::Pose const & pose,
881  ) const;
882 
883  ///
884  void
886  conformation::RotamerSetBase const & set1,
887  conformation::RotamerSetBase const & set2,
888  pose::Pose const & pose,
889  ObjexxFCL::FArray2D< core::PackerEnergy > & energy_table
890  ) const;
891 
892  ///
893  void
895  conformation::RotamerSetBase const & set1,
896  conformation::Residue const & residue2,
897  pose::Pose const & pose,
899  ) const;
900 
901  bool
903  pose::Pose const & pose,
904  Size res1,
905  Size res2
906  ) const;
907 
908  ///
909  virtual
910  void
912  id::AtomID const & atom_id,
913  pose::Pose const & pose,
914  kinematics::DomainMap const & domain_map,
915  Vector & F1,
916  Vector & F2
917  ) const;
918 
919  ///
920  Real
922  id::DOF_ID const & dof_id,
923  id::TorsionID const & torsion_id,
924  pose::Pose const & pose
925  ) const;
926 
927  ///
928  ScoreTypes const &
930  {
931  return score_types_by_method_type_[ t ];
932  }
933 
934  /// @brief convenience access to all ci 1b score types
935  ScoreTypes const &
936  ci_1b_types() const
937  {
939  }
940 
941  /// @brief convenience access to all cd 1b score types
942  ScoreTypes const &
943  cd_1b_types() const
944  {
946  }
947 
948  /// @brief convenience access to all ci 2b score types
949  ScoreTypes const &
950  ci_2b_types() const
951  {
953  }
954 
955  /// @brief convenience access to all cd 2b score types
956  ScoreTypes const &
957  cd_2b_types() const
958  {
960  }
961 
962 
963  ScoreTypes const &
965  {
967  }
968 
969  ScoreTypes const &
971  {
973  }
974 
975  ScoreTypes const &
977  {
979  }
980 
981 
982 public:
983 
984  AllMethods const & all_methods() const;
985 
986  /////////////////////////////////////////////////////////////////////////////
987  // private methods
988  /////////////////////////////////////////////////////////////////////////////
989 
990 private:
991 
992  ///
993  void
995 
996  ///
997  void
999 
1000  /// private
1001  bool
1002  check_methods() const;
1003 
1004  /// @brief sets up the derived method vectors from the primary vectors
1005  void
1007 
1008  /// @brief check if any of the 2body methods define intra-residue energies, given
1009  /// our current weight set
1010  void
1012 
1013  protected:
1014 
1015  bool
1017  {
1018  return any_intrares_energies_;
1019  }
1020 
1021  /////////////////////////////////////////////////////////////////////////////
1022  // data
1023  /////////////////////////////////////////////////////////////////////////////
1024 private:
1025 
1026  /// the scorefxn name
1028 
1029  /// the scorefxn weights
1031 
1032  /// @brief Options that control choice/configuration of EnergyMethods.
1033  /// eg etable name
1035 
1036  ///////////////////////////////////////////////////////////
1037  // scoring methods
1038  /// NOTE: if you add another array here, be sure to reset it inside
1039  /// initialize_methods_arrays or the copy c-tor won't work
1040 
1041  /// these are the primary data -- others can be rederived by calling
1042  /// update_method_vectors
1043  /// filled by the private member function add_method
1052 
1053  /////////////////////////////////////////////////////////////////////////////
1054  /// convenience access to the methods/alternate lookups
1055  /// filled by add_method along with the primary methods vectors
1056 
1057  /// vector of COPs to all active methods
1059 
1060  /// @brief Map from ScoreType to the method for evaluating it.
1061  /// will be 0 for score_types without a method, ie ones with 0 weight
1063 
1064  ///
1066 
1069 
1070  // 2body energies that define intra-residue energies are allowed to
1071  // define "one body" intra-energies; the loops to evaluate intrares
1072  // energies are evaluated only if some intrares energies exist
1073  // These lists include both short and long range energy funcitons
1077 }; // ScoreFunction
1078 
1079 inline
1080 std::ostream &
1081 operator <<( std::ostream & out, ScoreFunction const & sf )
1082 {
1083  sf.show( out );
1084  return out;
1085 }
1086 
1087 /// @brief Utility function to locate a weights or patch file, either with a fully qualified path,
1088 /// in the local directory, or in the database. Names may be passes either with or without the
1089 /// optional extension.
1090 
1092 find_weights_file(std::string name, std::string extension=".wts");
1093 
1094 } // namespace scoring
1095 } // namespace core
1096 
1097 
1098 #endif // INCLUDED_core_scoring_ScoreFunction_HH