Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NonResidueTypeConstraint.cc
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/constraints/NonResidueTypeConstraint.cc
11 ///
12 /// @brief
13 /// @author Sarel Fleishman
14 
15 
17 
19 //#include <core/io/pdb/pose_io.hh> -- REALLY?
20 // AUTO-REMOVED #include <core/options/option.hh>
21 // AUTO-REMOVED #include <core/options/keys/OptionKeys.hh>
23 // AUTO-REMOVED #include <core/scoring/constraints/ConstraintSet.hh>
24 #include <basic/Tracer.hh>
25 
27 #include <core/pose/Pose.hh>
30 #include <utility/vector1.hh>
31 
32 
33 namespace core {
34 namespace scoring {
35 namespace constraints {
36 
37 
38 static basic::Tracer non_residue_type_constraint_tracer("core.scoring.constraints.NonResidueTypeConstraint");
39 
40 
42  core::pose::Pose const & pose,
43  Size seqpos,
44  core::Real favor_non_native_bonus
45 ):
46  Constraint( core::scoring::res_type_constraint ),
47  seqpos_( seqpos ),
48  rsd_type_name3_( pose.residue_type( seqpos ).name3() ),
49  favor_non_native_bonus_( favor_non_native_bonus )
50 {}
51 
52 
54  core::pose::Pose const &,
55  Size seqpos,
56  std::string AAname,
57  core::Real favor_non_native_bonus
58 ):
59  Constraint( core::scoring::res_type_constraint ),
60  seqpos_( seqpos ),
61  rsd_type_name3_( AAname ),
62  favor_non_native_bonus_( favor_non_native_bonus )
63 {}
64 
66  Size seqpos,
67  std::string aa_in,
68  std::string name3_in,
69  core::Real bonus_in
70 ):
71  Constraint( core::scoring::res_type_constraint ),
72  seqpos_( seqpos ),
73  AAname( aa_in ),
74  rsd_type_name3_( name3_in ),
75  favor_non_native_bonus_( bonus_in )
76 {}
77 
78 
80 
83 {
84  return ConstraintOP( new NonResidueTypeConstraint( *this ) );
85 }
86 
89  utility::vector1< core::Size > pos_list(1, seqpos_); // length 1 containing "all" seqpos_ values
90  return pos_list;
91 }
92 
93 void
94 NonResidueTypeConstraint::show( std::ostream & out ) const {
95  out << "NonResidueTypeConstraint; ";
96  out << "seqpos: " << seqpos_;
97  out << "; AAname: "<< AAname;
98  out << "; rsd_type_name3: "<< rsd_type_name3_;
99  out << "; favor_non_native_bonus: "<< favor_non_native_bonus_;
100 }
101 
104 {
105  core::Size newseqpos = seqmap[ seqpos_ ];
106  if ( newseqpos != 0 ) {
108  } else {
109  return NULL;
110  }
111 }
112 
113 
114 // Calculates a score for this constraint using XYZ_Func, and puts the UNWEIGHTED score into
115 // emap. Although the current set of weights currently is provided, Constraint objects
116 // should put unweighted scores into emap.
117 void
118 NonResidueTypeConstraint::score( XYZ_Func const & xyz_func, EnergyMap const & weights, EnergyMap & emap ) const
119 {
120  Real const weight(weights[ this->score_type() ] );
121  if( weight == 0 ) return; // what's the point?
122 
123  conformation::Residue const & rsd( xyz_func.residue(seqpos_) );
124  if( rsd.type().name3() == rsd_type_name3_ )
125  emap[ this->score_type() ] -= favor_non_native_bonus_;
126  // no match, don't adjust score
127 }
128 
129 
130 void
132  AtomID const & ,//atom,
133  XYZ_Func const &,
134  Vector & ,//F1,
135  Vector & ,//F2,
136  EnergyMap const & //weights
137 ) const
138 {
139  // Do nothing.
140  // Derivative of this restraint is effectively zero
141  // so we just "add zero" to F1 and F2.
142 }
143 
144 } // namespace constraints
145 } // namespace scoring
146 } // namespace core