33 #include <basic/options/option.hh>
34 #include <basic/options/keys/abinitio.OptionKeys.gen.hh>
35 #include <basic/options/keys/frags.OptionKeys.gen.hh>
36 #include <basic/options/keys/in.OptionKeys.gen.hh>
37 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
40 #include <utility/io/izstream.hh>
41 #include <basic/Tracer.hh>
51 #include <utility/vector1.hh>
52 #include <basic/options/keys/broker.OptionKeys.gen.hh>
55 static basic::Tracer
tr(
"protocols.topo_broker",basic::t_info);
58 namespace topology_broker {
60 using namespace utility::excn;
62 using namespace core::fragment;
74 while ( is >> file ) {
75 if ( file[0] ==
'#' ) {
79 if ( file ==
"NTOP" ) {
83 }
else if ( file ==
"NCOPY" ) {
87 }
else if ( file ==
"ANNOTATE" ) {
101 using namespace core::fragment;
102 using namespace basic::options;
104 while ( is >> tag ) {
105 if ( tag[ 0 ]==
'#' ) {
108 }
else if ( tag ==
"USE_INPUT_POSE" ) {
110 }
else if ( tag ==
"NO_USE_INPUT_POSE" ) {
112 }
else if ( tag ==
"CLAIMER" ) {
115 tr.Debug <<
"instantiate CLAIMER: " << claim_type << std::endl;
120 }
else if ( tag ==
"ABINITIO_FRAGS" ) {
121 tr.Debug <<
"install Abinitio fragments " << std::endl;
125 while ( is >> tag && tag.substr(0,4) !=
"END_" ) {
126 if ( tag ==
"LARGE" ) {
127 FragmentIO frag_io(option[ OptionKeys::abinitio::number_9mer_frags ](),
128 option[ OptionKeys::frags::nr_large_copies ](),
129 option[ OptionKeys::frags::annotate ]() );
131 }
else if ( tag ==
"SMALL" ) {
132 FragmentIO frag_io(option[ OptionKeys::abinitio::number_3mer_frags ](),
134 option[ OptionKeys::frags::annotate ]() );
136 }
else if ( tag[0] ==
'#' ) {
141 throw utility::excn::EXCN_BadInput(
" unrecognized tag " + tag );
147 utility::io::izstream is;
148 if ( file !=
"NO_SETUP_FILE" ) {
150 if ( !is.good() )
throw EXCN_FileNotFound( file );
156 throw EXCN_BadInput( excn.msg() +
" occurred when reading file "+file );
162 using namespace basic::options;
163 using namespace basic::options::OptionKeys;
172 if ( option[ OptionKeys::broker::setup ].user() ) {
173 FileVectorOption& files( option[ OptionKeys::broker::setup ] );
174 for (
Size i = 1; i<= files.size(); ++i ) {
180 if ( !cmdline_data.frags_large || !cmdline_data.frags_small ) {
182 throw utility::excn::EXCN_BadInput(
"expected LARGE and SMALL fragment sets in ABINITIO_FRAGS section or via command line ");
190 broker.
add(
new FragmentClaimer(bml =
new ClassicFragmentMover(cmdline_data.frags_large),
"LargeFrags",
new LargeFragWeight));
191 broker.
add(
new FragmentClaimer(bms =
new ClassicFragmentMover(cmdline_data.frags_small),
"SmallFrags",
new SmallFragWeight));
192 broker.
add(
new FragmentClaimer(sms =
new SmoothFragmentMover (cmdline_data.frags_small,
new GunnCost),
"SmoothFrags",
new SmoothFragWeight));
198 bms->set_end_bias( option[ OptionKeys::abinitio::end_bias ] );
199 bml->set_end_bias( option[ OptionKeys::abinitio::end_bias ] );
200 sms->set_end_bias( option[ OptionKeys::abinitio::end_bias ] );
204 using namespace basic::options::OptionKeys;
206 if ( option[ in::file::fasta ].user() ) {
208 tr.Info <<
"read fasta sequence: " << sequence.size() <<
" residues\n" << sequence << std::endl;
209 }
else if ( option[ in::file::native ].user() ) {
212 sequence = native_pose->sequence();
214 utility_exit_with_message(
"Error: can't read sequence! Use -in::file::fasta sequence.fasta or -in::file::native native.pdb!");
219 if ( !cmdline_data.b_has_constraint_claimer && basic::options::option[ constraints::cst_file ].user() ) {
220 tr.Info <<
"add ConstraintClaimer to account for cmd-line constraints" << std::endl;
223 if ( !cmdline_data.b_has_constraint_claimer && basic::options::option[ constraints::cst_fa_file ].user() ) {
224 tr.Info <<
"add fa ConstraintClaimer to account for cmd-line constraints" << std::endl;