48 #include <numeric/histograms/TwoDHistogram.hh>
50 #include <numeric/xyzVector.hh>
56 #include <utility/vector1.hh>
65 #include <basic/options/option.hh>
66 #include <basic/options/keys/orbitals.OptionKeys.gen.hh>
74 #ifdef _WIN32 // REQUIRED FOR WINDOWS
75 double round(
double d ) {
76 return (d > 0.0) ? floor(d + 0.5) : ceil(d - 0.5);
78 #endif // REQUIRED FOR WINDOWS
84 basic::options::option[basic::options::OptionKeys::orbitals::Haro] ||
85 basic::options::option[basic::options::OptionKeys::orbitals::Hpol])
91 std::pair<core::Size, core::SSize>
pair(i,j);
134 numeric::histograms::TwoDHistogram<core::Size, core::SSize> & histogram
138 if(angle >= -1 && angle <= -.9){
141 if(angle >= -.89 && angle <= -.8){
144 if(angle >= -.79 && angle <= -.7){
147 if(angle >= -.69 && angle <= -.6){
150 if(angle >= -.59 && angle <= -.5){
153 if(angle >= -.49 && angle <= -.4){
156 if(angle >= -.39 && angle <= -.3){
159 if(angle >= -.29 && angle <= -.2){
162 if(angle >= -.19 && angle <= -.1){
165 if(angle >= -.09 && angle <= 0){
168 if(angle >= 0.01 && angle <= .1){
171 if(angle >= .11 && angle <= .2){
174 if(angle >= .21 && angle <= .3){
177 if(angle >= .31 && angle <= .4){
180 if(angle >= .41 && angle <= .5){
183 if(angle >= .51 && angle <= .6){
186 if(angle >= .61 && angle <= .7){
189 if(angle >= .71 && angle <= .8){
192 if(angle >= .81 && angle <= .9){
195 if(angle >= .91 && angle <= 1){
200 std::pair< core::Size, core::SSize> new_pair(new_dist, new_angle);
201 histogram.increase_count(new_pair);
212 numeric::histograms::TwoDHistogram<core::Size, core::SSize> histogram=
twoD_histogram_;
220 histogram_vector.push_back(histogram);
246 for ( core::chemical::AtomIndices::const_iterator
249 atom_index != atom_end; ++atom_index
258 orbital_index = orbital_indices.begin(),
259 orbital_end = orbital_indices.end();
260 orbital_index != orbital_end; ++orbital_index
266 basic::options::option[basic::options::OptionKeys::orbitals::Hpol]
271 core::chemical::AtomIndices::const_iterator
273 hpol_end = resid2.
Hpol_index().end(); hpol_index != hpol_end; ++hpol_index
276 res2_H_xyz = resid2.
atom( *hpol_index ).
xyz();
278 core::Real container = orb_xyz.distance( res2_H_xyz );
279 if(container <= low_D){
280 final_orb_xyz = orb_xyz;
281 angle = cos_of(bonded_atom_xyz, orb_xyz, res2_H_xyz );
282 angle2 = cos_of(DHO_atom_xyz, res2_H_xyz, orb_xyz);
285 res2name= resid2.
name3();
286 res2seqpos=resid2.
seqpos();
287 atom_index_min_dist=*hpol_index;
294 if(basic::options::option[basic::options::OptionKeys::orbitals::Haro]){
295 for(core::chemical::AtomIndices::const_iterator
297 haro_end = resid2.
Haro_index().end(); haro_index != haro_end; ++haro_index)
299 res2_H_xyz = resid2.
atom( *haro_index ).
xyz();
301 core::Real container = orb_xyz.distance( res2_H_xyz );
302 if(container <= low_D){
303 angle = cos_of(bonded_atom_xyz, orb_xyz, res2_H_xyz );
304 angle2 = cos_of(DHO_atom_xyz, res2_H_xyz, orb_xyz);
307 res2name= resid2.
name3();
308 res2seqpos=resid2.
seqpos();
309 atom_index_min_dist=*haro_index;
327 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" "<< pdb.
pdb_info()->name() <<
" " << final_orb_xyz.x() <<
" " << final_orb_xyz.y() <<
" " << final_orb_xyz.z() << std::endl;
331 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
335 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
340 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
344 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
348 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
352 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
356 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
378 numeric::histograms::TwoDHistogram<core::Size, core::SSize> histogram=
twoD_histogram_;
386 histogram_vector.push_back(histogram);
410 for ( core::chemical::AtomIndices::const_iterator
413 atom_index != atom_end; ++atom_index
421 orbital_index = orbital_indices.begin(),
422 orbital_end = orbital_indices.end();
423 orbital_index != orbital_end; ++orbital_index
429 basic::options::option[basic::options::OptionKeys::orbitals::Hpol]
434 core::chemical::AtomIndices::const_iterator
436 hpol_end = resid2.
Hpol_index().end(); hpol_index != hpol_end; ++hpol_index
439 res2_H_xyz = resid2.
atom( *hpol_index ).
xyz();
440 core::Real container = orb_xyz.distance( res2_H_xyz );
442 if(container <= low_D){
443 angle = cos_of(bonded_atom_xyz, orb_xyz, res2_H_xyz );
444 angle2 = cos_of(DHO_atom_xyz, res2_H_xyz, orb_xyz);
447 res2name= resid2.
name3();
448 res2seqpos=resid2.
seqpos();
449 atom_index_min_dist=*hpol_index;
454 if(basic::options::option[basic::options::OptionKeys::orbitals::Haro]){
455 for(core::chemical::AtomIndices::const_iterator
457 haro_end = resid2.
Haro_index().end(); haro_index != haro_end; ++haro_index)
459 res2_H_xyz = resid2.
atom( *haro_index ).
xyz();
460 core::Real container = orb_xyz.distance( res2_H_xyz );
462 if(container <= low_D){
463 angle = cos_of(bonded_atom_xyz, orb_xyz, res2_H_xyz );
464 angle2 = cos_of(DHO_atom_xyz, res2_H_xyz, orb_xyz);
467 res2name= resid2.
name3();
468 res2seqpos=resid2.
seqpos();
469 atom_index_min_dist=*haro_index;
486 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
490 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
494 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
499 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
503 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
507 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
511 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;
515 statistics_output_ << resid1.
name3() << resid1.
seqpos() <<
" " << res2name << res2seqpos <<
" "<< low_D <<
" " << angle <<
" " << angle2 <<
" " << pdb.
pdb_info()->name() << std::endl;