Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
validate_database.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 /// @file Rocco Moretti
11 /// @brief Perform validation tests on the Rosetta database, to see if it's internally consistent.
12 
13 
14 #include <core/pack/dunbrack/RotamerLibrary.hh>
15 
16 #include <basic/Tracer.hh>
17 #include <devel/init.hh>
18 #include <utility/exit.hh>
19 
20 #include <basic/database/open.hh>
21 #include <basic/options/option.hh>
22 #include <basic/options/keys/corrections.OptionKeys.gen.hh>
23 #include <basic/options/keys/in.OptionKeys.gen.hh>
24 
25 static THREAD_LOCAL basic::Tracer TR( "apps.public.validate_database" );
26 
27 /// @brief validate the Dunbrack binaries for the current option set.
28 
29 bool
31  using namespace basic::options;
32  using namespace basic::options::OptionKeys;
33 
34  core::pack::dunbrack::RotamerLibrary* rotamer_library( core::pack::dunbrack::RotamerLibrary::get_instance() );
35 
36  if ( ! rotamer_library->validate_dunbrack_binary() ) {
37  TR.Error << "Failure validating the Dunbrack binary" << std::endl;
38  TR.Error << "---------------------- Settings: --------------------------------" << std::endl;
39  TR.Error << "Database Directory(s): " << std::endl;
40  for ( core::Size ii(1); ii <= option[ in::path::database ]().size(); ++ii ) {
41  TR.Error << "\t\t" << option[ in::path::database ](ii).name() << std::endl;
42  }
43  TR.Error << "No binary Dunlib : " << (option[ in::file::no_binary_dunlib ] ? " true " : " false " ) << std::endl;
44  TR.Error << "Dun10: " << (option[ corrections::score::dun10 ] ? " true " : " false " ) << std::endl;
45  TR.Error << "-correct " << (option[ corrections::correct ] ? " true " : " false " ) << std::endl;
46  if ( option[ corrections::score::dun10 ] ) {
47  TR.Error << "Dunbrack 2010 directory: " << option[ corrections::score::dun10_dir ].value() << std::endl;
48  } else {
49  TR.Error << "Dunbrack 2002 file: " << option[ corrections::score::dun02_file ].value() << std::endl;
50  }
51  TR.Error << "Dunbrack library binary file: " << rotamer_library->get_binary_name() << std::endl;
52  TR.Error << "-----------------------------------------------------------------" << std::endl;
53  return false;
54  }
55  return true;
56 }
57 
58 int
59 main( int argc, char * argv [] )
60 {
61  int exitcode( 0 );
62 
63  try {
64 
65  // initialize core
66  devel::init(argc, argv);
67 
68  if ( ! validate_dunbrack_binaries() ) {
69  exitcode = -1;
70  }
71 
72  } catch ( utility::excn::EXCN_Base const & e ) {
73  std::cout << "caught exception " << e.msg() << std::endl;
74  return -1;
75  }
76  return exitcode;
77 }
78 
bool validate_dunbrack_binaries()
validate the Dunbrack binaries for the current option set.
#define THREAD_LOCAL
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
dictionary size
Definition: amino_acids.py:44
void init(int argc, char *argv[])
Command line init() version.
Definition: init.cc:23
tuple database
static THREAD_LOCAL basic::Tracer TR("basic.options")
Functions for opening database files.
Program exit functions and macros.
Tracer IO system.
TracerProxy Error
Definition: Tracer.hh:262
int main(int argc, char *argv[])
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
utility::options::OptionCollection option
OptionCollection global.
Definition: option.cc:45
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
Definition: Tracer.hh:134
rule< Scanner, string_closure::context_t > name
Definition: Tag.cc:376
static THREAD_LOCAL basic::Tracer TR("apps.public.validate_database")
Program options global and initialization function.
platform::Size Size
Definition: random.fwd.hh:30