Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
xyzStripeHashPose.hh
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 #ifndef INCLUDED_protocols_sic_dock_xyzStripeHashPose_hh
11 #define INCLUDED_protocols_sic_dock_xyzStripeHashPose_hh
12 
15 #include <numeric/geometry/hashing/xyzStripeHash.hh>
16 
17 #include <core/pose/Pose.hh>
20 #include <core/id/AtomID.hh>
21 #include <core/id/AtomID_Map.hh>
22 
23 #include <platform/types.hh>
24 
25 namespace protocols {
26 namespace sic_dock {
27 
28 
29 class xyzStripeHashPose : public numeric::geometry::hashing::xyzStripeHash<double> {
30 public:
32  double radius
33  ):
34  numeric::geometry::hashing::xyzStripeHash<double>(radius)
35  {}
36 
38  double radius,
39  core::pose::Pose const & p,
41  ):
42  numeric::geometry::hashing::xyzStripeHash<double>(radius)
43  {
44  init_with_pose(p,m);
45  }
46 
48  double radius,
49  core::pose::Pose const & p,
50  core::id::AtomID_Map<double> const & amap
51  ):
52  numeric::geometry::hashing::xyzStripeHash<double>(radius)
53  {
54  init_with_pose(p,amap);
55  }
56 
57  void
59  core::pose::Pose const & p,
61  ){
62  using core::id::AtomID;
63  int natom = 0;
64  if( amap.n_residue() != p.n_residue()) utility_exit_with_message("BAD ATOMID_MAP");
65  for(int ir = 1; ir <= (int)p.n_residue(); ++ir) {
66  // core::conformation::Residue const & r(p.residue(ir));
67  for(int ia = 1; ia <= (int)amap.n_atom(ir); ia++) {
68  if(amap[AtomID(ia,ir)] > 0) natom++;
69  }
70  }
72  // utility::vector1<double> meta (natom);
73  platform::uint count = 0;
74  for(int ir = 1; ir <= (int)p.n_residue(); ++ir) {
75  // core::conformation::Residue const & r(p.residue(ir));
76  for(int ia = 1; ia <= (int)amap.n_atom(ir); ia++) {
77  if(amap[AtomID(ia,ir)] > 0) {
78  atoms[++count] = p.xyz(AtomID(ia,ir));
79  // meta [ count] = amap[AtomID(ia,ir)];
80  }
81  }
82  }
83  init(atoms);
84  }
85 
86  void
88  core::pose::Pose const & p,
90  ){
91  int natom = 0;
92  for(int ir = 1; ir <= (int)p.n_residue(); ++ir) {
93  core::conformation::Residue const & r(p.residue(ir));
94  if( CA==m ){ if(r.has("CA")){ natom++; }}
95  else if( CB==m ){ if(r.has("CB")){ natom++; }}
96  else if( NBR==m ) natom++;
97  else if( BB ==m ) natom += r.has("N")+r.has("CA")+r.has("C")+r.has("O")+r.has("CB");
98  else if( HVY==m ) natom += r.nheavyatoms();
99  else if( ALL==m ) natom += r.natoms();
100  }
102  utility::vector1<double> meta (natom);
103  platform::uint count = 0;
104  for(int ir = 1; ir <= (int)p.n_residue(); ++ir) {
105  core::conformation::Residue const & r(p.residue(ir));
106  if(CA==m){
107  if(r.has("CA")){ atoms[++count]=r.xyz("CA"); }
108  } else if(CB==m) {
109  if(r.has("CB")){ atoms[++count]=r.xyz("CB"); }
110  } else if(NBR==m) {
111  int ia = r.nbr_atom();
112  core::id::AtomID const aid(ia,ir);
113  atoms[++count] = p.xyz(aid);
114  meta [ count] = r.atom_type(ia).lj_radius();
115  } else if(BB==m) {
116  if(r.has( "N")){ atoms[++count]=r.xyz( "N"); }
117  if(r.has("CA")){ atoms[++count]=r.xyz("CA"); }
118  if(r.has( "C")){ atoms[++count]=r.xyz( "C"); }
119  if(r.has( "O")){ atoms[++count]=r.xyz( "O"); }
120  if(r.has("CB")){ atoms[++count]=r.xyz("CB"); }
121  } else if(BB==m) {
122  if(r.has("CA")){ atoms[++count]=r.xyz("CA"); }
123  if(r.has( "C")){ atoms[++count]=r.xyz( "C"); }
124  if(r.has("CB")){ atoms[++count]=r.xyz("CB"); }
125  } else {
126  int natom = (ALL==m) ? r.natoms() : r.nheavyatoms();
127  for(int ia = 1; ia <= natom; ++ia) {
128  core::id::AtomID const aid(ia,ir);
129  atoms[++count] = p.xyz(aid);
130  // meta [ count] = r.atom_type(ia).lj_radius();
131  }
132  }
133  }
134  init(atoms);
135  }
136 
137 };
138 
139 
140 } // namespace sic_dock
141 } // namespace protocols
142 
143 #endif