Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VIP_Utils.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/vip/VIP_Utils.cc
11 /// @brief Utility functions for VIP mover
12 
13 #include "core/types.hh"
15 #include "core/scoring/Energies.hh"
18 #include "core/pose/Pose.hh"
20 #include <basic/options/option.hh>
21 
22 namespace protocols {
23 namespace vip {
24 
25 using core::Real;
26 using namespace core::scoring::packstat;
27 
29  size_t begin = 0;
30  size_t end = str.length();
31 
32  for (size_t i=0; i<str.length(); ++i) {
33  if (str[i] == '/') begin = i+1;}
34  return str.substr(begin,end);}
35 
37  std::string base = base_name(fname);
38  std::transform( base.begin(), base.end(), base.begin(), tolower );
39  system( ("mkdir -p out/" + base.substr(1,2)).c_str() );
40  std::string OUT_TAG = "out/" + base.substr(1,2) + "/" + base;
41  return OUT_TAG;}
42 
43 
45 
46  using core::Size;
47  using namespace core::scoring::packstat;
48  using namespace std;
49  using namespace basic;
50  using namespace options;
51  using namespace OptionKeys;
52 // using namespace ObjexxFCL::fmt;
53  using namespace numeric;
54  using namespace utility;
55 /*
56  core::Size oversample = option[ OptionKeys::packstat::oversample ]();
57  bool include_water = option[ OptionKeys::packstat::include_water ]();
58  bool residue_scores = option[ OptionKeys::packstat::residue_scores ]();
59  bool packstat_pdb = option[ OptionKeys::packstat::packstat_pdb ]();
60  bool raw_stats = option[ OptionKeys::packstat::raw_stats ]();
61 
62  AtomRadiusMap arm;
63  SimplePDB pdb;
64  utility::io::izstream in(fname.c_str());
65  in >> pdb;
66 
67  Spheres spheres;
68  spheres = pdb.get_spheres(arm);
69  vector1< xyzVector<PackstatReal> > centers( pdb.get_res_centers() );
70 
71  PosePackData pd;
72  pd.spheres = spheres;
73  pd.centers = centers;
74  core::Real packing_score = compute_packing_score( pd, oversample );
75 
76  utility::vector1<core::Real> res_scores; // needed if output res scores or pdb
77  if( raw_stats ) { // stupid duplicate code....
78  assert( pd.spheres.size() > 0 );
79  assert( pd.centers.size() > 0 );
80 
81  SasaOptions opts;
82  opts.surrounding_sasa_smoothing_window = 1+2*oversample;
83  opts.num_surrounding_sasa_bins = 7;
84  for( core::Size ipr = 1; ipr <= 31; ++ipr ) {
85  PackstatReal pr = 3.0 - ((double)(ipr-1))/10.0;
86  PackstatReal ostep = 0.1 / (oversample*2.0+1.0);
87  for( core::Size i = 1; i <= oversample; ++i ) opts.probe_radii.push_back( pr + i*ostep );
88  opts.probe_radii.push_back( pr );
89  for( core::Size i = 1; i <= oversample; ++i ) opts.probe_radii.push_back( pr - i*ostep );}
90  SasaResultOP result = compute_sasa( pd.spheres, opts );
91  for( core::Size i = 1; i <= pd.centers.size(); ++i ) {
92  // std::cout << i << " ";
93  PackingScoreResDataCOP dat( compute_surrounding_sasa( pd.centers[i], pd.spheres, result, opts ) );
94  for( Size i =1; i <= dat->nrad(); ++i ) {
95  for( Size j =1; j <= dat->npr(); ++j ) {
96  }}
97  }}
98 */
99 
100  using namespace protocols;
101  using namespace simple_filters;
102 
103  PackStatFilter();
104  PackStatFilter psfilter;
105 
106  core::Real packing_score = psfilter.compute( pose );
107 
108 
109  return packing_score;}
110 
111 
112  void
114  core::pose::Pose & pose,
115  core::Size position,
117 
118  // This helper function sets up a movemap to only allow freedom for
119  // a position and its neighbors
120 
121  core::scoring::EnergyGraph const & energy_graph( pose.energies().energy_graph() );
122 
123  // Defaulting to immobile
124  mmap->set_chi( false );
125  mmap->set_bb( false );
126  mmap->set_jump( false );
127 
129  iru = energy_graph.get_node( position )->const_upper_edge_list_begin(),
130  irue = energy_graph.get_node( position )->const_upper_edge_list_end();
131  iru != irue; ++iru ) {
132  int const nbr_position( (*iru)->get_second_node_ind() );
133  //std::cout << "Neighbors for " << position << " include " << nbr_position << std::endl;
134 
135  mmap->set_chi( nbr_position, true );
136  mmap->set_bb( nbr_position, true );
137  }
138  }
139 
140 
141 
142 }}
143 
144 
145