Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SICSearchPattern.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
11 /// @brief
12 /// @author
13 
14 #include <utility/vector1.hh>
15 #include <utility/pointer/ReferenceCount.hh>
16 #include <utility/pointer/owning_ptr.hh>
17 
18 #include <numeric/xyzVector.hh>
19 #include <numeric/xyzMatrix.hh>
20 #include <numeric/xyz.functions.hh>
21 
22 #include <basic/Tracer.hh>
23 
24 #include <core/types.hh>
25 
26 #include <core/pose/Pose.hh>
27 
29 
34 
35 #include <core/kinematics/Stub.hh>
36 #include <core/kinematics/RT.hh>
37 
39 
42 
43 namespace protocols {
44 namespace hotspot_hashing {
45 
46 static basic::Tracer TR( "protocols.hotspot_hashing.SICSearchPattern" );
47 
49  core::pose::Pose const & source_pose,
50  core::pose::Pose const & placed_pose,
51  SearchPatternOP slide_pattern,
52  SearchPatternOP source_pattern,
53  core::Real starting_displacement) :
54  sic_fast_(),
55  starting_displacement_(starting_displacement),
56  slide_pattern_(slide_pattern),
57  source_pattern_(source_pattern)
58 {
59  TR.Debug << "Initializing SICPatternAtTransform." << std::endl;
60  sic_fast_.init(placed_pose, source_pose);
61 }
62 
64  core::pose::Pose const & source_pose,
65  core::pose::Pose const & placed_pose,
66  SearchPatternOP slide_pattern,
67  core::Real starting_displacement) :
68  sic_fast_(),
69  starting_displacement_(starting_displacement),
70  slide_pattern_(slide_pattern),
71  source_pattern_(new ConstPattern())
72 {
73  TR.Debug << "Creating SICPatternAtTransform with no source pattern."<< std::endl;
74  sic_fast_.init(placed_pose, source_pose);
75 }
76 
78 {
80 
81  utility::vector1<core::kinematics::Stub> slide_locations = slide_pattern_->Searchpoints();
82  utility::vector1<core::kinematics::Stub> source_transforms = source_pattern_->Searchpoints();
83 
84  TR.Debug << "Initializing SICPatternAtTransform with " << slide_locations.size() << " slide locations." << std::endl;
85  TR.Debug << "Initializing SICPatternAtTransform with " << source_transforms.size() << " source transforms." << std::endl;
86 
87  result_transforms.reserve(slide_locations.size() * source_transforms.size());
88 
89  for (core::Size i = 1; i <= slide_locations.size(); i++)
90  {
91  TR.Trace << "slide " << i << " " << slide_locations[i].local2global(Vector(0)) << " " << slide_locations[i].local2global(Vector(1, 0, 0)) << "\n";
92 
93  for (core::Size j = 1; j <= source_transforms.size(); j++)
94  {
97 
98 
99  // Get transform relating the source transform to the global coord frame,
100  // then apply that rt at the slide location frame to produce new stub
101  Stub source_at_slide_location;
102  RT(core::kinematics::default_stub, source_transforms[j]).make_jump(slide_locations[i], source_at_slide_location);
103 
104  TR.Trace << "pre-slide " << i << " " << j << " " << source_at_slide_location.local2global(Vector(0)) << " " << source_at_slide_location.local2global(Vector(1, 0, 0)) << "\n";
105 
106  Vector slide_vector = slide_locations[i].M * Stub::Vector(1,0,0);
107 
108  source_at_slide_location.v -= slide_vector * starting_displacement_;
109 
110  core::Real sic_distance = sic_fast_.slide_into_contact(
111  source_at_slide_location,
113  -slide_vector);
114 
115  source_at_slide_location.v += -slide_vector * sic_distance;
116 
117  TR.Trace << "post-slide " << i << " " << j << " " << source_at_slide_location.local2global(Vector(0)) << " " << source_at_slide_location.local2global(Vector(1, 0, 0)) << "\n";
118 
119  result_transforms.push_back(source_at_slide_location);
120  }
121  }
122 
123  TR.Trace << std::endl;
124 
125  return result_transforms;
126 }
127 }
128 }