15 #include <protocols/simple_moves/ScoreMover.hh>
16 #include <core/scoring/ScoreFunction.hh>
17 #include <core/scoring/symmetry/SymmetricScoreFunction.hh>
18 #include <core/scoring/ScoreFunctionFactory.hh>
20 #include <core/chemical/ChemicalManager.hh>
22 #include <protocols/cluster/cluster.hh>
23 #include <protocols/loops/Loops.hh>
24 #include <core/import_pose/pose_stream/MetaPoseInputStream.hh>
25 #include <core/import_pose/pose_stream/util.hh>
47 #if defined(WIN32) || defined(__CYGWIN__)
53 using namespace ObjexxFCL;
55 using namespace protocols;
59 main(
int argc,
char * argv [] ) {
62 using namespace protocols;
63 using namespace protocols::moves;
66 using namespace basic::options::OptionKeys;
93 std::cout <<
" Rosetta Tool: cluster - clustering tool for PDBs and or silent files " << std::endl;
95 std::cout <<
" PDB input: -in:file:s *.pdb or " << std::endl;
96 std::cout <<
" -in:file:l list_of_pdbs " << std::endl;
97 std::cout <<
" -no_optH Dont change positions of Hydrogen atoms! " << std::endl;
98 std::cout <<
" Silent input: -in:file:silent silent.out silent input filesname " << std::endl;
99 std::cout <<
" -in:file:s specify specific tags to be extracted, if left out all will be taken " << std::endl;
100 std::cout <<
" -in:file:fullatom for full atom structures " << std::endl;
101 std::cout <<
" -in:file:silent_struct_type <type> specify the input silent-file format " << std::endl;
102 std::cout <<
" Native: -in:file:native native PDB if CaRMS is required " << std::endl;
103 std::cout <<
" Scorefunction: -score:weights weights weight set or weights file " << std::endl;
104 std::cout <<
" -score:patch patch patch set " << std::endl;
105 std::cout <<
" -rescore:verbose display score breakdown " << std::endl;
106 std::cout <<
" -rescore:output_only don't rescore " << std::endl;
107 std::cout <<
" Output: -nooutput don't print PDB structures " << std::endl;
108 std::cout <<
" -out:prefix myprefix prefix the output structures with a string " << std::endl;
109 std::cout <<
" Clustering: -cluster:radius <float> Cluster radius in A (for RMS clustering) or in inverse GDT_TS for GDT clustering. Use \"-1\" to trigger automatic radius detection" << std::endl;
110 std::cout <<
" -cluster:gdtmm Cluster by gdtmm instead of rms" << std::endl;
111 std::cout <<
" -cluster:input_score_filter <float> Ignore structures above certain energy " << std::endl;
112 std::cout <<
" -cluster:exclude_res <int> [<int> <int> ..] Exclude residue numbers " << std::endl;
113 std::cout <<
" -cluster:radius <float> Cluster radius" << std::endl;
114 std::cout <<
" -cluster:limit_cluster_size <int> Maximal cluster size" << std::endl;
115 std::cout <<
" -cluster:limit_cluster_size_percent <float> Maximal cluster size by percentage" << std::endl;
116 std::cout <<
" -cluster:random_limit_cluster_size_percent <float> Maximal cluster size by percentage, cut randomly" << std::endl;
117 std::cout <<
" -cluster:limit_clusters <int> Maximal number of clusters" << std::endl;
118 std::cout <<
" -cluster:limit_total_structures <int> Maximal number of structures in total" << std::endl;
119 std::cout <<
" -cluster:sort_groups_by_energy Sort clusters by energy." << std::endl;
120 std::cout <<
" -cluster:remove_highest_energy_member Remove highest energy member of each cluster" << std::endl;
121 std::cout <<
" -symmetry:symmetric_rmsd \t\t\t\t\t\t For symmetric systems find the lowest rms by testing all chain combinations. Works only with silent file input that contain symmetry info and with all CA rmsd" << std::endl;
123 std::cout <<
" cluster -database ~/minirosetta_database -in:file:silent silent.out -in::file::binary_silentfile -in::file::fullatom -native 1a19.pdb " << std::endl;
124 std::cout <<
"clustered Poses are given output names in the form of:" << std::endl;
125 std::cout <<
" c.i.j, which denotes the jth member of the ith cluster." << std::endl;
137 core::scoring::ScoreFunctionOP
sfxn;
138 sfxn = core::scoring::get_score_function();
140 core::scoring::ScoreFunctionOP sfxn_sym =
141 core::scoring::symmetry::symmetrize_scorefunction( *
sfxn );
145 ClusterPhilStyleOP clustering;
148 loops::Loops
loops(
true );
149 clustering = ClusterPhilStyleOP(
new ClusterPhilStyle_Loop(loops ) );
151 clustering = ClusterPhilStyleOP(
new ClusterPhilStyle() );
154 clustering->set_score_function(
sfxn );
158 clustering->set_cluster_radius(
161 clustering->set_population_weight(
183 core::chemical::ResidueTypeSetCOP rsd_set;
185 rsd_set = core::chemical::ChemicalManager::get_instance()->residue_type_set(
"fa_standard" );
187 rsd_set = core::chemical::ChemicalManager::get_instance()->residue_type_set(
"centroid" );
192 core::import_pose::pose_stream::MetaPoseInputStream
input = core::import_pose::pose_stream::streams_from_cmd_line();
193 while (
input.has_another_pose() && (clustering->nposes() < 400 ) ) {
195 input.fill_pose( pose, *rsd_set );
196 clustering->apply( pose );
201 int time_readin = time(NULL);
203 int time_initialc = time(NULL);
204 clustering->do_redistribution();
207 std::cout <<
"Assigning extra structures ... " << std::endl;
208 AssignToClustersMoverOP mover_add_structures(
new AssignToClustersMover( clustering ) );
209 mover_add_structures->set_score_function(
sfxn );
212 while (
input.has_another_pose() ) {
214 input.fill_pose( pose, *rsd_set );
215 mover_add_structures->apply( pose );
219 clustering->print_summary();
222 int time_total = time(NULL);
225 clustering->sort_groups_by_energy();
228 clustering->remove_singletons();
246 clustering->remove_highest_energy_member_of_each_group();
250 clustering->sort_each_group_by_energy();
251 clustering->sort_groups_by_energy( );
252 clustering->export_only_low(
option[ export_only_low ]() );
256 clustering->print_summary();
264 EnsembleConstraints_Simple cec( 1.0 );
268 clustering->print_cluster_assignment();
269 std::vector < Cluster >
const & clusterlist=clustering->get_cluster_list();
270 std::list < int > sorted_list;
271 for (
int i=0; i<(
int)clusterlist.size(); i++ ) {
272 for (
int j=0;
j<(
int)clusterlist[i].
size();
j++ ) {
273 sorted_list.push_back( clusterlist[i][
j] );
281 <<
"s\n Cluster: " << time_initialc - time_readin
282 <<
"s\n Additional Clustering: " << time_total - time_initialc
287 std::cout <<
"caught exception " << e.
msg() << std::endl;
IntegerOptionKey const limit_total_structures
BooleanOptionKey const cluster
virtual std::string const msg() const
basic::options::OptionKeys collection
RealOptionKey const limit_cluster_size_percent
BooleanOptionKey const scoring
BooleanOptionKey const output("out:output")
void init(int argc, char *argv[])
Command line init() version.
RealOptionKey const population_weight
basic::options::OptionKeys collection
BooleanOptionKey const remove_singletons
common derived classes for thrown exceptions
IntegerVectorOptionKey const exclude_res
BooleanOptionKey const sort_groups_by_energy
BooleanOptionKey const symmetric_rmsd
BooleanOptionKey const nooutput("out:nooutput")
RealOptionKey const input_score_filter
int main(int argc, char *argv[])
BooleanOptionKey const loops
IntegerOptionKey const limit_dist_matrix
IntegerOptionKey const max_total_cluster
basic::options::OptionKeys collection
rule< Scanner, options_closure::context_t > options
StringOptionKey const silent
RealOptionKey const radius
BooleanOptionKey const fullatom("in:file:fullatom")
BooleanOptionKey const export_only_low
BooleanOptionKey const remove_highest_energy_member
IntegerOptionKey const limit_cluster_size
ocstream cout(std::cout)
Wrapper around std::cout.
RealOptionKey const thinout_factor
vector1: std::vector with 1-based indexing
basic::options::OptionKeys collection
Program options global and initialization function.
BooleanOptionKey const file
RealOptionKey const output_score_filter
StringOptionKey const prefix("out:prefix")
StringOptionKey const user
RealOptionKey const random_limit_cluster_size_percent
BooleanOptionKey const make_ensemble_cst
rule< Scanner, option_closure::context_t > option
IntegerOptionKey const limit_clusters