Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TemplateFragmentClaimer.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 TopologyBroker
11 /// @brief top-class (Organizer) of the TopologyBroker mechanism
12 /// @detailed responsibilities:
13 /// @author Oliver Lange
14 
15 // Unit Headers
17 
18 // Package Headers
21 
22 // Project Headers
23 #include <core/pose/Pose.hh>
25 #include <core/fragment/FragSet.hh>
29 // AUTO-REMOVED #include <protocols/jumping/JumpSetup.hh>
31 #include <basic/options/keys/templates.OptionKeys.gen.hh>
32 
33 // ObjexxFCL Headers
34 
35 // Utility headers
36 //#include <utility/io/izstream.hh>
37 //#include <utility/io/ozstream.hh>
38 //#include <utility/io/util.hh>
39 #include <basic/Tracer.hh>
40 #include <basic/options/option.hh>
41 
43 #include <utility/vector1.hh>
44 
45 
46 //// C++ headers
47 
48 // option key includes
49 
50 static basic::Tracer tr("protocols.topo_broker",basic::t_info);
51 //static numeric::random::RandomGenerator RG(18828234);
52 
53 namespace protocols {
54 namespace topology_broker {
55 
56 using namespace core;
57 
58 TemplateFragmentClaimer::TemplateFragmentClaimer() : frag_size_( 9 ), config_file_( "NoFile" )
59 {}
60 
62  : FragmentClaimer( NULL, "template-frags", weight ),
63  frag_size_( fragsize )
64 {
65  read_config_file( config_file );
66 }
67 
69  templates_ = new abinitio::Templates( file /*native_pose_*/ );
70  //templates_->target_sequence() = sequence_; // a hack until class SequenceMapping works better
71  // want to pick fragments from templates... make sure they are not initialized yet
72  // runtime_assert( !fragset_large_ );
73 
74  if( !templates_->is_good() ){
75  utility_exit_with_message("ERROR occured during template setup. check BAD_SEQUENCES file!");
76  }
77 
79  Size nr = templates_->pick_frags( *fragset_large, new fragment::FragData( new fragment::BBTorsionSRFD, frag_size_ ) );
80  tr.Info << nr << " " << fragset_large->max_frag_length() << "mer fragments picked from homolog structures" << std::endl;
81  set_mover( new simple_moves::ClassicFragmentMover( fragset_large ) );
82 }
83 
84 bool TemplateFragmentClaimer::read_tag( std::string tag, std::istream& is ) {
85  if ( tag == "FILE" ) {
86  is >> config_file_;
87  } else if ( tag == "FRAG_SIZE" ) {
88  is >> frag_size_;
89  } else if ( tag == "MOVER_WEIGHT" ) {
90  read_mover_weight( is );
91  } else if ( tag == "CMD_FLAG" ) {
92  if ( basic::options::option[ basic::options::OptionKeys::templates::config ].user() ) { //read from cmd-flag if not set explicitly
93  config_file_ = basic::options::option[ basic::options::OptionKeys::templates::config ]();
94  }
95  } else return FragmentClaimer::read_tag( tag, is );
96  return true;
97 }
98 
100  if ( config_file_ != "NoFile" ) {
102  }
103  if ( !templates_ ) {
104  throw EXCN_Input( "TemplateFragmentClaimer not initialized properly, use CMD_FLAG and -templates:config or FILE configfile" );
105  }
106 }
107 
108 
109 } //topology_broker
110 } //protocols