Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fragment_picker.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 #include <devel/init.hh>
11 
12 // utility headers
13 #include <utility/vector1.hh>
14 
15 #include <core/sequence/Sequence.hh>
16 
17 // option key includes
18 #include <basic/options/option.hh>
21 #include <basic/options/keys/out.OptionKeys.gen.hh>
22 #include <basic/options/keys/frags.OptionKeys.gen.hh>
23 #include <basic/options/keys/in.OptionKeys.gen.hh>
24 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
25 
26 #include <protocols/frag_picker/FragmentPicker.hh>
27 #include <protocols/frag_picker/VallProvider.hh>
28 #include <protocols/frag_picker/VallChunk.hh>
29 #include <protocols/frag_picker/VallResidue.hh>
30 #include <protocols/frag_picker/FragmentSelectingRule.hh>
31 #include <protocols/frag_picker/VallChunkFilter.hh>
32 
33 #include <protocols/frag_picker/scores/FragmentScoringMethod.hh>
34 
35 #include <basic/prof.hh>
36 #include <basic/Tracer.hh>
37 
39 
40 static THREAD_LOCAL basic::Tracer trace( "fragment_picker" );
41 
42 using namespace core;
43 using namespace core::fragment;
44 using namespace protocols::frag_picker;
45 using namespace protocols::frag_picker::scores;
46 using namespace basic::options;
47 using namespace basic::options::OptionKeys;
48 
50 
54  OPT(in::file::fasta);
55  OPT(in::file::pssm);
56  OPT(in::file::checkpoint);
57  OPT(in::file::talos_phi_psi);
58  OPT(in::file::torsion_bin_probs);
60 
62  OPT(frags::scoring::profile_score);
63  OPT(frags::ss_pred);
64  OPT(frags::n_frags);
65  OPT(frags::n_candidates);
66  OPT(frags::frag_sizes);
67  OPT(frags::write_ca_coordinates);
68  OPT(frags::allowed_pdb);
69  OPT(frags::denied_pdb);
70  OPT(frags::describe_fragments);
71  OPT(frags::keep_all_protocol);
72  OPT(frags::bounded_protocol);
73  OPT(frags::quota_protocol);
74  OPT(frags::picking::selecting_rule);
75  OPT(frags::picking::selecting_scorefxn);
76  OPT(frags::picking::quota_config_file);
77  OPT(frags::picking::query_pos);
78 
80 
81  OPT(out::file::frag_prefix);
82 
83  OPT(frags::nonlocal_pairs);
84  OPT(frags::nonlocal::min_contacts_per_res);
85  OPT(frags::contacts::min_seq_sep);
86  OPT(frags::contacts::dist_cutoffs);
87  OPT(frags::contacts::centroid_distance_scale_factor);
88  OPT(frags::contacts::type);
89 
90 }
91 
92 int main(int argc, char * argv[]) {
93 
94  try {
95  using namespace basic::options;
96  using namespace basic::options::OptionKeys;
97 
99  devel::init(argc, argv);
100 
101  if ( option[in::file::native].user() ) {
102  trace.Debug << option[in::file::native]() << std::endl;
103  }
104 
105  //---------- Set up a picker.
106  FragmentPickerOP pickIt;
107  if ( option[frags::p_value_selection]() == true ) {
108  pickIt = FragmentPickerOP( new FragmentPicker("PValuedFragmentScoreManager") );
109  } else {
110  pickIt = FragmentPickerOP( new FragmentPicker() );
111  }
112  pickIt->parse_command_line();
113  trace << "After setup; size of a query is: " << pickIt->size_of_query() << std::endl;
114 
115  //-------- Trata ta ta, tra ta... (picking fragment candidates)
116  trace << "Picking candidates" << std::endl;
117 
118  if ( option[frags::picking::quota_config_file].user() || option[frags::quota_protocol].user() ) {
119  trace << "Running quota protocol" << std::endl;
120  pickIt->quota_protocol();
121  } else {
122  if ( option[frags::keep_all_protocol].user() ) {
123  trace << "Running keep-all protocol" << std::endl;
124  pickIt->keep_all_protocol();
125  } else {
126  trace << "Running bounded protocol" << std::endl;
127  pickIt->bounded_protocol();
128  }
129  }
131  }
132 catch (utility::excn::EXCN_Base const & e) {
133  std::cout << "caught exception " << e.msg() << std::endl;
134  return -1;
135 }
136 }
137 
#define THREAD_LOCAL
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
void init(int argc, char *argv[])
Command line init() version.
Definition: init.cc:23
int main(int argc, char *argv[])
BooleanOptionKey const user("options:user")
Definition: OptionKeys.hh:40
xyzVector< Real > xyz(Real const &r1, Real const &omega1, Real const &t, Real const &dz1, Real const &delta_omega1, Real const &delta_z1)
Returns the x-, y-, and z-coordinates of a point on a helix given r1, omega1, and t...
Definition: HelixParams.cc:67
common derived classes for thrown exceptions
tuple database
Tracer IO system.
basic::options::OptionKeys collection
static THREAD_LOCAL basic::Tracer trace("fragment_picker")
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
list native
Definition: ContactMap.py:108
dictionary config
Definition: __init__.py:33
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
Definition: Tracer.hh:134
Program options global and initialization function.
void register_options()
#define OPT(akey)
void prof_show()
Definition: prof.cc:326
TracerProxy Debug
Definition: Tracer.hh:262
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378