30 #include <core/chemical/ChemicalManager.hh>
31 #include <core/io/pdb/pdb_writer.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;
156 using namespace basic::options::OptionKeys;
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;
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;
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 ] );
259 BuildInstructionOP(
new SegmentRebuild(
260 Interval(
left, right ),
262 core::chemical::ChemicalManager::get_instance()->
residue_type_set( core::chemical::FA_STANDARD ),
270 TR <<
"added loop: [" <<
left <<
", " << right <<
"] " << ss <<
" "
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_file;
311 String connection_scheme_str;
323 boost::to_upper( connection_scheme_str );
334 dssp_i.insert_ss_into_pose(
insert );
336 RelativeConnectRightOP rcr;
338 if ( use_attached ) {
341 Dssp dssp_a( attached );
342 dssp_a.insert_ss_into_pose( attached );
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" ) {
372 }
else if ( connection_scheme_str ==
"C2N" ) {
377 SegmentInsertOP si(
new SegmentInsert(
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;
basic::options::OptionKeys collection
BooleanOptionKey const in
BooleanOptionKey const pdb_gz
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.
IntegerOptionKey const right
std::vector< OptionKey const * > KeyVec
StringOptionKey const residue_type_set
FileVectorOptionKey const s
std::istream & getline(std::istream &stream, Fstring &s)
Get Line from Stream.
void init(int argc, char *argv[])
Command line init() version.
FileOptionKey const attached_pdb
void setup_segment_insert(protocols::forge::components::BDR &bdr)
BooleanOptionKey const pdb
BooleanOptionKey const insert
File name class supporting Windows and UN*X/Linux format names.
basic::options::OptionKeys collection
IntegerOptionKey const max_retry_job
Abstract automatic hidden index key for options.
common derived classes for thrown exceptions
IntegerOptionKey const left
void * graphics_main(void *)
basic::options::OptionKeys collection
FileOptionKey const blueprint
BooleanOptionKey const ss
FileOptionKey const insert_pdb
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")
basic::options::OptionKeys collection
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::OptionKeys collection
rule< Scanner, options_closure::context_t > options
StringOptionKey const silent
PathVectorOptionKey const database
Permanent solution, add the .params to the minirosetta_database of PyRosetta.
utility::options::OptionCollection option
OptionCollection global.
RealOptionKey const neighbor_by_distance_cutoff
BooleanOptionKey const keep_junction_torsions
StringOptionKey const aa_during_design_refine
FileVectorOptionKey const silent
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.
basic::options::OptionKeys collection
basic::options::OptionKeys collection
void register_options(KeyVec &keys)
StringOptionKey const aa_during_build
BooleanOptionKey const silent_gz
int main(int argc, char *argv[])
Program options global and initialization function.
StringOptionKey const silent_struct_type
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...
FileVectorOptionKey const vall
StringOptionKey const user
StringOptionKey const connection_scheme
IntegerOptionKey const nstruct
bool check_option_conflicts()