Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProteinSCSampler.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/match/upstream/ProteinSCSampler.cc
12 /// @brief Class declarations for base class and simple derived class for SC sampling
13 /// @author Alex Zanghellini (zanghell@u.washington.edu)
14 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
15 
16 // Unit headers
18 
19 // Package headers
21 
22 // Project headers
24 // AUTO-REMOVED #include <core/scoring/ScoringManager.hh>
27 
28 #include <utility/string_util.hh>
29 
31 #include <utility/vector1.hh>
32 
33 
34 namespace protocols {
35 namespace match {
36 namespace upstream {
37 
39 
40 /// @details If there is no library, returns a one-element vector.
43  ScaffoldBuildPoint const & bb_conf,
44  core::chemical::ResidueType const & restype
45 ) const
46 {
47  using namespace core::scoring;
48  using namespace core::pack::dunbrack;
49 
50  RotamerLibrary const & rotlib( RotamerLibrary::get_instance() );
51  SingleResidueRotamerLibraryCAP res_rotlib( rotlib.get_rsd_library( restype ) );
52 
53  if ( res_rotlib != 0 ) {
54 
56  dynamic_cast< SingleResidueDunbrackLibrary const * >
57  ( res_rotlib.get() ));
58 
59  if ( dun_rotlib == 0 ) {
60  utility_exit_with_message( "ERROR: Failed to retrieve a Dunbrack rotamer library for AA: " +
61  utility::to_string( restype.aa() ) + " named " + restype.name() );
62  }
63 
64  {
65  if ( ! dynamic_cast< ProteinBackboneBuildPoint const * > ( & bb_conf ) ) {
66  utility_exit_with_message( "ERROR: DunbrackSCSampler expects a ProteinBackboneBuildPoint but"
67  "was handed an incompatible type. ScaffoldBuildPoint #" +
68  utility::to_string( bb_conf.index() ) + " is of an incompatible type" );
69  }
70  }
71 
72  ProteinBackboneBuildPoint const & bb(
73  static_cast< ProteinBackboneBuildPoint const & >
74  ( bb_conf ));
75 
76  return dun_rotlib->get_all_rotamer_samples( bb.phi(), bb.psi() );
77  } else {
78  /// No rotamer library. Return one-element vector
79  DunbrackRotamerSampleDataVector one_element_vector( 1 );
80  return one_element_vector;
81  }
82 
83 }
84 
85 }
86 }
87 }
88