Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CovalentCompliance.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 /// @author Oliver Lange
11 
12 
13 // Unit Headers
15 
16 // Package Headers
17 
18 // Project Headers
19 
20 // Utility headers
21 
22 // C++ headers
23 
24 namespace protocols {
25 namespace noesy_assign {
26 
27 bool fall_back( core::id::NamedAtomID const& _atom1, core::id::NamedAtomID const& _atom2 ) {
28  bool flip = _atom1.rsd() > _atom2.rsd();
29  core::id::NamedAtomID const& atom1( flip ? _atom2 : _atom1 );
30  core::id::NamedAtomID const& atom2( flip ? _atom1 : _atom2 );
31  //, core::pose::Pose const& pose, Real dmax ) {
32 
33  //compute upper distances for atoms less than 2 torsions apart.
34  //if residues are not sequential this we will not happen
35  if ( atom2.rsd() - atom1.rsd() > 1 ) return false;
36 
37  if ( atom1.rsd() != atom2.rsd() ) { //sequential --- only Ha - H
38  if ( atom1.atom() == "HA" && atom2.atom() == "H" ) {
39  return true;
40  }
41  //no more sequential cases
42  return false;
43  }
44 
45  ///change Oct 12 2010: intra-residue is always true
46  return true;
47 
48  //intra-residue
49  if ( atom1.atom() == "H" || atom2.atom() == "H" ) {
50  if ( atom1.atom() == "HA" || atom2.atom() == "HA" ) { // H - HA or HA-H
51  return true;
52  }
53  if ( (atom1.atom().find("B") != std::string::npos) || (atom2.atom().find("B") !=std::string::npos )) {
54  return true;
55  }
56  return false; // H- HX (HX not HA,HB ) that will be more than two torsion angles
57  }
58 
59  if ( atom1.atom() == "HA" || atom2.atom() == "HA" ) {
60  return true; // for now assume any HA-HX connection is close enough...
61  }
62 
63  //both protons are not on backbone (call this good enough... ).
64  if ( atom1.atom() != "H" && atom1.atom().find("A") == std::string::npos && atom2.atom() != "H" && atom2.atom().find("A") == std::string::npos ) {
65  return true;
66  }
67 
68  //two torsions between HA and HG
69  if ( atom1.atom().find("A") != std::string::npos && atom2.atom().find("G") != std::string::npos ) return true;
70  if ( atom2.atom().find("A") != std::string::npos && atom1.atom().find("G") != std::string::npos ) return true;
71 
72 
73 
74  return false;
75  //now what to do with QB, QG, etc. treat as one of the H with same name...
76  // heavy atoms as main dimensions ( some of paolos data sets? )
77 
78  //translate QB, QG, QD into HA, HB, HD, etc
79  // AmbiguousNMRDistanceConstraint translator( atom1, atom2, pose, NULL );
80  // AtomID num_atom1( translator.atom( 1 ) );
81  // AtomID num_atom2( translator.atom( translator.natoms( 1 )+1 ) );
82 
83  //how to find torsion angles between two atoms?
84  //okay we are definitely intra-residue... (if we just look at protons... )
85  //i guess one can take highest atom number and work up the atom-tree until number is lower or equal than the target.
86  // if it is to low go down some other branch...
87 
88  //this is highly complicated.. and will not yield to much benefit. the local structure of decoys
89  // should be pretty good and we will see those NOEs recommended from there.
90 }
91 
92 CovalentCompliance* CovalentCompliance::instance_( 0 );
93 
95  covalent_distances_( NULL )
96 {}
97 
99  if ( instance_ == 0 ) {
101  }
102  return instance_;
103 }
104 
106  if ( instance_ == 0 ) {
108  }
109  return instance_;
110 }
111 
113  covalent_distances_ = new FragsToAtomDist( file );
114 }
115 
117  if ( covalent_distances_ ) {
118  return covalent_distances_->distance( atom1, atom2 ) < cutoff;
119  } else {
120  return fall_back( atom1, atom2 );
121  }
122 }
123 
125  if ( covalent_distances_ ) {
126  return covalent_distances_->distance( atom1, atom2 );
127  } else {
128  if ( fall_back( atom1, atom2 ) ) {
129  return 3.0;
130  } else {
131  return 100.0;
132  }
133  }
134 }
135 
136 
137 }
138 }