Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
sequence_recovery.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 sequence_recovery.cc
11 /// @brief A protocol which outputs sequence recovery statistics ala the table in the "Native sequences are close to optimal" paper.
12 /// @author Ron Jacak
13 /// @author P. Douglas Renfrew (renfrew@nyu.edu) ( added rotamer recovery, cleanup )
14 
15 // Unit headers
16 #include <devel/init.hh>
17 
18 //project Headers
19 #include <core/conformation/PointGraph.hh>
20 #include <core/conformation/find_neighbors.hh>
21 #include <core/io/pdb/pose_io.hh>
22 
23 #include <core/pack/task/PackerTask.hh>
24 #include <core/pack/task/operation/TaskOperations.hh>
25 #include <core/pack/task/operation/TaskOperationFactory.hh>
26 #include <core/pack/task/TaskFactory.hh>
27 #include <core/pose/Pose.hh>
28 #include <core/pose/PDBInfo.hh>
29 #include <core/conformation/Residue.hh>
30 #include <core/scoring/EnergyMap.hh>
31 #include <core/scoring/ScoreType.hh>
32 #include <core/scoring/ScoreFunction.hh>
33 #include <core/scoring/ScoreFunctionFactory.hh>
34 
35 
36 // basic headers
37 #include <basic/Tracer.hh>
38 #include <basic/prof.hh>
39 #include <basic/options/util.hh>
41 
42 // Utility Headers
44 #include <utility/io/ozstream.hh>
45 #include <utility/vector1.hh>
47 
48 // Option keys
49 #include <basic/options/keys/run.OptionKeys.gen.hh>
50 
51 // Numeric Headers
52 
53 // ObjexxFCL Headers
54 #include <ObjexxFCL/format.hh>
55 #include <ObjexxFCL/FArray2D.hh>
56 
57 // C++ headers
58 #include <sstream>
59 
60 //Auto Headers
61 #include <core/conformation/PointGraphData.hh>
62 #include <core/graph/UpperEdgeGraph.hh>
63 #include <core/import_pose/import_pose.hh>
64 #include <protocols/filters/Filter.fwd.hh>
65 #include <utility/vector0.hh>
66 
67 
68 static THREAD_LOCAL basic::Tracer TR( "sequence_recovery" );
69 
70 using namespace core;
71 using namespace protocols;
72 using namespace basic::options;
73 using namespace basic::options::OptionKeys;
74 
75 using namespace ObjexxFCL::format;
76 
77 namespace sequence_recovery {
78 FileOptionKey const native_pdb_list( "sequence_recovery::native_pdb_list" );
79 FileOptionKey const redesign_pdb_list( "sequence_recovery::redesign_pdb_list" );
80 FileOptionKey const parse_taskops_file( "sequence_recovery::parse_taskops_file" );
81 BooleanOptionKey const rotamer_recovery( "sequence_recovery::rotamer_recovery" );
82 StringOptionKey const seq_recov_filename( "sequence_recovery::seq_recov_filename" );
83 StringOptionKey const sub_matrix_filename( "sequence_recovery::sub_matrix_filename" );
84 IntegerOptionKey const se_cutoff( "sequence_recovery::se_cutoff" );
85 }
86 
87 std::string usage_string;
88 
89 void init_usage_prompt( std::string exe ) {
90 
91  // place the prompt up here so that it gets updated easily; global this way, but that's ok
92  std::stringstream usage_stream;
93  usage_stream << "No files given: Use either -file:s or -file:l to designate a single pdb or a list of pdbs.\n\n"
94  << "Usage: " << exe
95  << "\n\t-native_pdb_list <list file>"
96  << "\n\t-redesign_pdb_list <list file>"
97 
98  << "\n\t[-seq_recov_filename <file>] file to output sequence recoveries to (default: sequencerecovery.txt)"
99  << "\n\t[-sub_matrix_filename <file>] file to output substitution matrix to (default: submatrix.txt)"
100  << "\n\t[-parse_taskops_file <file>] tagfile which contains task operations to apply before measuring recovery (optional)"
101  << "\n\t[-ignore_unrecognized_res]"
102 
103  << "\n\n";
104 
105  usage_string = usage_stream.str();
106 
107 }
108 
109 
110 /// @brief load custom TaskOperations according to an xml-like utility::tag file
111 /// @details The sequence recovery app can only handle taskops that do not use
112 /// ResidueSelectors, unless they are anonymous (i.e. unnamed) ResidueSelectors
113 /// that are declared as subtags of TaskOperations.
114 core::pack::task::TaskFactoryOP setup_tf( core::pack::task::TaskFactoryOP task_factory_ ) {
115 
116  using namespace core::pack::task::operation;
117 
119  std::string tagfile_name( option[ sequence_recovery::parse_taskops_file ]() );
120  TaskOperationFactory::TaskOperationOPs tops;
121  basic::datacache::DataMap dm; // empty data map! any TaskOperation that tries to retrieve data out of this datamap will fail to find it.
122  TaskOperationFactory::get_instance()->newTaskOperations( tops, dm, tagfile_name );
123  for ( TaskOperationFactory::TaskOperationOPs::iterator it( tops.begin() ), itend( tops.end() ); it != itend; ++it ) {
124  task_factory_->push_back( *it );
125  }
126  } else {
127  task_factory_->push_back( TaskOperationCOP( new pack::task::operation::InitializeFromCommandline ) );
128  }
129 
130  return task_factory_;
131 
132 }
133 
134 
135 /// @brief helper method which uses the tenA nb graph in the pose object to fill a vector with nb counts
137 
138  using core::conformation::PointGraph;
139  using core::conformation::PointGraphOP;
140 
141  PointGraphOP pg( new PointGraph ); // create graph
142  core::conformation::residue_point_graph_from_conformation( pose.conformation(), *pg ); // create vertices
143  core::conformation::find_neighbors<core::conformation::PointGraphVertexData,core::conformation::PointGraphEdgeData>( pg, 10.0 /* ten angstrom distance */ ); // create edges
144 
145  num_nbs.resize( pose.n_residue(), 0 );
146  for ( core::Size ii=1; ii <= pose.total_residue(); ++ii ) {
147 
148  // a PointGraph is a typedef of UpperEdgeGraph< PointGraphVertexData, PointGraphEdgeData >
149  // so any of the method in UpperEdgeGraph should be avail. here. The UpperEdgeGraph provides access to nodes
150  // via a get_vertex() method, and each vertex can report back how many nbs it has.
151  // So something that before was really complicated (nb count calculation) is done in <10 lines of code.
152  // the assumption we're making here is that a pose residue position ii is the same index as the point graph vertex
153  // that is indeed the case if you look at what the function residue_point_graph_from_pose().
154  num_nbs[ ii ] = pg->get_vertex(ii).num_neighbors_counting_self();
155  }
156 
157  return;
158 }
159 
160 /// @brief return the set of residues that are designable based given pose
161 std::set< Size > fill_designable_set( pose::Pose & pose, pack::task::TaskFactoryOP & tf ) {
162 
163  //we need to score the pose for many of the task operations passed from cmd line
165  scoring::ScoreFunctionOP scorefxn = scoring::get_score_function();
166  (*scorefxn)( pose );
167  }
168  std::set< Size > designable_set;
169  core::pack::task::PackerTaskOP design_task( tf->create_task_and_apply_taskoperations( pose ) );
170 
171 #ifndef NDEBUG
172  TR<< "Task for " << pose.pdb_info()->name() << " is: \n" << *(design_task) << std::endl;
173 #endif
174 
175  // iterate over all residues
176  for ( Size ii = 1; ii<= design_task->total_residue(); ++ii ) {
177  if ( design_task->being_designed( ii ) ) {
178  designable_set.insert( ii );
179  }
180  }
181 
182  return designable_set;
183 
184 }
185 
186 
187 /// @brief iterates over all designed positions and determines identity to native. outputs recoveries to file.
189 
190  // setup main arrays used for calculation
191  utility::vector1< core::Size > n_correct( chemical::num_canonical_aas, 0 );
192  utility::vector1< core::Size > n_native( chemical::num_canonical_aas, 0 );
193  utility::vector1< core::Size > n_designed( chemical::num_canonical_aas, 0 );
194 
195  utility::vector1< core::Size > n_correct_core( chemical::num_canonical_aas, 0 );
196  utility::vector1< core::Size > n_native_core( chemical::num_canonical_aas, 0 );
197  utility::vector1< core::Size > n_designed_core( chemical::num_canonical_aas, 0 );
198 
199  utility::vector1< core::Size > n_correct_surface( chemical::num_canonical_aas, 0 );
200  utility::vector1< core::Size > n_native_surface( chemical::num_canonical_aas, 0 );
201  utility::vector1< core::Size > n_designed_surface( chemical::num_canonical_aas, 0 );
202 
203  ObjexxFCL::FArray2D_int sub_matrix( chemical::num_canonical_aas, chemical::num_canonical_aas, 0 );
204 
205  Size n_correct_total(0); Size n_total(0);
206  Size n_correct_total_core(0); Size n_total_core(0);
207  Size n_correct_total_surface(0); Size n_total_surface(0);
208 
209  Size surface_exposed_cutoff = option[ sequence_recovery::se_cutoff ];
210  Size core_cutoff = 24;
211 
212  // iterate through all the structures
213  utility::vector1< core::pose::Pose >::iterator native_itr( native_poses.begin() ), native_last( native_poses.end() );
214  utility::vector1< core::pose::Pose >::iterator redesign_itr( redesign_poses.begin() ), redesign_last( redesign_poses.end() );
215 
216  while ( ( native_itr != native_last ) && (redesign_itr != redesign_last ) ) {
217 
218  // get local copies of the poses
219  core::pose::Pose native_pose( *native_itr );
220  core::pose::Pose redesign_pose( *redesign_itr );
221 
222  // figure out the task & neighbor info
223  core::pack::task::TaskFactoryOP task_factory( new core::pack::task::TaskFactory );
224  std::set< Size > design_set;
225  utility::vector1< core::Size > num_neighbors;
226 
227  // setup what residues we are going to look at...
228  setup_tf( task_factory );
229  design_set = fill_designable_set( native_pose, task_factory );
230  fill_num_neighbors( native_pose, num_neighbors );
231 
232  // record native sequence
233  // native_sequence vector is sized for the WHOLE pose not just those being designed
234  // it doesn't matter because we only iterate over the number of designed positions
235  Size const nres( native_pose.total_residue() );
237 
238  // iterate over designable positions
239  for ( std::set< core::Size >::const_iterator it = design_set.begin(), end = design_set.end(); it != end; ++it ) {
240 
241  if ( ! native_pose.residue(*it).is_protein() ) {
242  native_sequence[ *it ] = chemical::aa_unk;
243  continue;
244  }
245  //figure out info about the native pose
246  native_sequence[ *it ] = native_pose.residue( *it ).aa();
247  n_native[ native_pose.residue(*it).aa() ]++;
248 
249  //determine core/surface
250  if ( num_neighbors[*it] >= core_cutoff ) {
251  n_native_core[ native_pose.residue(*it).aa() ]++;
252  n_total_core++;
253  }
254 
255  if ( num_neighbors[*it] < surface_exposed_cutoff ) {
256  n_native_surface[ native_pose.residue(*it).aa() ]++;
257  n_total_surface++;
258  }
259 
260  } // end finding native seq
261 
262  /// measure seq recov
263  for ( std::set< core::Size >::const_iterator it = design_set.begin(), end = design_set.end(); it != end; ++it ) {
264 
265  // don't worry about recovery of non-protein residues
266  if ( redesign_pose.residue( *it ).is_protein() ) {
267  n_total++;
268 
269  // increment the designed count
270  n_designed[ redesign_pose.residue(*it).aa() ]++;
271 
272  if ( num_neighbors[*it] >= core_cutoff ) { n_designed_core[ redesign_pose.residue(*it).aa() ]++; }
273  if ( num_neighbors[*it] < surface_exposed_cutoff ) { n_designed_surface[ redesign_pose.residue(*it).aa() ]++; }
274 
275  // then check if it's the same
276  if ( native_sequence[ *it ] == redesign_pose.residue(*it).aa() ) {
277  n_correct[ redesign_pose.residue(*it).aa() ]++;
278 
279  if ( num_neighbors[*it] >= core_cutoff ) {
280  n_correct_core[ redesign_pose.residue(*it).aa() ]++;
281  n_correct_total_core++;
282  }
283  if ( num_neighbors[*it] < surface_exposed_cutoff ) {
284  n_correct_surface[ redesign_pose.residue(*it).aa() ]++;
285  n_correct_total_surface++;
286  }
287  n_correct_total++;
288  }
289 
290  // set the substitution matrix for this go round
291  sub_matrix( native_pose.residue(*it).aa(), redesign_pose.residue(*it).aa() )++;
292  }
293 
294  } // end measure seq reovery
295 
296  // increment iterators
297  native_itr++; redesign_itr++;
298  }
299 
300  // open sequence recovery file stream
302 
303  // write header
304  outputFile << "Residue\tNo.correct core\tNo.native core\tNo.designed core\tNo.correct/ No.native core\tNo.correct/ No.designed core\t"
305  << "No.correct\tNo.native\tNo.designed\tNo.correct/ No.native\tNo.correct/ No.designed\t"
306  << "Residue\tNo.correct surface\tNo.native surface\tNo.designed surface\tNo.correct/ No.native\tNo.correct/ No.designed" << std::endl;
307 
308  // write AA data
309  for ( Size ii = 1; ii <= chemical::num_canonical_aas; ++ii ) {
310 
311  outputFile << chemical::name_from_aa( chemical::AA(ii) ) << "\t"
312  << n_correct_core[ ii ] << "\t" << n_native_core[ ii ] << "\t" << n_designed_core[ ii ] << "\t";
313 
314  if ( n_native_core[ii] != 0 ) outputFile << F(4,2, (float)n_correct_core[ii]/n_native_core[ii] ) << "\t";
315  else outputFile << "---\t";
316  if ( n_designed_core[ii] != 0 ) outputFile << F(4,2, (float)n_correct_core[ii]/n_designed_core[ii] ) << "\t";
317  else outputFile << "---\t";
318 
319  // debug
320  //if ( n_native_core[ii] != 0 ) std::cout << F(4,2, (float)n_correct_core[ii]/n_native_core[ii] ) << "\t";
321  //if ( n_designed_core[ii] != 0 ) std::cout << F(4,2, (float)n_correct_core[ii]/n_designed_core[ii] ) << "\t";
322 
323  outputFile << n_correct[ ii ] << "\t" << n_native[ ii ] << "\t" << n_designed[ ii ] << "\t";
324  if ( n_native[ii] != 0 ) outputFile << F(4,2, (float)n_correct[ii]/n_native[ii] ) << "\t";
325  else outputFile << "---\t";
326  if ( n_designed[ii] != 0 ) outputFile << F(4,2, (float)n_correct[ii]/n_designed[ii] ) << "\t";
327  else outputFile << "---\t";
328 
329  // debug
330  //if ( n_native[ii] != 0 ) std::cout << F(4,2, (float)n_correct[ii]/n_native[ii] ) << "\t";
331  //if ( n_designed[ii] != 0 ) std::cout << F(4,2, (float)n_correct[ii]/n_designed[ii] ) << "\t";
332 
333  outputFile << chemical::name_from_aa( chemical::AA(ii) ) << "\t"
334  << n_correct_surface[ ii ] << "\t" << n_native_surface[ ii ] << "\t" << n_designed_surface[ ii ] << "\t";
335 
336  if ( n_native_surface[ii] != 0 ) outputFile << F(4,2, (float)n_correct_surface[ii]/n_native_surface[ii] ) << "\t";
337  else outputFile << "---\t";
338  if ( n_designed_surface[ii] != 0 ) outputFile << F(4,2, (float)n_correct_surface[ii]/n_designed_surface[ii] ) << "\t";
339  else outputFile << "---\t";
340 
341  // debug
342  //if ( n_native_surface[ii] != 0 ) std::cout << F(4,2, (float)n_correct_surface[ii]/n_native_surface[ii] ) << "\t";
343  //if ( n_designed_surface[ii] != 0 ) std::cout << F(4,2, (float)n_correct_surface[ii]/n_designed_surface[ii] ) << "\t";
344 
345  outputFile << std::endl;
346  }
347 
348  // write totals
349  outputFile << "Total\t"
350  << n_correct_total_core << "\t" << n_total_core << "\t\t" << F(5,3, (float)n_correct_total_core/n_total_core ) << "\t\t"
351  << n_correct_total << "\t" << n_total << "\t\t" << F(5,3, (float)n_correct_total/n_total ) << "\t\tTotal\t"
352  << n_correct_total_surface << "\t" << n_total_surface << "\t\t" << F(5,3, (float)n_correct_total_surface/n_total_surface )
353  << std::endl;
354 
355 
356  // output the sequence substitution file
357  utility::io::ozstream matrixFile( option[ sequence_recovery::sub_matrix_filename ].value() ) ; //defaults to submatrix.txt
358 
359  // write the header
360  matrixFile << "AA_TYPE" << "\t" ;
361  for ( Size ii = 1; ii <= chemical::num_canonical_aas; ++ii ) {
362  matrixFile << "nat_"<<chemical::name_from_aa( chemical::AA(ii) ) << "\t";
363  }
364  matrixFile<<std::endl;
365 
366  // now write the numbers
367  for ( Size ii = 1; ii <= chemical::num_canonical_aas; ++ii ) { //redesigns
368  matrixFile << "sub_" << chemical::name_from_aa( chemical::AA(ii) );
369  for ( Size jj = 1; jj <= chemical::num_canonical_aas; ++jj ) { //natives
370  //std::cout<<"Native: "<< jj << " Sub: " << ii << " Value: "<<sub_matrix( jj, ii ) << std::endl;
371  matrixFile<< "\t" << sub_matrix( jj, ii );
372  }
373  matrixFile << std::endl;
374  }
375 
376  // ///output the sequence substitution file with percent of native recovered
377  // utility::io::ozstream matrixFileratio( "submatrix.ratio.txt" ) ; //allow naming later
378  // //write the header
379  // matrixFileratio << "AA_TYPE" << "\t" ;
380  // for ( Size ii = 1; ii <= chemical::num_canonical_aas; ++ii ) {
381  // matrixFileratio << "nat_"<<chemical::name_from_aa( chemical::AA(ii) ) << "\t";
382  // }
383  // matrixFileratio<<std::endl;
384 
385  // //now write the numbers
386  // for ( Size ii = 1; ii <= chemical::num_canonical_aas; ++ii ) { //redesigns
387  // matrixFileratio << "sub_" << chemical::name_from_aa( chemical::AA(ii) );
388  // for ( Size jj = 1; jj <= chemical::num_canonical_aas; ++jj ) { //natives
389  // //std::cout<<"Native: "<< jj << " Sub: " << ii << " Value: "<<sub_matrix( jj, ii ) << std::endl;
390  // matrixFileratio<< "\t"<< F(4,2, (float)sub_matrix( jj, ii )/sub_matrix( jj, jj ) );
391  // }
392  // matrixFileratio << std::endl;
393  // }
394 
395 }
396 
397 
398 //@brief method which contains logic for calculating rotamer recovery. not implemented.
400 
401 
402 //@brief main method for the sequence recovery protocol
403 int main( int argc, char* argv[] ) {
404 
405  try {
406 
409 
410  option.add( sequence_recovery::native_pdb_list, "List of pdb files of the native structures." );
411  option.add( sequence_recovery::redesign_pdb_list, "List of pdb files of the redesigned structures." );
412  option.add( sequence_recovery::parse_taskops_file, "XML file which contains task operations to apply before measuring recovery (optional)" );
413  option.add( sequence_recovery::rotamer_recovery, "Compare the rotamer recovery instead of sequence recovery." ).def( false );
414  option.add( sequence_recovery::seq_recov_filename, "Name of file for sequence recovery output." ).def("sequencerecovery.txt");
415  option.add( sequence_recovery::sub_matrix_filename, "Name of file substitution matrix output." ).def("submatrix.txt");
416  option.add( sequence_recovery::se_cutoff, "Integer for how many nbs a residue must have less than or equal to to be considered surface exposed." ).def( 16 );
417 
418 
419  devel::init( argc, argv );
420 
421  // changing this so that native_pdb_list and redesign_pdb_list do not have default values. giving these options can lead
422  // to users measuring recovery against the wrong set of PDBs.
424  init_usage_prompt( argv[0] );
426  }
427 
428  // read list file. open the file specified by the flag 'native_pdb_list' and read in all the lines in it
429  std::vector< FileName > native_pdb_file_names;
430  std::string native_pdb_list_file_name( option[ sequence_recovery::native_pdb_list ].value() );
431  std::ifstream native_data( native_pdb_list_file_name.c_str() );
432  std::string native_line;
433  if ( !native_data.good() ) {
434  utility_exit_with_message( "Unable to open file: " + native_pdb_list_file_name + '\n' );
435  }
436  while ( getline( native_data, native_line ) ) {
437  native_pdb_file_names.push_back( FileName( native_line ) );
438  }
439 
440  native_data.close();
441 
442  // read list file. open the file specified by the flag 'redesign_pdb_list' and read in all the lines in it
443  std::vector< FileName > redesign_pdb_file_names;
444  std::string redesign_pdb_list_file_name( option[ sequence_recovery::redesign_pdb_list ].value() );
445  std::ifstream redesign_data( redesign_pdb_list_file_name.c_str() );
446  std::string redesign_line;
447  if ( !redesign_data.good() ) {
448  utility_exit_with_message( "Unable to open file: " + redesign_pdb_list_file_name + '\n' );
449  }
450  while ( getline( redesign_data, redesign_line ) ) {
451  redesign_pdb_file_names.push_back( FileName( redesign_line ) );
452  }
453  redesign_data.close();
454 
455  // check that the vectors are the same size. if not error out immediately.
456  if ( native_pdb_file_names.size() != redesign_pdb_file_names.size() ) {
457  utility_exit_with_message( "Size of native pdb list file: " + native_pdb_list_file_name + " does not equal size of redesign pdb list: " + redesign_pdb_list_file_name + "!\n" );
458  }
459 
460  // iterate over both FileName vector and read in the PDB files
461  utility::vector1< pose::Pose > native_poses;
462  utility::vector1< pose::Pose > redesign_poses;
463 
464  std::vector< FileName >::iterator native_pdb( native_pdb_file_names.begin() ), native_last_pdb(native_pdb_file_names.end());
465  std::vector< FileName >::iterator redesign_pdb( redesign_pdb_file_names.begin() ), redesign_last_pdb(redesign_pdb_file_names.end());
466 
467  while ( ( native_pdb != native_last_pdb ) && ( redesign_pdb != redesign_last_pdb ) ) {
468 
469  // check to make sure the file exists
470  if ( !file_exists( *native_pdb ) ) {
471  utility_exit_with_message( "Native pdb " + std::string(*native_pdb) + " not found! skipping" );
472  }
473  if ( !file_exists( *redesign_pdb ) ) {
474  utility_exit_with_message( "Redesign pdb " + std::string(*redesign_pdb) + " not found! skipping" );
475  }
476 
477  TR << "Reading in poses " << *native_pdb << " and " << *redesign_pdb << std::endl;
478  core::pose::Pose native_pose, redesign_pose;
479  core::import_pose::pose_from_pdb( native_pose, *native_pdb );
480  core::import_pose::pose_from_pdb( redesign_pose, *redesign_pdb );
481 
482  native_poses.push_back( native_pose ); redesign_poses.push_back( redesign_pose );
483  native_pdb++; redesign_pdb++;
484  }
485 
486 
488  TR << "Measuring rotamer recovery" << std::endl;
489  measure_rotamer_recovery( native_poses, redesign_poses );
490  } else {
491  TR << "Measuring sequence recovery" << std::endl;
492  measure_sequence_recovery( native_poses, redesign_poses );
493  }
494  } catch ( utility::excn::EXCN_Base const & e ) {
495  std::cout << "caught exception " << e.msg() << std::endl;
496  return -1;
497  }
498 
499 }
500 
#define utility_exit_with_message(m)
Exit with file + line + message.
Definition: exit.hh:47
#define utility_exit_with_message_status(m, s)
Exit with file + line + message + status.
Definition: exit.hh:60
#define THREAD_LOCAL
core::pack::task::TaskFactoryOP setup_tf(core::pack::task::TaskFactoryOP task_factory_)
load custom TaskOperations according to an xml-like utility::tag file
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
Automatic hidden index key for integer options.
BooleanOptionKey const native_sequence("usec::native_sequence")
FileOptionKey const native_pdb_list("sequence_recovery::native_pdb_list")
utility::keys::KeyLookup< KeyType >::const_iterator const_iterator
Key collection iterators.
vector0: std::vector with assert-checked bounds
void measure_rotamer_recovery(utility::vector1< core::pose::Pose > &, utility::vector1< core::pose::Pose > &)
std::istream & getline(std::istream &stream, Fstring &s)
Get Line from Stream.
Definition: Fstring.cc:1610
void init(int argc, char *argv[])
Command line init() version.
Definition: init.cc:23
BooleanOptionKey const user("options:user")
Definition: OptionKeys.hh:40
core::pose::Pose Pose
Definition: supercharge.cc:101
utility::keys::lookup::end< KeyType > const end
Automatic hidden index key for file options.
IntegerOptionKey const se_cutoff("sequence_recovery::se_cutoff")
int main(int argc, char *argv[])
Automatic hidden index key for string options.
Platform independent operations on files (except I/O)
BooleanOptionKey const rotamer_recovery("sequence_recovery::rotamer_recovery")
File name class supporting Windows and UN*X/Linux format names.
Definition: FileName.hh:37
StringOptionKey const seq_recov_filename("sequence_recovery::seq_recov_filename")
common derived classes for thrown exceptions
tuple scorefxn
Definition: PyMOL_demo.py:63
StringOptionKey const sub_matrix_filename("sequence_recovery::sub_matrix_filename")
member1 value
Definition: Tag.cc:296
FileOptionKey const redesign_pdb_list("sequence_recovery::redesign_pdb_list")
Tracer IO system.
super::iterator iterator
Definition: vector1.hh:61
Automatic hidden index key for boolean options.
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
std::string usage_string
FileOptionKey const parse_taskops_file("sequence_recovery::parse_taskops_file")
general-purpose store for any reference-count derived object
Definition: DataMap.hh:36
Output file stream wrapper for uncompressed and compressed files.
void measure_sequence_recovery(utility::vector1< core::pose::Pose > &native_poses, utility::vector1< core::pose::Pose > &redesign_poses)
iterates over all designed positions and determines identity to native. outputs recoveries to file...
std::string F(int const w, int const d, float const &t)
Fixed Point Format: float.
Definition: format.cc:387
void fill_num_neighbors(pose::Pose &pose, utility::vector1< core::Size > &num_nbs)
helper method which uses the tenA nb graph in the pose object to fill a vector with nb counts ...
static THREAD_LOCAL basic::Tracer TR("sequence_recovery")
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
Definition: Tracer.hh:134
bool file_exists(std::string const &path)
Does File Exist?
std::set< Size > fill_designable_set(pose::Pose &pose, pack::task::TaskFactoryOP &tf)
return the set of residues that are designable based given pose
ozstream: Output file stream wrapper for uncompressed and compressed files
Definition: ozstream.hh:53
void init_usage_prompt(std::string exe)
platform::Size Size
Definition: random.fwd.hh:30
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378
FArray2D: Fortran-Compatible 2D Array.
Definition: FArray2.hh:27