29 #include <ObjexxFCL/FArray1D.hh>
30 #include <ObjexxFCL/FArray2D.hh>
35 #include <utility/vector1.fwd.hh>
37 #include <utility/exit.hh>
38 #include <basic/Tracer.hh>
44 #include <numeric/xyzVector.hh>
56 #include <utility/vector1.hh>
60 static basic::Tracer
tr(
"core.scoring.dssp");
63 using namespace basic;
64 using namespace ObjexxFCL;
190 hbond_bb_pair_score.dimension(total_residue, total_residue);
191 hbond_bb_pair_score = 0.0f;
201 for (
Size i = 1; i <= total_residue; ++i ) {
203 for (
Size j = 1; j <= total_residue; ++j ) {
206 if ( i == j || i - j == 1 || j - i == 1 )
continue;
215 if ( pose.
xyz( CA1 ).distance( pose.
xyz( CA2 ) ) > 10.0 )
continue;
230 rON = pO.distance( pN );
231 rCN = pC.distance( pN );
236 runtime_assert( rtj.has(
"N" ) );
237 for (
Size hatom = rtj.attached_H_begin( rtj.atom_index(
"N" ) ), ehatom = rtj.attached_H_end( rtj.atom_index(
"N" ) );
238 hatom <= ehatom; ++hatom ) {
243 rOH = pH.distance( pO );
244 rCH = pH.distance( pC );
245 Real E = 27.888f * ( 1.0f / rON + 1.0f / rCH - 1.0f / rOH - 1.0f / rCN);
248 if ( E < hbond_bb_pair_score(i, j) ) {
249 hbond_bb_pair_score(i, j) =
E;
259 Dssp::dssp( FArray1_char &secstruct ) {
260 for(
Size i = 1; i <= total_residue_; i++)
261 secstruct(i) = dssp_secstruct_(i);
265 Dssp::dssp_featurizer( FArray1_char &secstruct ) {
266 for(
Size i = 1; i <= total_residue_; i++ ) {
267 if( dssp_secstruct_(i) ==
'H' || dssp_secstruct_(i) ==
'G' || dssp_secstruct_(i) ==
'I' ) {
269 }
else if(dssp_secstruct_(i) ==
'B' || dssp_secstruct_(i) ==
'E') {
271 secstruct(i) = pair_set_->featurizer_state(i);
272 }
else secstruct(i) =
'L';
304 Dssp::dssp_reduced( FArray1_char &secstruct ) {
305 for(
Size i = 1; i <= total_residue_; i++ ) {
306 if( dssp_secstruct_(i) ==
'H' || dssp_secstruct_(i) ==
'G' || dssp_secstruct_(i) ==
'I' ) {
308 }
else if(dssp_secstruct_(i) ==
'B' || dssp_secstruct_(i) ==
'E') {
310 }
else secstruct(i) =
'L';
315 Dssp::dssp_reduced() {
316 dssp_reduced( dssp_secstruct_ );
361 float dssp_hbond_threshold = -0.5;
363 dssp_secstruct_.dimension(total_residue_);
369 for (
Size i = 1; i <= total_residue_; i++ ) dssp_secstruct_(i) =
' ';
374 if( total_residue_ > 5 ) {
375 for (
Size i=1; i <= total_residue_-5; i++ ) {
376 if ( hbond_bb_pair_score_(i, i + 5) < dssp_hbond_threshold ) {
377 helix = i < total_residue_ - 5 &&
378 hbond_bb_pair_score_(i + 1, i + 6) < dssp_hbond_threshold;
379 for (
Size j = 1; j < 6; j++) {
381 dssp_secstruct_(i + j) =
'I';
382 else if ( j < 5 && dssp_secstruct_(i + j) ==
' ' )
383 dssp_secstruct_(i + j) =
'T';
389 if( total_residue_ > 3 ) {
390 for (
Size i = 1; i <= total_residue_ - 3; i++ ) {
391 if ( hbond_bb_pair_score_(i, i + 3) < dssp_hbond_threshold ) {
392 helix = i < total_residue_ - 3 &&
393 hbond_bb_pair_score_(i + 1, i + 4) < dssp_hbond_threshold;
394 for (
Size j = 1; j < 4; j++ ) {
396 dssp_secstruct_(i+j) =
'G';
397 else if ( j < 3 && dssp_secstruct_(i+j) ==
' ' )
398 dssp_secstruct_(i+j) =
'T';
405 pair_set_ =
new StrandPairingSet( hbond_bb_pair_score_, dssp_hbond_threshold, pose );
407 for (
Size i = 1; i <= total_residue_; i++ ) {
408 char state = pair_set_->dssp_state(i);
409 if ( state !=
' ' ) dssp_secstruct_(i) = state;
413 if( total_residue_ > 4 ) {
414 for (
Size i = 1; i <= total_residue_ - 4; i++ ) {
415 if ( hbond_bb_pair_score_(i, i + 4) < dssp_hbond_threshold ) {
416 helix = i < total_residue_ - 4 &&
417 hbond_bb_pair_score_(i + 1, i + 5) < dssp_hbond_threshold;
418 for (
Size j = 1; j < 5; j++ ) {
424 dssp_secstruct_(i + j) =
'H';
425 else if(j < 4 && dssp_secstruct_(i + j) ==
' ')
426 dssp_secstruct_(i + j) =
'T';
433 if( total_residue_ > 2 ) {
434 for (
Size i = 3; i <= total_residue_ - 2; i++ ) {
441 if ( dssp_secstruct_(i) ==
' ' ) {
444 Real dot = angle_of( v1, v2 );
445 if ( dot < .34202014 )
446 dssp_secstruct_(i) =
'S';
453 Dssp::paired(
Size res1,
Size res2,
bool antiparallel) {
454 return pair_set_->paired(res1, res2, antiparallel);
461 dssp_reduced( dssp_secstruct_ );
462 for (
core::Size i = 1; i <= total_residue_; ++i ) {
470 return dssp_secstruct_( resid );
474 Dssp::get_dssp_secstruct() {
475 dssp_reduced( dssp_secstruct_ );
477 for (
core::Size i = 1; i <= total_residue_; ++i ) {
478 sequence += dssp_secstruct_( i );
486 return hbond_bb_pair_score_( res1, res2 );