Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.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/multistate_design/util.cc
11 /// @brief
12 /// @author Justin Ashworth wrote this, but Andrew Leaver-Fay copy-and-pasted it into this file.
13 
14 // Unit headers
16 
17 // Package headers
20 // AUTO-REMOVED #include <protocols/multistate_design/SingleState.hh> // REQUIRED FOR WINDOWS
21 
22 // Project headers
25 // AUTO-REMOVED #include <core/pose/Pose.hh> // REQUIRED FOR WINDOWS
26 
27 // C++ headers
28 #include <set>
29 
30 #include <utility/vector1.hh>
31 
32 
33 namespace protocols {
34 namespace multistate_design {
35 
38  core::Size i, // aka, residue index
40 )
41 {
42  using namespace core;
43  using namespace core::chemical;
44  using namespace protocols::genetic_algorithm;
45 
46  EntityElements choices;
47  // to avoid duplicate AA's (such as for multiple histidine ResidueTypes)
48  std::set< core::chemical::AA > aaset;
49  std::list< ResidueTypeCOP > const & allowed( rtask.allowed_residue_types() );
50  for ( std::list< ResidueTypeCOP >::const_iterator t( allowed.begin() ), end( allowed.end() );
51  t != end; ++t ) {
52  core::chemical::AA aa( (*t)->aa() );
53  // avoid duplicate AA's (such as for multiple histidine ResidueTypes)
54  if ( aaset.find( aa ) != aaset.end() ) continue;
55  aaset.insert(aa);
56  //TR(t_debug) << "adding choice " << aa << std::endl;
57  choices.push_back( new PosType( i, aa ) );
58  }
59  return choices;
60 }
61 
62 }
63 }
64