24 #include <basic/options/option.hh>
25 #include <basic/options/keys/OptionKeys.hh>
36 #include <basic/Tracer.hh>
38 #include <ObjexxFCL/string.functions.hh>
41 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
42 #include <basic/options/keys/pocket_grid.OptionKeys.gen.hh>
47 #include <utility/vector1.hh>
68 static basic::Tracer
TR(
"core.scoring.constraints.PocketConstraint");
71 using namespace basic::options;
73 weight_ = option[ OptionKeys::constraints::pocket_constraint_weight ]();
74 dumppdb_=option[ OptionKeys::pocket_grid::pocket_dump_pdbs ]();
76 if (option[ OptionKeys::pocket_grid::pocket_num_angles ] <1){
77 std::cout<<
"PocketConstraint: invalid number of angles specified. Exiting."<<std::endl;
80 angles_ = option[ OptionKeys::pocket_grid::pocket_num_angles ];
86 std::istream & line_stream,
93 if ((line_stream >>
weight_>>resid )){
96 std::cout <<
"ERROR!! Invalid residue to backrub around" << std::endl;
101 std::cout <<
"ERROR!! Invalid PocketConstraint specification" << std::endl;
109 out <<
"PocketConstraint::show_def() " << std::endl;
120 using namespace basic::options;
127 std::string resid(option[ OptionKeys::pocket_grid::central_relax_pdb_num ]);
128 int central_relax_pdb_number;
130 std::size_t fpos( resid.find(
':') );
131 if ( fpos != std::string::npos ) {
132 central_relax_pdb_number = ObjexxFCL::int_of( resid.substr(0,fpos) );
133 if (fpos != resid.size()-1 ) {
134 chain = resid[ fpos+1 ];
137 central_relax_pdb_number = ObjexxFCL::int_of( resid );
140 for (
int j = 1, resnum = pose.
total_residue(); j <= resnum; ++j ) {
141 if ( pose.
pdb_info()->number(j) == central_relax_pdb_number ) {
144 if ( pose.
pdb_info()->chain(j) == chain ) {
182 std::cout <<
"ERROR!! Invalid residue to backrub around" << std::endl;
189 std::cout <<
"ERROR!! Invalid residue to backrub around" << std::endl;
197 int central_relax_pdb_number;
199 std::size_t fpos( resid.find(
':') );
200 if ( fpos != std::string::npos ) {
201 central_relax_pdb_number = ObjexxFCL::int_of( resid.substr(0,fpos) );
202 if (fpos != resid.size()-1 ) {
203 chain = resid[ fpos+1 ];
206 central_relax_pdb_number = ObjexxFCL::int_of( resid );
210 for (
int j = 1, resnum = pose.
total_residue(); j <= resnum; ++j ) {
211 if ( pose.
pdb_info()->number(j) == central_relax_pdb_number ) {
214 if ( pose.
pdb_info()->chain(j) == chain ) {
226 std::cout <<
"ERROR!! Invalid residue to backrub around" << std::endl;
243 if ( weights[ this->
score_type() ] == 0 )
return;
245 std::cout <<
"ERROR!! Invalid residue to backrub around" << std::endl;
262 cst_avg += largestPocketVol;
286 largestPocketVol=
pocketgrid_->netTargetPocketVolume();
289 cst_avg += largestPocketVol;
291 cst_val *= (cst_avg);
313 if ( weights[ this->
score_type() ] == 0 )
return;
315 using namespace basic::options;
316 if (!option[ OptionKeys::constraints::pocket_zero_derivatives ]()){
317 TR <<
"ERROR - derivatives not yet implemented for PocketConstraints." << std::endl;