17 #include <core/types.hh>
18 #include <protocols/toolbox/DecoySetEvaluation.hh>
19 #include <protocols/toolbox/Cluster.hh>
20 #include <protocols/toolbox/Cluster.impl.hh>
21 #include <core/io/silent/SilentFileData.hh>
23 #include <protocols/loops/Loop.hh>
24 #include <protocols/loops/Loops.hh>
25 #include <protocols/loops/LoopsFileIO.hh>
36 #include <basic/options/keys/in.OptionKeys.gen.hh>
37 #include <basic/options/keys/cluster.OptionKeys.gen.hh>
51 using namespace protocols;
53 using namespace protocols::toolbox;
54 using namespace ObjexxFCL;
58 using namespace basic::options::OptionKeys;
66 using namespace basic::options::OptionKeys;
69 OPT( cluster::limit_cluster_size );
70 NEW_OPT( out::file::cluster,
"write clustered structures to silent file with this name",
"cluster.out" );
71 NEW_OPT( rigid::in,
"residues that are considered for clustering",
"rigid.loop");
76 loops::PoseNumberedLoopFileReader loop_file_reader;
77 loop_file_reader.hijack_loop_reading_code_set_loop_line_begin_token(
"RIGID" );
78 std::ifstream is(
option[ rigid::in ]().
name().c_str() );
80 loops::SerializedLoopList
loops = loop_file_reader.read_pose_numbered_loops_file(is,
option[ rigid::in ](),
false );
81 loops::Loops rigid = loops::Loops( loops );
82 for (
Size i=1; i<=natoms; ++i ) {
83 if ( rigid.is_loop_residue( i ) )
weights( i )=1.0;
90 using namespace basic::options::OptionKeys;
96 tr.
Debug <<
"reading " << *current_fn_ << std::endl;
97 sfd.read_file( *current_fn_ );
99 ensemble.push_back_CA_xyz_from_silent_file( sfd,
true );
105 DecoySetEvaluation ensemble;
112 ensemble.set_weights(
weights );
114 SilentFileData kept_decoys;
115 cluster_silent_structs( ensemble, sfd.begin(), sfd.end(), kept_decoys, ClusterOptions(
true ) );
116 std::string out_filename=
option[ out::file::cluster ]();
118 kept_decoys.write_all( out_filename );
127 main(
int argc,
char * argv [] )
140 std::cout <<
"caught exception " << e.
msg() << std::endl;
ocstream cerr(std::cerr)
Wrapper around std::cerr.
#define utility_exit_with_message(m)
Exit with file + line + message.
virtual std::string const msg() const
int main(int argc, char *argv[])
=============================== MAIN ============================================================ ...
void init(int argc, char *argv[])
Command line init() version.
BooleanOptionKey const user("options:user")
#define OPT_2GRP_KEY(type, grp1, grp2, key)
virtual void show(std::ostream &) const =0
Program exit functions and macros.
std::vector with 1-based indexing
File name class supporting Windows and UN*X/Linux format names.
static THREAD_LOCAL basic::Tracer tr("main")
rule< Scanner, options_closure::context_t > options
super::const_iterator const_iterator
Output file stream wrapper for uncompressed and compressed files.
#define NEW_OPT(akey, help, adef)
ocstream cout(std::cout)
Wrapper around std::cout.
vector1: std::vector with 1-based indexing
base class for Exception system
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
void read_input_weights(FArray1D_double &weights, Size natoms)
rule< Scanner, string_closure::context_t > name
ozstream: Output file stream wrapper for uncompressed and compressed files
#define OPT_1GRP_KEY(type, grp, key)
void read_structures(SilentFileData &sfd, DecoySetEvaluation &ensemble)
int const silent
Named verbosity levels.
rule< Scanner, option_closure::context_t > option