16 #include <basic/options/keys/in.OptionKeys.gen.hh>
17 #include <basic/options/keys/out.OptionKeys.gen.hh>
18 #include <basic/options/keys/packing.OptionKeys.gen.hh>
19 #include <basic/options/keys/pose_metrics.OptionKeys.gen.hh>
20 #include <basic/options/keys/run.OptionKeys.gen.hh>
21 #include <basic/options/keys/ufv.OptionKeys.gen.hh>
22 #include <basic/options/keys/remodel.OptionKeys.gen.hh>
30 #include <core/chemical/ChemicalManager.hh>
31 #include <core/io/pdb/pose_io.hh>
32 #include <core/import_pose/import_pose.hh>
33 #include <core/pose/Pose.hh>
34 #include <core/pose/annotated_sequence.hh>
35 #include <core/scoring/dssp/Dssp.hh>
36 #include <core/scoring/ScoreFunction.hh>
37 #include <core/scoring/ScoreFunctionFactory.hh>
39 #include <protocols/forge/build/ConnectRight.hh>
40 #include <protocols/forge/build/RelativeConnectRight.hh>
41 #include <protocols/forge/build/RelativeSequencePosition.hh>
42 #include <protocols/forge/build/SegmentInsert.hh>
43 #include <protocols/forge/build/SegmentRebuild.hh>
44 #include <protocols/forge/components/BDR.hh>
45 #include <protocols/forge/remodel/RemodelMover.hh>
46 #include <protocols/jd2/JobDistributor.hh>
47 #include <protocols/jd2/JobOutputter.hh>
48 #include <protocols/simple_filters/PoseMetricEvaluator.hh>
49 #include <protocols/viewer/viewers.hh>
50 #include <protocols/moves/PyMolMover.hh>
55 #include <boost/lexical_cast.hpp>
56 #include <boost/tokenizer.hpp>
57 #include <boost/algorithm/string.hpp>
66 using namespace basic::options::OptionKeys;
70 typedef std::vector< OptionKey const * >
KeyVec;
85 std::stringstream usage_stream;
89 <<
"\n\t-database path/to/rosetta/database"
90 <<
"\n\t-s pdb | -silent silent_file read in input PDB file or silent file"
91 <<
"\n\t-pdb_gz | -silent_gz compress output PDB or silent files"
93 <<
"\n\t-remodel:blueprint blueprint_file blueprint file which explains how to run remodel"
95 <<
"\n\t-remodel::num_trajectory number of build trajectories to run (default: 10)"
96 <<
"\n\t-remodel::dr_cycles <int> number of design/refine cycles to run (default: 3)"
98 <<
"\n\t-remodel::quick_and_dirty only do fragment sampling; bypass refinement of final structures which is slow. useful in early stages of design when one wants to sample different loop lengths to find appropriate setup (default: false)"
100 <<
"\n\t-remodel::bypass_fragments skip creation of fragments for remodelling; do refinement only. no extensions or deletions are honored in the blueprint (default: false)"
101 <<
"\n\t-remodel::use_blueprint_sequence find fragments which have the same amino acid sequence and secondary structure as what is specified in the second column of the blueprint file (default: false)"
102 <<
"\n\t-remodel::use_same_length_fragments harvest fragments that match the length of the segment being rebuilt (default: true)"
104 <<
"\n\t-remodel::build_disulf use Remodel to find residue pairs - between the \"build\" and \"landing\" residues - which would make good disulfide bonds (default: false)"
105 <<
"\n\t-remodel::match_rt_limit <float> the score cutoff to use for determining how closely a potential disulfide must match observed disulfide distributions (default: 0.4)"
106 <<
"\n\t-remodel::disulf_landing_range <range> the range within which Remodel attempts to find disulfides for positions in the \"build\" region (default: none)"
108 <<
"\n\t-remodel::use_pose_relax add fast relax to the refinement stage (instead of the default minimization step), but use constraints in a similar way (default: false)"
109 <<
"\n\t-remodel::run_confirmation use kinematic loop closure algorithm for build confirmation (default: false)"
110 <<
"\n\t-remodel::swap_refine_confirm_protocols swap protocols used for refinement and confirmation test; i.e. use kinematic loop closure instead of CCD closure (default: false)"
111 <<
"\n\t-remodel::repeat_structure build identical repeats this many times (default: 1)"
113 <<
"\n\t-symmetry::symmetry_definition text file describing symmetry setup (default: none)"
115 <<
"\n\t-enzdes::cstfile enzyme design constraints file"
116 <<
"\n\t-remodel::cstfilter threshold to put on the atom_pair_constraint score type filter during the centroid build phase refinement (default: 10)"
118 <<
"\n\t-remodel::domainFusion::insert_segment_from_pdb segment PDB file to be inserted into the input structure"
120 <<
"\n\t-remodel::checkpoint turns on checkpointing, for use in preemptive scheduling environments. writes out the best pdbs collected after each design step. (default: false)"
121 <<
"\n\t-remodel::use_clusters specifies whether to perform clustering during structure aggregation (default: false)"
122 <<
"\n\t-remodel::save_top the number of final lowest scoring pdbs to keep (default: 5)"
124 <<
"\n\t-remodel::generic_aa <letter> residue type to use as placeholder during centroid phase (default: V)"
125 <<
"\n\t-remodel::cen_sfxn score function to be used for centroid phase building (default: remodel_cen)"
126 <<
"\n\t-remodel::cen_minimize centroid minimization after fragment building (default: false)"
128 <<
"\n\t-run::chain <letter> chain id of the chain to remodel, if a multichain structure is given (default: -)"
130 <<
"\n\t[-overwrite]"
131 <<
"\n\t[-ignore_unrecognized_res]"
132 <<
"\n\t[-mute core.io core.conformation core.pack core.scoring]"
134 <<
"\n\nPlease see the Rosetta Remodel documentation in the Rosetta Manual for more information, including a list of all available options."
135 <<
"\nhttp://www.rosettacommons.org/manual_guide"
145 using namespace basic::options::OptionKeys;
149 keys.push_back( &run::max_retry_job );
150 keys.push_back( &pose_metrics::neighbor_by_distance_cutoff );
156 using namespace basic::options::OptionKeys;
160 keys.push_back( &in::file::vall );
161 keys.push_back( &remodel::blueprint);
163 keys.push_back( &out::pdb_gz );
165 keys.push_back( &out::silent_gz );
167 keys.push_back( &out::file::o );
169 keys.push_back( &out::file::silent_struct_type );
185 bool flags_ok =
true;
187 flags_ok &=
option[ **i ].specified_report();
195 using namespace basic::options::OptionKeys;
196 using core::pose::annotated_to_oneletter_sequence;
199 bool flags_ok =
true;
201 if (
option[ run::max_retry_job ] < 0 ) {
203 TR.
Fatal <<
"run:max_retry_job must be positive!" << std::endl;
213 protocols::forge::components::BDR & bdr,
217 using namespace basic::options::OptionKeys;
220 using protocols::forge::build::BuildInstructionOP;
221 using protocols::forge::build::Interval;
222 using protocols::forge::build::SegmentRebuild;
223 using std::istringstream;
228 String ss, aa_during_build, aa_during_design_refine;
229 bool use_sequence_biased_fragments =
false;
236 boost::tokenizer< boost::char_separator< char > > tokens(
line, boost::char_separator< char >(
" \n\t" ) );
237 entries.assign( tokens.begin(), tokens.end() );
240 if ( entries.size() == 0 || ( entries.size() > 0 && entries.begin()->at( 0 ) ==
'#' ) ) {
244 if ( entries.size() >= 3 ) {
245 left = boost::lexical_cast<
Size >( entries[ 1 ] );
246 right = boost::lexical_cast<
Size >( entries[ 2 ] );
249 aa_during_build = entries.size() >= 4 ? entries[ 4 ] :
String();
250 aa_during_design_refine = entries.size() >= 5 ? entries[ 5 ] :
String();
252 if ( aa_during_build.length() == 1 && aa_during_build.at( 0 ) ==
'-' ) {
253 aa_during_build =
String();
256 use_sequence_biased_fragments |= !aa_during_build.empty();
259 BuildInstructionOP(
new SegmentRebuild(
260 Interval( left, right ),
262 core::chemical::ChemicalManager::get_instance()->residue_type_set( core::chemical::FA_STANDARD ),
263 option[ ufv::keep_junction_torsions ]
265 aa_during_design_refine
270 TR <<
"added loop: [" << left <<
", " << right <<
"] " << ss <<
" "
271 << aa_during_build <<
" " << aa_during_design_refine << std::endl;
275 TR.
Error <<
"ERROR: too few columns in line of ufv_loops file: " <<
line << std::endl;
282 bdr.use_sequence_bias( use_sequence_biased_fragments );
289 using namespace basic::options::OptionKeys;
293 using protocols::forge::build::ConnectRight;
294 using protocols::forge::build::CountFromLeft;
295 using protocols::forge::build::CountFromLeftOP;
296 using protocols::forge::build::Interval;
297 using protocols::forge::build::RelativeConnectRight;
298 using protocols::forge::build::RelativeConnectRightOP;
299 using protocols::forge::build::SegmentInsert;
300 using protocols::forge::build::SegmentInsertOP;
302 using protocols::forge::build::SegmentInsertConnectionScheme::N;
303 using protocols::forge::build::SegmentInsertConnectionScheme::RANDOM_SIDE;
304 using core::scoring::dssp::Dssp;
306 using core::import_pose::pose_from_pdb;
310 String aa_during_design_refine;
311 String connection_scheme_str;
313 if (
option[ ufv::aa_during_build ].
user() ) {
314 aa_during_build =
option[ ufv::aa_during_build ];
317 if (
option[ ufv::aa_during_design_refine ].
user() ) {
318 aa_during_design_refine =
option[ ufv::aa_during_design_refine ];
321 if (
option[ ufv::insert::connection_scheme ].
user() ) {
322 connection_scheme_str =
option[ ufv::insert::connection_scheme ];
323 boost::to_upper( connection_scheme_str );
329 bool const use_attached =
option[ ufv::insert::attached_pdb ].user();
332 core::import_pose::pose_from_pdb( insert,
option[ ufv::insert::insert_pdb ] );
333 Dssp dssp_i( insert );
334 dssp_i.insert_ss_into_pose( insert );
336 RelativeConnectRightOP rcr;
338 if ( use_attached ) {
340 core::import_pose::pose_from_pdb( attached,
option[ ufv::insert::attached_pdb ] );
341 Dssp dssp_a( attached );
342 dssp_a.insert_ss_into_pose( attached );
348 Pose insert_plus_attached = insert;
350 Size const insert_jump_pos = insert.n_residue() % 2 == 0 ? insert.n_residue() / 2 : insert.n_residue() / 2 + 1;
351 Size const attached_jump_pos = attached.n_residue() % 2 == 0 ? attached.n_residue() / 2 : attached.n_residue() / 2 + 1;
352 Size const shifted_attached_jump_pos = attached_jump_pos + insert.n_residue();
354 ConnectRight cr( insert_jump_pos, attached_jump_pos, attached );
355 cr.modify( insert_plus_attached );
358 CountFromLeftOP cfl(
new CountFromLeft() );
359 cfl->p = insert_jump_pos;
360 cfl->left_skip =
option[ ufv::ss ].value().find( SegmentInsert::insertion_char() );
362 rcr = RelativeConnectRightOP(
new RelativeConnectRight( cfl, attached_jump_pos, attached ) );
363 rcr->extract_rt( insert_plus_attached, insert_jump_pos, shifted_attached_jump_pos );
368 protocols::forge::build::SegmentInsertConnectionScheme::Enum connection_scheme = RANDOM_SIDE;
369 if ( !connection_scheme_str.empty() ) {
370 if ( connection_scheme_str ==
"N2C" ) {
371 connection_scheme = N;
372 }
else if ( connection_scheme_str ==
"C2N" ) {
373 connection_scheme =
C;
377 SegmentInsertOP si(
new SegmentInsert(
379 option[ ufv::ss ], aa_during_build,
386 bdr.add_instruction( si, aa_during_design_refine );
387 if ( use_attached ) {
388 bdr.add_instruction( rcr );
389 bdr.create_directed_dependency( si, rcr );
396 using namespace basic::options::OptionKeys;
399 using protocols::simple_filters::PoseMetricEvaluator;
400 using protocols::forge::build::Interval;
401 using protocols::forge::build::SegmentRebuild;
402 using protocols::forge::remodel::RemodelMover;
403 using protocols::forge::remodel::RemodelMover_OP;
404 using protocols::forge::components::BDR_OP;
405 using protocols::jd2::JobDistributor;
420 RemodelMover_OP rmdl(
new RemodelMover );
423 JobDistributor::get_instance()->go( rmdl );
425 protocols::viewer::clear_conformation_viewers();
430 int main(
int argc,
char * argv [] ) {
433 if ( argc == 1 || ( argc > 1 && strcmp(argv[ 1 ],
"-h") == 0 ) ) {
451 std::cout <<
"caught exception " << e.
msg() << std::endl;
void fill_optional_options(KeyVec &keys)
virtual std::string const msg() const
core::Size load_loops_from_file(protocols::forge::components::BDR &bdr, utility::file::FileName const &filename)
load ufv loops from file
void fill_required_options(KeyVec &keys)
utility::keys::KeyLookup< KeyType >::const_iterator const_iterator
Key collection iterators.
std::vector< OptionKey const * > KeyVec
std::istream & getline(std::istream &stream, Fstring &s)
Get Line from Stream.
void init(int argc, char *argv[])
Command line init() version.
BooleanOptionKey const user("options:user")
void setup_segment_insert(protocols::forge::components::BDR &bdr)
File name class supporting Windows and UN*X/Linux format names.
Abstract automatic hidden index key for options.
common derived classes for thrown exceptions
void * graphics_main(void *)
void close()
Close the ifstream and reset the state.
static void add_relevant(const OptionKey &key)
add OptionKey to list of application relevant options
static THREAD_LOCAL basic::Tracer TR("basic.options")
izstream: Input file stream wrapper for uncompressed and compressed files
Input file stream wrapper for uncompressed and compressed files.
std::vector with 1-based indexing
bool check_required_options(KeyVec &keys)
File name class supporting Windows and UN*X/Linux format names.
basic::options::IntegerOptionKey const nstruct("nstruct")
rule< Scanner, options_closure::context_t > options
utility::options::OptionCollection option
OptionCollection global.
ocstream cout(std::cout)
Wrapper around std::cout.
BooleanOptionKey const exit("options:exit")
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
TracerProxy Fatal
channels with predefined priority levels.
void register_options(KeyVec &keys)
int main(int argc, char *argv[])
Program options global and initialization function.
void init_usage_prompt(std::string exe)
the usage prompt that gets printed when the user doesn't enter any arguments or uses the -h flag sinc...
int const silent
Named verbosity levels.
bool check_option_conflicts()