20 #include <basic/options/keys/in.OptionKeys.gen.hh>
21 #include <basic/options/keys/out.OptionKeys.gen.hh>
28 #include <core/io/silent/SilentFileData.hh>
29 #include <core/io/silent/SilentStruct.hh>
30 #include <core/sequence/util.hh>
33 #include <boost/algorithm/string/predicate.hpp>
35 #define PCT_THRESHOLD 0.9
38 int main(
int argc,
char* argv[]) {
42 using namespace basic::options::OptionKeys;
59 option[in::file::silent_read_through_errors].value(
true);
62 const string ref_sequence = sequences[1];
66 cout <<
"Reference: " << ref_sequence << endl;
68 SilentFileData sfd_in, sfd_out;
69 sfd_in.read_file(input_file);
71 size_t num_good = 0, num_failed = 0, num_mismatch = 0;
75 SilentStructOP decoy = sfd_in[*i];
77 string sequence = decoy->sequence().one_letter_sequence();
80 bool failed_simulation = boost::starts_with(decoy_id,
"W_");
81 bool sequence_mismatch = ref_sequence.compare(0, ref_sequence.length(),
sequence, 0, ref_sequence.length()) != 0;
83 if ( failed_simulation ) {
84 cerr <<
"Removed tag " << decoy_id <<
" (failed simulation)" << endl;
86 }
else if ( sequence_mismatch ) {
87 cerr <<
"Removed tag " << decoy_id <<
" (sequence mismatch)" << endl;
90 sfd_out.write_silent_struct(*decoy, output_file,
false);
96 double total = num_good + num_failed + num_mismatch;
97 double pct_good = num_good / total;
98 double pct_failed = num_failed / total;
99 double pct_mismatch = num_mismatch / total;
100 cout <<
"pct_good: " << pct_good <<
" pct_failed: " << pct_failed <<
" pct_mismatch: " << pct_mismatch << endl;
107 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
void init(int argc, char *argv[])
Command line init() version.
BooleanOptionKey const user("options:user")
common derived classes for thrown exceptions
int main(int argc, char *argv[])
Program exit functions and macros.
basic::options::OptionKeys collection
std::vector with 1-based indexing
rule< Scanner, options_closure::context_t > options
super::const_iterator const_iterator
ocstream cout(std::cout)
Wrapper around std::cout.
vector1: std::vector with 1-based indexing
Program options global and initialization function.
int const silent
Named verbosity levels.
rule< Scanner, option_closure::context_t > option