Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScoringGridLoader.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 protocols/qsar/scoring_grid/DataLoader.cc
11 /// @brief Implementation of the XML parser's DataLoader base class (ctor & dstor)
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 // Unit Headers
17 
18 // Project Headers
20 //#include <protocols/qsar/qsarTypeManager.hh>
21 
22 #include <basic/Tracer.hh>
23 
24 // Utility headers
25 #include <utility/tag/Tag.hh>
26 
27 // Boost Headers
28 #include <boost/foreach.hpp>
29 
30 #include <utility/vector0.hh>
31 #include <utility/vector1.hh>
32 
33 #define foreach BOOST_FOREACH
34 
35 namespace protocols {
36 namespace qsar {
37 namespace scoring_grid {
38 
39 static basic::Tracer TR( "protocols.qsar.scoring_grid.ScoringGridLoader" );
40 
43 
45  core::pose::Pose const &,
46  utility::tag::TagPtr const tag,
48 ) const
49 {
50  using namespace utility::tag;
52 
53  /// Setup the scoring grid_manager
54 
55  //core::Real width = 40.0;
56  //core::Real resolution = 0.25;
57 
59 
60  if( tag->hasOption("width") ) {
61  grid_manager->set_width(tag->getOption<core::Real>("width"));
62 
63  }
64  if( tag->hasOption("resolution") ){
65  grid_manager->set_resolution(tag->getOption<core::Real>("resolution"));
66  }
67 
68  if(tag->hasOption("ligand_chain") ) {
69  grid_manager->set_chain(tag->getOption<char>("ligand_chain"));
70  }
71 
72  if(tag->hasOption("normalized"))
73  {
74  grid_manager->set_normalized(tag->getOption<bool>("normalized"));
75  }
76 
77  /// Add grids to the scoring grid manager
78 
79  TagPtrs const grid_tags( tag->getTags() );
80  if (grid_tags.size()==0){
81  TR <<"WARNING WARNING grid manager will be empty" <<std::endl;
82  }
83 
84  foreach(TagPtr tag, grid_tags){
85  grid_manager->make_new_grid(tag);
86  }
87 
88  TR.flush();
89 }
90 
93 
95 ScoringGridLoaderCreator::keyname() const { return "SCORINGGRIDS"; }
96 
97 
98 } //namespace scoring_grid
99 } //namespace qsar
100 } //namespace protocols