28 #include <numeric/conversions.hh>
29 #include <numeric/random/random.hh>
30 #include <numeric/trig.functions.hh>
31 #include <numeric/xyz.functions.hh>
32 #include <numeric/xyzMatrix.hh>
34 #include <basic/Tracer.hh>
36 #include <utility/vector1.hh>
43 static THREAD_LOCAL basic::Tracer
TR(
"protocols.geometry.RB_geometry" );
45 using namespace ObjexxFCL;
60 numeric::xyzMatrix_double
68 numeric::conversions::degrees( std::acos(numeric::sin_cos_range( 1.0 - 2.0 *
numeric::random::rg().uniform() ) ) )
71 TR <<
"random_reorientation_matrix phi: " << phi <<
" psi: " << psi <<
" theta: " << theta << std::endl;
73 numeric::z_rotation_matrix_degrees( psi ) *
74 numeric::y_rotation_matrix_degrees( theta ) *
75 numeric::z_rotation_matrix_degrees( phi );
90 utility::vector1< bool > ok_for_centroid_calculation;
91 centroids_by_jump( pose, jump_id, upstream_ctrd, downstream_ctrd, ok_for_centroid_calculation );
103 utility::vector1< bool > ok_for_centroid_calculation
111 int upstream_atoms = 0, downstream_atoms = 0;
113 for (
int ii = 1, ii_end = pose.
total_residue(); ii <= ii_end; ++ii ) {
116 int & natoms = ( is_upstream(ii) ? upstream_atoms : downstream_atoms );
117 core::Vector & ctrd = ( is_upstream(ii) ? upstream_ctrd : downstream_ctrd );
120 if ( ok_for_centroid_calculation.size() > 0 && !ok_for_centroid_calculation[ ii ] ) {
125 for (
int jj = 1, jj_end = rsd.
natoms(); jj <= jj_end; ++jj ) {
137 if ( upstream_atoms > 0 ) upstream_ctrd /= upstream_atoms;
138 else TR <<
"critical error: upstream_atoms was zero; could not divide!" << std::endl;
141 if ( downstream_atoms > 0 ) downstream_ctrd /= downstream_atoms;
142 else TR <<
"critical error: downstream_atoms was zero; could not divide!" << std::endl;
151 std::pair<core::Vector, core::Vector > centroids;
183 TR.Debug <<
"fold-tree: " << pose.
fold_tree() << std::endl;
184 TR.Debug <<
"partition by jump " << jump_id << std::endl;
189 core::Size upstream_atoms = 0, downstream_atoms = 0;
194 Size int_res_num = 0;
195 Real int_distance = 8.0;
198 for (
Size ll = 1; ll <= 5; ll++ ) {
199 if ( int_res_num == 0 ) {
209 int_distance = int_distance+2;
214 Size & natoms = ( is_upstream(ii) ? upstream_atoms : downstream_atoms );
215 core::Vector & ctrd = ( is_upstream(ii) ? upstream_ctrd : downstream_ctrd );
217 for (
Size jj = 1, jj_end = rsd.
natoms(); jj <= jj_end; ++jj ) {
225 if ( upstream_atoms == 0 || downstream_atoms == 0 ) {
226 TR.Warning <<
"centroids_by_jump_int called but no interface detected!!" << std::endl;
227 TR.Warning <<
"calling centroids_by_jump..." << std::endl;
230 upstream_ctrd /= upstream_atoms;
231 downstream_ctrd /= downstream_atoms;
249 numeric::xyzVector< core::Real>
257 for (
int i=start; i<=
stop; ++i ) {
266 center /= (stop-start+1);
kinematics::FoldTree const & fold_tree() const
Returns the pose FoldTree.
void centroids_by_jump_int(core::pose::Pose const &pose, core::Size jump_id, core::Vector &upstream_ctrd, core::Vector &downstream_ctrd)
Unweighted centroids of all atoms upstream of the jump vs. all atoms downstream of the jump for inter...
void calculate(core::pose::Pose const &pose)
base for calculating the interface
A molecular system including residues, kinematics, and energies.
void centroids_by_jump(core::pose::Pose const &pose, core::Size const jump_id, core::Vector &upstream_ctrd, core::Vector &downstream_ctrd, utility::vector1< bool > ok_for_centroid_calculation)
Unweighted centroids of all atoms upstream of the jump vs. all atoms downstream of the jump...
numeric::xyzVector< core::Real > center_of_mass(core::pose::Pose const &pose, int const start, int const stop)
calculates the center of mass of a pose
void partition_by_jump(int const jump_number, FoldTree &f1, FoldTree &f2) const
partition into two foldtrees by cutting at jump= jump_number
core::Vector downstream_centroid_by_jump(core::pose::Pose const &pose, core::Size jump_id)
Size total_residue() const
Returns the number of residues in the pose conformation.
core::Vector upstream_centroid_by_jump(core::pose::Pose const &pose, core::Size jump_id)
numeric::xyzMatrix_double random_reorientation_matrix(const double phi_range, const double psi_range)
numeric::xyzVector< Length > Vector
bool is_interface(core::conformation::Residue const &rsd) const
Method declarations and simple accessor definitions for the Residue class.
Residue const & residue(Size const seqpos) const
Returns the Residue at position (read access) Note: this method will trigger a refold if eit...
void distance(Real const distance_in)
static THREAD_LOCAL basic::Tracer TR("protocols.geometry.RB_geometry")
std::pair< core::Vector, core::Vector > centroid_pair_by_jump(core::pose::Pose const &pose, core::Size jump_id)