Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RemodelWorkingSet.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 // CVS information:
4 // $Revision: 13011 $
5 // $Date: 2007-02-21 17:17:13 -0800 (Wed, 21 Feb 2007) $
6 // $Author: possu $
7 
8 // Rosetta Headers
9 #include <basic/Tracer.hh>
10 #include <core/pose/Pose.hh>
11 //test
12 // AUTO-REMOVED #include <core/pose/PDBPoseMap.hh>
13 // AUTO-REMOVED #include <core/pose/PDBInfo.hh>
15 //#include <devel/remodel/helpMenu.hh>
16 
17 //for DSSP
18 // AUTO-REMOVED #include <core/scoring/dssp/Dssp.hh>
19 
20 #include <basic/options/option.hh>
21 #include <basic/options/keys/OptionKeys.hh>
22 #include <basic/options/keys/remodel.OptionKeys.gen.hh>
23 
24 //fragset
25 //#include <core/fragment/OrderedFragSet.hh>
26 
29  // for switch typeset
30 
31 // for yab managers
35 //#include <devel/fragment/picking/vall/util.hh> // pick_fragment_by_ss
38 
39 // for resfile command map
43 
44 /*
45 //yab headers
46 #include "AtomPoint.hh"
47 #include "BoundingBox.hh"
48 #include "epigraft_functions.hh"
49 #include "Octree.hh"
50 #include "rootstock_types.hh"
51 #include "ccd_functions.hh"
52 */
53 // ObjexxFCL Headers
54 // AUTO-REMOVED #include <ObjexxFCL/FArray1D.hh>
55 #include <ObjexxFCL/FArray2D.hh>
56 //#include <ObjexxFCL/FArray3D.hh>
57 //#include <ObjexxFCL/FArray4D.hh>
58 //#include <ObjexxFCL/FArray5D.hh>
59 //#include <ObjexxFCL/format.hh>
60 //#include <ObjexxFCL/string.functions.hh>
61 
62 
63 // C++ Headers
64 #include <algorithm>
65 #include <cmath>
66 #include <cstdlib>
67 #include <iostream>
68 #include <sstream>
69 // AUTO-REMOVED #include <fstream>
70 #include <vector>
71 #include <string>
72 #include <list>
73 #include <map>
74 #include <set>
75 
76 
77 // Utility Headers
78 // AUTO-REMOVED #include <utility/basic_sys_util.hh>
79 // AUTO-REMOVED #include <utility/io/izstream.hh>
80 // AUTO-REMOVED #include <utility/io/ozstream.hh>
81 // AUTO-REMOVED #include <utility/io/ocstream.hh>
82 // AUTO-REMOVED #include <utility/file/file_sys_util.hh>
83 #include <utility/vector1.hh>
84 
85 // AUTO-REMOVED #include <core/chemical/AtomType.hh>
89 #include <core/kinematics/Jump.hh>
90 
91 
92 
93 //////////////// REMODEL
94 
95 namespace protocols{
96 namespace forge{
97 namespace remodel{
98 
99 static basic::Tracer TR("REMODELw");
100 
101 /// @brief copy constructor
103  loops( rval.loops ),
104  translate_index( rval.translate_index ),
105  begin( rval.begin ),
106  end (rval.end ),
107  copy_begin( rval.copy_begin ),
108  copy_end (rval.copy_end ),
109  src_begin (rval.src_begin),
110  src_end (rval.src_end),
111  manager( rval.manager ),
112  task( rval.task ),
113  rvjump_pose( rval.rvjump_pose)
114 {
115  sequence = rval.sequence;
116  ss = rval.ss;
117  abego = rval.abego;
118  hasInsertion = rval.hasInsertion;
119 }
120 
122  if (this != & rval) {
123  loops = rval.loops ;
124  sequence = rval.sequence;
125  ss = rval.ss;
126  abego = rval.abego;
128  begin = rval.begin ;
129  end = rval.end;
130  copy_begin = rval.copy_begin ;
131  copy_end = rval.copy_end ;
132  src_begin = rval.src_begin;
133  src_end = rval.src_end;
134  hasInsertion = rval.hasInsertion;
135  manager = rval.manager;
136  task = rval.task ;
137  rvjump_pose = rval.rvjump_pose;
138  }
139  return *this;
140 }
141 
142 
143 
144 
145 
146 void
148  core::pose::Pose const & input_pose,
150 ) {
151  using namespace basic::options;
152  //core::util::switch_to_residue_type_set( input_pose, core::chemical::CENTROID );
153 
154  //find rebuilding segments
155  int model_length = (int)data.sequence.size();
156  bool NtermExt = false;
157  bool CtermExt = false;
158  //bool length_changed = false;
159 
160  // copy ss/seq from RemodelData so it can be passed elsewhere later
161  this->ss = data.dssp_updated_ss;
162  this->abego = data.abego;
163 
164  //this is purely experimental for matching fragment set
165  if (option[ OptionKeys::remodel::repeat_structure].user()){
166  this->ss.append(this->ss);
167  this->abego.append(this->abego);
168  } else {
169  //this->ss.append("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD");
170  }
171 
172  this->sequence = data.sequence;
173 
174  //find N term extension, if any
175  std::string Xs = "xX";
176  int first_ext;
177  first_ext = (int)data.sequence.find_first_of(Xs);
178  if (first_ext == 0){
179  NtermExt = true;
180  std::cout << "N-terminal is extended" << std::endl;
181  }
182  //find C term extension, if any
183  int last_ext;
184  last_ext = (int)data.sequence.find_last_of(Xs);
185  if (last_ext == model_length -1) {
186  std::cout << "C-terminal is extended" << std::endl;
187  // if C-term extension, add extra degenerate ss type to get fragments past last res.
188 
189  CtermExt = true;
190  }
191 
192  if (data.blueprint[model_length-1].index != data.blueprint[model_length-1].original_index) {
193  //length_changed = true; set but never used ~Labonte
194  std::cout << "length change found" << std::endl;
195  }
196 
197  //this is needed for manipulating denovo cases, as they are coded as Cterm
198  //extensions. Affects SegmentRebuld selections.
199  if (option[ OptionKeys::remodel::repeat_structure].user() && CtermExt){
200  model_length = model_length * 2;
201  }
202 
203 
204  // find all the indices.
205  //identify truncation
206  // for all the positions that are not extensions "x" or "X", put them in the
207  // temp_for_truncation vector -- this corresponds to all the regions need to
208  // be copied from the original pdb with deletions included. fragment_pdb
209  // requires a boolean vector that correspond to the length of the original
210  // pdb, so initializes a "keep" vector of that size and set values to false.
211  // As we iterate over the template_for_truncation, all the positions seen by
212  // this iterative step are kept. Because the truncated_pose is renumbered, we
213  // also initializes a translate_index map to link the truncated index to the
214  // original index.
215 
216  std::vector<protocols::forge::remodel::LineObject> temp_for_truncation; // collection of positions to copy from original pdb
217  //std::cout << input_pose.total_residue() << std::endl;
218  utility::vector1<bool> keep(input_pose.total_residue(),false);
219  for (int i = 0, ie=(int)data.blueprint.size(); i < ie ; i++){ // loop to extract positions to keep
220  if (data.blueprint[i].resname != "x" && data.blueprint[i].resname != "X"){
221  temp_for_truncation.push_back(data.blueprint[i]);
222  // std::cout << data.blueprint[i].resname << data.blueprint[i].original_index << std::endl;
223  }
224  }
225  //std::map<int,int> translate_index; // moved to object data
226  for (int i = 0, ie = (int)temp_for_truncation.size(); i < ie; i++){ // loop to update keep vector according to what's found
227  keep[temp_for_truncation[i].original_index] = true;
228  // std::cout << temp_for_truncation[i].original_index << std::endl;
229  if (temp_for_truncation[i].original_index != 0){ // correct for the use of "0" in marking extensions, original index should start from 1
230  translate_index[temp_for_truncation[i].original_index] = i+1; // one based translation
231  }
232  }
233 
234  std::vector<protocols::forge::remodel::LineObject> temp_for_copy;
235  std::vector<protocols::forge::remodel::LineObject> temp;
236  std::vector<protocols::forge::remodel::Segment> segmentStorageVector;
237  std::vector<protocols::forge::remodel::Segment> segment_to_copyVector;
238  std::vector<protocols::forge::remodel::Segment> segment_to_copyNewIndex;
239  for (int i = 0, ie = (int)data.blueprint.size(); i < ie; i++){
240  if (data.blueprint[i].sstype != ".") { // first find the segments to be remodeled
241  temp.push_back(data.blueprint[i]);
242  }
243  else if (data.blueprint[i].sstype == "."){ // parts to be copied
244  temp_for_copy.push_back(data.blueprint[i]);
245  }
246  else {
247  std::cout << "assignment error" << std::endl;
248  }
249  }
250 
251  if (option[ OptionKeys::remodel::repeat_structure].user()){ // repeat structure loop over a second time; merge sections and update index
252  //need to know the original index of the last element, for building
253  //extensions or deletions across jxn points
254  LineObject lastLO = data.blueprint.back();
255 
256  bool denovo = true;
257  //have to loop to identify denovo case
258  for (int i = 0, ie = (int)data.blueprint.size(); i < ie; i++){
259  if (data.blueprint[i].sstype == "."){ //if anywhere hits this assignment, not de novo
260  denovo = false;
261  }
262  }
263 
264  for (int i = 0, ie = (int)data.blueprint.size(); i < ie; i++){
265  if (data.blueprint[i].sstype != ".") { // first find the segments to be remodeled
266  LineObject LO = data.blueprint[i];
267  //update indeces
268  LO.index = LO.index + (int)data.blueprint.size();
269  if (LO.original_index != 0){ //in de novo case, the extension uses 0, don't increment.
271  }
272  else if (LO.original_index == 0 && !denovo){
273  LO.original_index = LO.original_index + (int)data.blueprint.size();
274  }
275  else {
276  // de novo case don't increment
277  }
278 
279  //TR << "LO object second time " << LO.index << " " << LO.original_index << std::endl;
280  temp.push_back(LO);
281  }
282  else if (data.blueprint[i].sstype == "."){ // parts to be copied
283  //not needed here
284  }
285  else {
286  std::cout << "assignment error" << std::endl;
287  }
288  }
289  }
290 
291  //save the first non-rebuilt position for potentially rooting a tree.
292  if ( !temp_for_copy.empty() ){
293  safe_root_ = temp_for_copy.front().index;
294  }else {
295  safe_root_ = 1;
296  }
297 
298 
299  //break up temp into small segments
301  for (int i = 0, ie = (int)temp.size()-1; i < ie ; i++) { // compare the (i)-th and (i+1)-th element to find contiguous segments
303  protocols::forge::remodel::LineObject next = temp[i+1];
304  if (next.index == (first.index+1)) {
305  segment.residues.push_back(first.index);
306  // std::cout << first.index ;
307  if (i+1 == (int)temp.size()-1){ // if reaching the end of the last segment
308  // std::cout << "next:" << next.index << std::endl;
309  segment.residues.push_back(next.index);
310  segmentStorageVector.push_back(segment);
311  segment.residues.clear();
312  }
313  }
314  else if (next.index != first.index+1 && (i+1) == (int)temp.size()-1 ){ //if there's a loner in the end by itself
315  segment.residues.push_back(first.index);
316  segmentStorageVector.push_back(segment);
317  segment.residues.clear();
318  segment.residues.push_back(next.index);
319  segmentStorageVector.push_back(segment);
320  segment.residues.clear();
321  }
322  else {
323  segment.residues.push_back(first.index);
324  if (i+1 == (int)temp.size()-1){ // if reaching the end of the last segment
325  segment.residues.push_back(next.index);
326  segmentStorageVector.push_back(segment);
327  segment.residues.clear();
328  }
329  // std::cout << first.index << std::endl;
330  segmentStorageVector.push_back(segment);
331  segment.residues.clear();
332  }
333  }
334 
335  //test only
336 
342  typedef std::string String;
343  typedef core::Size Size;
344 
349  using core::fragment::Frame;
351  using namespace basic::options;
352 
353  SegmentInsertOP segIns;
354 
355  //first get insertion index
356 
357  Size insertStartIndex =0;
358  Size insertEndIndex =0;
359  if (option[OptionKeys::remodel::domainFusion::insert_segment_from_pdb].user()){
360  TR << "Processing insertion SS info..." << std::endl;
361  insertStartIndex = data.dssp_updated_ss.find_first_of("I");
362  insertEndIndex = data.dssp_updated_ss.find_last_of("I");
363  TR << "debug: insertStartIndex: " << insertStartIndex << " insertEndIndex: " << insertEndIndex << std::endl;
364  //process ss_string
365  // String beforeInsert = data.dssp_updated_ss.substr(0, insertStartIndex);
366  // String afterInsert = data.dssp_updated_ss.substr(insertEndIndex+1);
367  // data.ss_string = beforeInsert + data.insertionSS + afterInsert;
368  // TR << ss_string << std::endl;
369 
370  }
371 
372  //set generic aa type before assigning manager tasks.
373 
374  //for now only allow one letter code
375  String build_aa_type = option[OptionKeys::remodel::generic_aa]; //devaults to VAL
376 
377  runtime_assert (build_aa_type.size() == 1);
378 
379  if (option[OptionKeys::remodel::use_blueprint_sequence].user()){
380  for (int i = 0; i < (int)data.blueprint.size(); i++){
381  if ( data.blueprint[i].resname.compare("x") == 0 || data.blueprint[i].resname.compare("X") == 0 ){
382  aa.append(build_aa_type);
383  }
384  else {
385  aa.append( data.blueprint[i].resname );
386  }
387  }
388  // runtime_assert( aa.size() == data.dssp_updated_ss.size());
389 
390  if (option[OptionKeys::remodel::repeat_structure].user()){
391  String monomer_seq = aa;
392  Size copies = option[OptionKeys::remodel::repeat_structure];
393  while (copies > 1){ //first copy already made
394  aa.append( monomer_seq );
395  copies--;
396  }
397  //runtime_assert( aa.size() == data.dssp_updated_ss.size());
398  }
399  } else {
400  if ( build_aa_type.compare("A") != 0){
401  //build the aa string to be the same length as dssp updated ss
402  //use that length because repeat structures are bigger than blueprint
403  for (int i = 1; i<= (int)data.dssp_updated_ss.size(); i++){
404  aa.append(build_aa_type);
405  }
406  }
407  }
408 
409 
410  //debug
411  std::cout << "AA for build: " << aa << std::endl;
412 
413  //BuildManager manager;
414 
415  // find the begin and end index
416  for (int i = 0, ie = (int)segmentStorageVector.size(); i < ie ; i++){
417  this->begin.push_back(segmentStorageVector[i].residues.front());
418  this->end.push_back(segmentStorageVector[i].residues.back());
419 
420  core::Size idFront = segmentStorageVector[i].residues.front();
421  core::Size idBack = segmentStorageVector[i].residues.back();
422  core::Size seg_size = (int)data.blueprint.size();
423  //core::Size rep_number = option[ OptionKeys::remodel::repeat_structure];
424  std::string DSSP = data.dssp_updated_ss;
425 
426  // I don't know what happens when one assigns -1 to a Size, but this needs to be fixed. ~Labonte
427  core::Size head = -1, tail = -1, headNew = -1, tailNew = -1; //safety, init to negative values
428 
429  //use temp_For_copy to identify if it's de novo build; not empty means it's a loop case.
430  if ( option[ OptionKeys::remodel::repeat_structure].user() && !temp_for_copy.empty()) {
431  //duplicate length of dssp and aastring
432  DSSP += DSSP;
433  aa += aa;
434 
435  if (idFront > seg_size && idBack > seg_size){ //ignore this type of assigment in repeat structures
436  continue;
437  /*
438  if (idBack == 2*seg_size){ // can't hit the final residue in repeat unit pose
439  idBack = idBack-1;
440  }
441  head = data.blueprint[ idFront-seg_size-1 ].original_index + seg_size;
442  tail = data.blueprint[ idBack-seg_size-1 ].original_index + seg_size;
443  headNew = data.blueprint[ idFront-seg_size-1 ].index + seg_size;
444  tailNew = data.blueprint[ idBack-seg_size-1 ].index + seg_size;
445  */
446  }
447  else if (idFront <= seg_size && idBack > seg_size){ //spanning across repeat, adjust the tail
448  if (idBack == 2*seg_size){ // can't hit the final residue in repeat unit pose
449  idBack = idBack-1;
450  }
451  head = data.blueprint[ idFront-1 ].original_index;
452  tail = data.blueprint[ idBack-seg_size-1 ].original_index + data.blueprint.back().original_index;
453  if (data.blueprint.back().original_index == 0){ //an extension
454  tail = data.blueprint[ idBack-seg_size-1 ].original_index + seg_size;
455  }
456  headNew = data.blueprint[ idFront-1 ].index;
457  tailNew = data.blueprint[ idBack-seg_size-1 ].index + seg_size;
458  } else { //normal build in the first segment
459  head = data.blueprint[ idFront-1 ].original_index;
460  tail = data.blueprint[ idBack-1 ].original_index;
461  headNew = data.blueprint[ idFront-1 ].index;
462  tailNew = data.blueprint[ idBack-1 ].index;
463  }
464  } else if ( option[ OptionKeys::remodel::repeat_structure].user() && temp_for_copy.empty()) { //de novo case
465  //std::cout << "idFront " << idFront << " idBack " << idBack << std::endl;
466  Size range_limit = data.blueprint.size();
467  if (idBack >= range_limit){ // can't assign beyond blueprint definition, as indices are missing as extensions
468  idFront = 1;
469  idBack = range_limit;
470  head = data.blueprint[ idFront-1 ].original_index;
471  tail = data.blueprint[ idBack-1 ].original_index;
472  headNew = data.blueprint[ idFront-1 ].index;
473  tailNew = data.blueprint[ idBack-1 ].index;
474  }
475  } else {
476  head = data.blueprint[ idFront-1 ].original_index;
477  tail = data.blueprint[ idBack-1 ].original_index;
478  headNew = data.blueprint[ idFront-1 ].index;
479  tailNew = data.blueprint[ idBack-1 ].index;
480  }
481 
482  int gap = idBack - idFront +1;
483 
484  //debug
485  //TR << "dssp size: " << data.dssp_updated_ss.size() << std::endl;
486  TR << "head " << head << ":" << headNew << " tail " << tail << ":" << tailNew << " gap " << gap << " ss " << DSSP.size() << " " << DSSP.substr( headNew-1, gap ) << std::endl; // head -1 because dssp_updated_ss is 0 based std::string
487 
488  this->loops.add_loop(segmentStorageVector[i].residues.front(), segmentStorageVector[i].residues.back(), segmentStorageVector[i].residues.front()+1, 0, 0);
489 
490  // process regions containing insertion
491  if ( headNew <= insertStartIndex && tailNew >= insertEndIndex && ((insertEndIndex-insertStartIndex) != 0)){
492  TR << "segment contain insertion, skip normal SegmentRebuild instructions, use SegmentInsert instructions instead" << std::endl;
493  String beforeInsert = DSSP.substr(headNew-1, insertStartIndex-head+1);
494  String afterInsert = DSSP.substr(insertEndIndex+1, tailNew-insertEndIndex-1);
495  TR << "DEBUG beforeInsert: " << beforeInsert << std::endl;
496  TR << "DEBUG afterInsert: " << afterInsert << std::endl;
497  String blank;
498  /*
499  for (Size i=1; i<= data.insertionSS.size(); i++){
500  blank.append("^");
501  }*/
502 
503  blank.append("^");
504  std::string insert_SS_string = beforeInsert + blank + afterInsert;
505  TR << "DEBUG insert_SS_string: " << insert_SS_string << std::endl;
506 
508 
509  protocols::forge::build::SegmentInsertConnectionScheme::Enum connection_scheme = N;//default N2C insertion
510  segIns = new SegmentInsert( Interval(head,tail), insert_SS_string , data.insertPose, false /*omega at junction*/, connection_scheme);
511  this->manager.add(segIns);
512  continue;
513  }
514 
515  if (head == 0 && segmentStorageVector[i].residues.front() == 1 ){ // N-term extension
516  TR << "debug: N-term ext" << std::endl;
517  this->manager.add( new SegmentRebuild( Interval(1,tail), DSSP.substr( headNew-1, gap ), aa.substr( headNew-1,gap )) );
518  }
519  else if (tail ==0 && segmentStorageVector[i].residues.back() == model_length){
520  TR << "debug: C-term ext" << std::endl;
521  gap = (int)data.blueprint.size()-segmentStorageVector[i].residues.front()+1;
522  this->manager.add( new SegmentRebuild( Interval(head,input_pose.total_residue()), DSSP.substr( segmentStorageVector[i].residues.front()-1, gap ), aa.substr( segmentStorageVector[i].residues.front()-1, gap )) );
523  }
524  else if (head != 0 && headNew == 1 && segmentStorageVector[i].residues.front() == 1 ){ // N-term deletion
525  TR << "debug: N-term deletion" << std::endl;
526  this->manager.add( new SegmentRebuild( Interval(1,tail), DSSP.substr( headNew-1, gap ), aa.substr( headNew-1,gap )) );
527  }
528  else if (tail != input_pose.total_residue() && tailNew == (Size)model_length && headNew == 1 && segmentStorageVector[i].residues.back() == model_length ){ // C-term deletion
529  gap = (int)data.blueprint.size()-segmentStorageVector[i].residues.front()+1;
530  TR << "debug: C-term deletion" << std::endl;
531  this->manager.add( new SegmentRebuild( Interval(head,input_pose.total_residue()), DSSP.substr( segmentStorageVector[i].residues.front()-1, gap ), aa.substr( segmentStorageVector[i].residues.front()-1, gap )) );
532  } else {
533  TR << "debug: normal rebuild" << std::endl;
534  this->manager.add( new SegmentRebuild( Interval(head, tail), DSSP.substr( headNew-1, gap ), aa.substr( headNew-1, gap )) );
535  }
536  }
537 
538 /*
539 // ConstantLengthFragSetOP frag9( new ConstantLengthFragSet( 9 ) );
540 // ConstantLengthFragSetOP frag3( new ConstantLengthFragSet( 3 ) );
541  OrderedFragSetOP frag1;
542  OrderedFragSetOP fragSet ( new OrderedFragSet );
543 
544  for ( protocols::loops::Loops::iterator itr = this->loops.v_begin(); itr != this->loops.v_end(); itr++){
545 
546  // setup regions
547  // Pick fragments. For now just use the 9-mer, 3-mer
548  // breakdown to get things working. This will be changed
549  // to full-mer/variable length very soon.
550  core::Size length = (*itr).size();
551  //std::cout << "length: " << length << std::endl;
552  for ( core::Size j = 0, je = length; j <= je; ++j ) {
553  TR << "picking " << 200 << " 9-mers for position " << ( (*itr).start() + j ) << std::endl;
554  String ss_sub = ss.substr( (*itr).start() + j - 1, 9 );
555  FrameOP frame = new Frame( (*itr).start() + j, 9 );
556  frame->add_fragment( core::fragment::picking::vall::pick_fragments_by_ss( ss_sub, 200 ) );
557  fragSet->add( frame );
558  }
559 
560 
561  //pick the matching length fragment
562 
563 
564  for ( core::Size j = 0, je = length; j <= je; ++j ) {
565  TR << "picking " << 200 << " matching-mers for position " << ( (*itr).start() + j ) << std::endl;
566  String ss_sub = ss.substr( (*itr).start() + j - 1, length );
567  FrameOP frame = new Frame( (*itr).start() + j, length );
568  frame->add_fragment( core::fragment::picking::vall::pick_fragments_by_ss( ss_sub, 200 ) );
569  fragSet->add( frame );
570  }
571 
572 
573 
574  for ( core::Size j = 0, je = length; j <= je; ++j ) {
575  TR << "picking " << 200 << " 3-mers for position " << ( (*itr).start() + j ) << std::endl;
576  String ss_sub = ss.substr( (*itr).start() + j - 1, 3 );
577  FrameOP frame = new Frame( (*itr).start() + j, 3 );
578  frame->add_fragment( core::fragment::picking::vall::pick_fragments_by_ss( ss_sub, 200 ) );
579  fragSet->add( frame );
580  }
581 
582 
583  // make 1-mers from 3-mers
584  frag1 = protocols::forge::components::smallmer_from_largemer( fragSet->begin(), fragSet->end(), 1 );
585  }
586 
587 
588  // Init VLB. Be aware this is a bootstrap implementation, even
589  // remotely sane results are not guaranteed. To get things pinned
590  // down with the proper implementation and benchmarked is going to
591  // take some time.
592 #if defined GL_GRAPHICS
593  protocols::viewer::add_conformation_viewer( model_pose.conformation(), "Remodel Test" );
594 #endif
595  manager.modify(model_pose);
596  //TR<< model_pose.psi(242)<< std::endl;
597  //vlb.apply( model_pose );
598 
599  // setup loop building protocol
600  protocols::loops::LoopMover_Perturb_QuickCCD_Moves loop_mover( this->loops, false );
601  loop_mover.set_strict_loops(true);
602  //loop_mover.add_fragments( frag9 );
603  loop_mover.add_fragments( fragSet );
604  //loop_mover.add_fragments( frag3 );
605  loop_mover.add_fragments( frag1 );
606 
607  // Run loop modeling. The loop movers return the original fold tree
608  // after apply(). Do we want that...? There's also no good way to
609  // check that the loop mover actually finished with a closed loop,
610  // which is troubling. For now we work around this by post-evaluating
611  // the chainbreak at the original cutpoint.
612  loop_mover.apply( model_pose );
613 
614  model_pose.dump_pdb("test_vlb.pdb");
615 */
616  return;
617 }
618 
619 void
621 {
622 // this->task = core::pack::task::TaskFactory::create_packer_task( built_pose );
623 
625 
626  //if need more operations added, put them here.
627  //
628 
629  //create the real task
630  this->task = TF->create_task_and_apply_taskoperations( built_pose );
631 
632  //core::pose::PDBPoseMap map(built_pose.pdb_info()->pdb2pose());
633  //TR << map.find(' ',1,' ') << "PDBPosemap" << std::endl;
634  core::pack::task::parse_resfile_string( built_pose, *this->task, data.parsed_string_for_resfile );
635 }
636 
637 } //namespace remodel
638 } //namespace forge
639 } //namespace protocols