Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bb_independent_rotamers.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 src/core/pack/rotamer_set/bb_independent_rotamers.hh
11 /// @brief a bunch of utility functions used in enzdes
12 /// @author Florian Richter, floric@u.washington.edu
13 
15 
16 #include <utility/vector1.hh>
19 #include <core/pose/Pose.hh>
20 #include <core/pose/util.hh>
22 
23 #include <core/graph/Graph.hh>
24 
30 
31 namespace core {
32 namespace pack {
33 namespace rotamer_set {
34 
35 
36 
40  bool ignore_cmdline
41 )
42 {
43  core::conformation::Residue firstres( *rot_restype, true );
44  core::pose::Pose dummy_pose;
45  dummy_pose.append_residue_by_jump( firstres, (core::Size) 0 );
46  if( rot_restype->is_polymer() ){
47  core::pose::add_lower_terminus_type_to_pose_residue( dummy_pose, 1 ); //prolly critical so that the dunbrack library uses neutral phi
48  core::pose::add_upper_terminus_type_to_pose_residue( dummy_pose, 1 ); //prolly critical so that the dunbrack library uses neutral psi
49  }
51  dummy_sfxn( dummy_pose );
53  if( !ignore_cmdline ) dummy_task->initialize_from_command_line();
54  dummy_task->nonconst_residue_task( 1 ).restrict_to_repacking();
55  dummy_task->nonconst_residue_task( 1 ).or_include_current( false ); //need to do this because the residue was built from internal coords and is probably crumpled up
56  dummy_task->nonconst_residue_task( 1 ).or_fix_his_tautomer( true ); //since we only want rotamers for the specified restype
57  core::graph::GraphOP dummy_png = core::pack::create_packer_graph( dummy_pose, dummy_sfxn, dummy_task );
58 
60  core::pack::rotamer_set::RotamerSetOP rotset( rsf.create_rotamer_set( dummy_pose.residue( 1 ) ) );
61  rotset->set_resid( 1 );
62  rotset->build_rotamers( dummy_pose, dummy_sfxn, *dummy_task, dummy_png );
63 
65 
66  //now when creating the rotamers, we have to make sure we don't sneak in the additional variant types
67  for( core::Size i = 1; i <= rotset->num_rotamers(); ++i ){
69  for( core::Size j =1; j <= firstres.nchi(); ++j ) rot->set_chi( j, rotset->rotamer( i )->chi( j ) );
70  to_return.push_back( rot );
71  }
72 
73  return to_return;
74 }
75 
76 }
77 }
78 }