Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SecondaryStructurePotential.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 /// @file core/scoring/SecondaryStructurePotential.cc
11 /// @brief Scoring manager class header
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 /// @author Phil Bradley
14 
15 // Unit header
17 
18 // Project headers
19 #include <core/pose/Pose.hh>
22 #include <core/chemical/AA.hh>
24 #include <basic/database/open.hh>
27 #include <core/scoring/Energies.hh>
28 #include <basic/datacache/BasicDataCache.hh>
29 
32 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
33 
35 
36 // numeric headers
37 #include <numeric/conversions.hh>
38 #include <numeric/trig.functions.hh>
39 
40 // utility headers
41 #include <utility/pointer/ReferenceCount.hh>
42 
43 #include <utility/io/izstream.hh>
44 //#include <utility/io/ozstream.hh>
45 #include <utility/vector1.hh>
46 #include <basic/prof.hh>
47 // ObjexxFCL headers
48 //#include <ObjexxFCL/ObjexxFCL.hh>
49 // AUTO-REMOVED #include <ObjexxFCL/format.hh>
50 #include <ObjexxFCL/FArray1D.hh>
51 #include <ObjexxFCL/FArray2D.hh>
52 #include <ObjexxFCL/FArray3D.hh>
53 
54 // C++ headers
55 #include <cmath>
56 #include <iostream>
57 
58 //Auto Headers
59 //Auto Headers
62 #include <core/scoring/SS_Info.hh>
64 #include <ObjexxFCL/FArray1A.hh>
65 #include <ObjexxFCL/format.hh>
66 
67 
68 
69 namespace core {
70 namespace scoring {
71 
72 /// @brief default constructor
74  iptsn_( 36 ),
75  pts_( 2, 3, 36, 36 ),
76  ds_( 6 ),
77  idsn_( 6, idsn_initializer ),
78  ids_( 6, ids_initializer ),
79  ssdist_( 4, 2, ssdist_initializer ),
80  hs_dp_( 10, hs_dp_initializer ),
81  rsigma_dot_( 12, 18, 2, 2, rsigma_dot_initializer ),
82  m_term_( 4, m_term_initializer )
83 {
85 }
86 
87 
88 /// helper function
89 SS_Info const &
91 {
92  // ////using core::pose::datacache::CacheableDataType::SS_INFO;
94  assert( dynamic_cast< SS_Info const *>( &( pose.data().get( core::pose::datacache::CacheableDataType::SS_INFO ))));
95  return ( static_cast< SS_Info const &>( pose.data().get( core::pose::datacache::CacheableDataType::SS_INFO )));
96 }
97 
98 /// helper function
99 SS_Info &
101 {
102  // ////using core::pose::datacache::CacheableDataType::SS_INFO;
103 
105  // create new one
107  }
109  assert( dynamic_cast< SS_Info *>( &( pose.data().get( core::pose::datacache::CacheableDataType::SS_INFO ))));
110  return ( static_cast< SS_Info &>( pose.data().get( core::pose::datacache::CacheableDataType::SS_INFO )));
111 }
112 
113 /// helper function
114 void
116  pose::Pose const & pose,
117  BB_Pos & bb_pos
118 )
119 {
120  bb_pos.take_coordinates_from_pose( pose );
121 }
122 
123 
124 ///
125 void
127 {
128  basic::ProfileThis doit( basic::SECONDARY_STRUCTURE_ENERGY );
129 
130  SS_Info & ss_info( retrieve_nonconst_ss_info_from_pose( pose ) );
131 
132  // set the size (does nothing if already correct size)
133  // note that this does NOT clear the results of the last calculation
134  // that must be done by the individual routines using the cached data
135  //
136  ss_info.resize( pose.total_residue() );
137 
138  // fill the backbone position array for fast access to coords during calculation
139  fill_bb_pos( pose, ss_info.bb_pos() );
140 
141  // identify strand and helix segments
142  identify_ss( pose, ss_info.helices(), ss_info.strands() );
143 
144  // std::cout << "identify_ss:\n" << ss_info.helices() << ss_info.strands();
145 
146 }
147 
148 
149 
150 
151 /// @brief score secondary structure
152 void
154  pose::Pose const & pose,
155  SecondaryStructureWeights const & weights,
156  Real & hs_score,
157  Real & ss_score,
158  Real & rsigma_score,
159  Real & sheet_score
160 ) const
161 {
162  basic::ProfileThis doit( basic::SECONDARY_STRUCTURE_ENERGY );
163  ss_score = 0.0;
164  hs_score = 0.0;
165  rsigma_score = 0.0;
166 
167  hspair( pose, hs_score );
168 
169  sspair( pose, weights, ss_score, rsigma_score );
170 
171  sheet_score = sheets_from_dimers( pose ); // execute after scoring sspair
172 }
173 
174 
175 /// @brief score hspair
176 void
178  pose::Pose const & pose,
179  Real & hs_score
180 ) const
181 {
182  basic::ProfileThis doit( basic::SECONDARY_STRUCTURE_HSPAIR_ENERGY );
183  hs_score = 0.0;
184 
185  // retrieve the cached info on SSE's from the pose
186  SS_Info const & ss_info( retrieve_const_ss_info_from_pose( pose ) );
187 
188  Helices const & helices( ss_info.helices() );
189  Strands const & strands( ss_info.strands() );
190  BB_Pos const & bb_pos( ss_info.bb_pos() );
191 
192  if ( strands.total_SS_dimer < 1 || helices.total_HH_dimer < 1 ) return; // helix-strand interactions
193 
194  // are we symmetric?
195  bool symmetric=false;
197  if (core::pose::symmetry::is_symmetric( pose ) ) {
198  symmetric=true;
199  SymmetricConformation const & SymmConf (
200  dynamic_cast<SymmetricConformation const &> ( pose.conformation()) );
201  symm_info = SymmConf.Symmetry_Info()->clone();
202  }
203 
204  EnergyGraph const & energy_graph( pose.energies().energy_graph() );
205 
206  for ( int ss1 = 1; ss1 <= helices.total_HH_dimer; ++ss1 ) {
207  int const HH_resnum_ss1 = helices.HH_resnum(ss1);
208  int const HH_helix_end_1ss1 = helices.HH_helix_end(1,ss1);
209  int const HH_helix_end_2ss1 = helices.HH_helix_end(2,ss1);
210 
211  Vector pt1, pt2;
212  helix_end( HH_resnum_ss1, bb_pos, pt1, pt2 );
213 
214  // loop over ALL the 3D neighbors of seqpos= HH_resnum_ss1 (ie not just standard loop over UPPER nbrs)
216  iru = energy_graph.get_node( HH_resnum_ss1 )->const_edge_list_begin(),
217  irue = energy_graph.get_node( HH_resnum_ss1 )->const_edge_list_end();
218  iru != irue; ++iru ) {
219  int SS_resnum_ss2( (*iru)->get_second_node_ind() );
220 
221  //Edges always have first node < second node. Just in case we picked the wrong one:
222  if (SS_resnum_ss2 == HH_resnum_ss1) SS_resnum_ss2 = (*iru)->get_first_node_ind();
223 
224  int const ss2( strands.SS_dimer( SS_resnum_ss2 ) );
225  if ( ss2 == 0 ) continue;
226 
227  Vector const & pt3( bb_pos.N( SS_resnum_ss2 ) );
228  Vector const & pt4( bb_pos.C( SS_resnum_ss2+1 ) );
229 
230  Vector vdist, cen1, cen2;
231  Real dist;
232  dist_pair(pt1,pt2,pt3,pt4,dist,cen1,cen2,vdist);
233 
234  if ( dist <= 12.0 ) {
235  Real ph, th;
236  spherical(pt2,pt4,ph,th,cen1,cen2,vdist);
237 
238  if ( ph < -180.0 ) {
239  ph += 360.0f;
240  } else if ( ph > 180.0 ) {
241  ph -= 360.0f;
242  }
243 
244  int iph = static_cast< int >(1+(ph+180.0f)/10);
245  if ( iph > 36 ) {
246  iph = 36;
247  } else if ( iph < 1 ) {
248  iph = 1;
249  }
250 
251  int ith = static_cast< int >(1+(th/5));
252  if ( ith > 36 ) {
253  ith = 36;
254  } else if ( ith < 1 ) {
255  ith = 1;
256  }
257 
258  int iseqsep;
259  int itemp = std::min( get_foldtree_seqsep( pose, strands.SS_strand_end(2,ss2), HH_helix_end_1ss1 ) + 1,
260  get_foldtree_seqsep( pose, HH_helix_end_2ss1, strands.SS_strand_end(1,ss2) ) + 1 );
261 // int itemp = std::min( std::abs( strands.SS_strand_end(2,ss2) - HH_helix_end_1ss1 ) + 1,
262 // std::abs( HH_helix_end_2ss1 - strands.SS_strand_end(1,ss2) ) + 1 );
263  if ( itemp >= 2 && itemp <= 10 ) {
264  iseqsep = 2;
265  } else {
266  if ( itemp > 10 ) {
267  iseqsep = 3;
268  } else {
269  iseqsep = 1;
270  }
271  }
272 
273  // std::cout << "hs_intxn: " << HH_resnum_ss1 << ' ' << SS_resnum_ss2 << ' ' << pts_(1,iseqsep,iph,ith) <<
274  // " " << cendist << " " <<
275  // std::endl;
276 
277  if (symmetric) {
278  hs_score += pts_(1,iseqsep,iph,ith)*symm_info->score_multiply(HH_resnum_ss1,SS_resnum_ss2);
279  } else {
280  hs_score += pts_(1,iseqsep,iph,ith);
281  }
282  }
283  } // loop over neighbors of HH_resnum_ss1
284  } // ss1
285 
286 
287  // modify by proper weighting
288  hs_score *= 0.090;
289 }
290 
291 ///////////////////////////////////////////////////////////////////////////////////////////////////////
293 public:
295  int const dimer1_in,
296  int const dimer2_in,
297  int const sign1_in,
298  int const sign2_in,
299  Real const score_in
300  ): dimer1_( dimer1_in ),
301  dimer2_( dimer2_in ),
302  sign1_( sign1_in ),
303  sign2_( sign2_in ),
304  score_( score_in ),
305  valid_( true )
306  {}
307 
308  ///
309  int
310  dimer1() const
311  {
312  return dimer1_;
313  }
314 
315  ///
316  int
317  dimer2() const
318  {
319  return dimer2_;
320  }
321 
322  ///
323  int
324  sign1() const
325  {
326  return sign1_;
327  }
328 
329  ///
330  int
331  sign2() const
332  {
333  return sign2_;
334  }
335 
336  ///
337  Real
338  score() const
339  {
340  return score_;
341  }
342 
343  ///
344  bool
345  valid() const
346  {
347  return valid_;
348  }
349 
350  ///
351  void
352  valid( bool const setting )
353  {
354  valid_ = setting;
355  }
356 
357 private:
358 
359  int dimer1_;
360  int dimer2_;
361  int sign1_;
362  int sign2_;
363 
365 
366  bool valid_; // set to false if it conflicts with higher-scoring dimer
367 
368 };
369 
371 
372 bool
374 {
375  return ( a->score() < b->score() );
376 }
377 
378 ///////////////////////////////////////////////////////////////////////////////////////////////////////
379 /// @brief score sspair
380 
381 void
383  pose::Pose const & pose,
384  SecondaryStructureWeights const & wts,
385  Real & ss_score,
386  Real & rsigma_score
387 ) const
388 {
389  basic::ProfileThis doit( basic::SECONDARY_STRUCTURE_SSPAIR_ENERGY );
390  ////using core::pose::datacache::CacheableDataType::core::pose::datacache::CacheableDataType::SS_KILLHAIRPINS_INFO;
391  ss_score = 0.0;
392  rsigma_score = 0.0;
393 
394  //
395  int const lowstrand( wts.get_ss_lowstrand() );
396  int const cutoff( wts.get_ss_cutoff() );
397 
398  SS_Info const & ss_info( retrieve_const_ss_info_from_pose( pose ) );
399 
400  Strands const & strands( ss_info.strands() );
401  BB_Pos const & bb_pos( ss_info.bb_pos() );
402 
403  if ( strands.total_SS_dimer < 1 ) return;
404 
405  // We need to initialize some things for symmetry scoring. Default we are assymetric
406  bool symmetric=false;
408  if (core::pose::symmetry::is_symmetric( pose ) ) {
409  symmetric=true;
410  SymmetricConformation const & SymmConf (
411  dynamic_cast<SymmetricConformation const &> ( pose.conformation()) );
412  symm_info = SymmConf.Symmetry_Info()->clone();
413  }
414 
415  EnergyGraph const & energy_graph( pose.energies().energy_graph() );
416 
417  // new plan: keep a list of dimer pairs with good interaction energy
418  // sort by energy after compiling
419 
420  typedef utility::vector1< DimerPairingOP > DimerPairings;
421  DimerPairings dimer_pairs;
422 
423  // dimer to dimer score (<6.5A)
424  static FArray1D_real const SS_penalty( 11, ss_penalty_initializer );
425 
426 //car local
427  Real const ssdist_12 = ssdist_(1,2);
428 
429  //car initialize
430  // these are used in the sheet score (?)
431  for ( int ss1 = 1; ss1 <= strands.total_SS_dimer; ++ss1 ) {
432  strands.dimer_neighbor(1,ss1) = 0;
433  strands.dimer_neighbor(2,ss1) = 0;
434  }
435 
436 
437 
438 //car ss1 is the first dimer in the possible pair
439  for ( int ss1 = 1; ss1 < strands.total_SS_dimer; ++ss1 ) {
440 
441  int const SS_resnum_ss1 = strands.SS_resnum(ss1);
442  int const SS_strand_end_1ss1 = strands.SS_strand_end(1,ss1);
443  int const SS_strand_end_2ss1 = strands.SS_strand_end(2,ss1);
444  int & dimer_neighbor_1ss1( strands.dimer_neighbor(1,ss1) );
445  int & dimer_neighbor_2ss1( strands.dimer_neighbor(2,ss1) );
446  int const SS_strand_ss1 = strands.SS_strand(ss1);
447 
448 // SS_resnum(ss1) IS THE SEQUENCE POSITION OF STRAND ss1
449  Vector const & pt1( bb_pos.N( SS_resnum_ss1 ) );
450  Vector const & pt2( bb_pos.C( SS_resnum_ss1+1 ) );
451 
452 //car ss2 is second dimer, always C term to first
453  // loop over the UPPER neighbors of seqpos= SS_resnum_ss1
455  iru = energy_graph.get_node( SS_resnum_ss1 )->const_upper_edge_list_begin(),
456  irue = energy_graph.get_node( SS_resnum_ss1 )->const_upper_edge_list_end();
457  iru != irue; ++iru ) {
458  int const SS_resnum_ss2( (*iru)->get_second_node_ind() );
459  int const ss2( strands.SS_dimer( SS_resnum_ss2 ) );
460 
461  if ( ss2 == 0 ) continue; // skip if this position isnt 1st residue of a dimer
462 
463 // IF TWO DIMERS HAVE A GOOD PHI/THETA AND DOT PRODUCT, ss_orient=1
464  int ss_orient( 0 );
465 
466 //car calculate the sequence separation between the two dimers
467 //car note that this is not the strand separation that phitheta is
468 //car conditioned on; the dimer separation is used to decide which
469 //car pair to count in ss_score based on the value of cutoff
470 
471  int const dimer_seqsep = get_foldtree_seqsep( pose, SS_resnum_ss2, SS_resnum_ss1 );
472 // int const dimer_seqsep = SS_resnum_ss2 - SS_resnum_ss1;
473 
474  int const SS_strand_end_1ss2 = strands.SS_strand_end(1,ss2);
475 
476  if ( SS_strand_end_1ss1 != SS_strand_end_1ss2 ) { // not in same strand
477  Vector const pt3( bb_pos.N( SS_resnum_ss2 ) );
478  Vector const pt4( bb_pos.C( SS_resnum_ss2+1 ) );
479 
480 //car find vector and distance between midpoints
481  Vector cen1, cen2, vdist;
482  Real dist;
483  dist_pair(pt1,pt2,pt3,pt4,dist,cen1,cen2,vdist);
484 
485  Real strand_dist_cutoff = wts.get_strand_dist_cutoff(); // Default is 6.5 Angstroms
486 
487  bool const stretch_strand_dist_cutoff = wts.get_stretch_strand_dist_cutoff();
488  if ( stretch_strand_dist_cutoff ) {
489  Real const seq_sep_scale = wts.get_seq_sep_scale();
490  Real const max_strand_dist_cutoff = wts.get_max_strand_dist_cutoff();
491  strand_dist_cutoff = 6.5 +
492  (max_strand_dist_cutoff - 6.5) *(dimer_seqsep / seq_sep_scale);
493  if (strand_dist_cutoff > max_strand_dist_cutoff) strand_dist_cutoff = max_strand_dist_cutoff;
494  }
495 
496  // std::cout << "dist " << ss1 << ' ' << ss2 << ' ' << dist << ' ' << strand_dist_cutoff << std::endl;
497 
498  if ( dist < strand_dist_cutoff ) {
499 //car find phi and theta
500  Real phi_ss, theta;
501  spherical(pt2,pt4,phi_ss,theta,cen1,cen2,vdist);
502 
503 //car find sequence separation between STRANDS (not between dimers)
504  int const strand_seqsep = get_foldtree_seqsep( pose, SS_strand_end_1ss2, SS_strand_end_2ss1 ) + 1;
505 // int const strand_seqsep = SS_strand_end_1ss2 - SS_strand_end_2ss1 + 1;
506 
507 //car bin all these values...
508  int istrand_seqsep;
509  if ( strand_seqsep >= 2 && strand_seqsep <= 10 ) {
510  istrand_seqsep = 2;
511  } else {
512  if ( strand_seqsep > 10 ) {
513  istrand_seqsep = 3;
514  } else {
515  istrand_seqsep = 1;
516  }
517  }
518 
519  if ( phi_ss > 180.0 ) {
520  phi_ss -= 360.0f;
521  } else if ( phi_ss < -180.0 ) {
522  phi_ss += 360.0f;
523  }
524 
525  int iphi = static_cast< int >(1+(phi_ss+180.0)/10);
526  if ( iphi > 36 ) {
527  iphi = 36;
528  } else if ( iphi < 1 ) {
529  iphi = 1;
530  }
531 
532  int itheta = static_cast< int >(1+(theta/5));
533  if ( itheta > 36 ) {
534  itheta = 36;
535  } else if ( itheta < 1 ) {
536  itheta = 1;
537  }
538 
539 //car find dp_all and sign1,sign2 (convert vdist to unit vec first)
540  Vector const unit_vdist( vdist.normalized() );
541 
542  Real dpall;
543  int sign1, sign2;
544  pair_dp( SS_resnum_ss1, SS_resnum_ss2, bb_pos, dpall, unit_vdist, sign1, sign2 );
545 
546 //car evaluate the first two scoring terms:
547  Real phithetascore = pts_(2,istrand_seqsep,iphi,itheta);
548  Real distscore = 0.0;
549 
550 //rhiju Extra rewards/bonuses for parallel and antiparallel terms. Only affects
551 // long-range pairings.
552  if (theta<90 && istrand_seqsep==3) phithetascore *= wts.get_parallel_weight();
553  if (theta>90 && istrand_seqsep==3) phithetascore *= wts.get_antiparallel_weight();
554 
555 //car save the total score for the pair and the signs
556 //car dimer_pair_score is the total for the dimer pair
557 // LOCAL STRANDS DON'T GET SO MUCH OF A SCORE BONUS
558 //car add terms to pair only if pair separation > cutoff
559 //Objexx: Assumes these arrays have same dimensions as ss_orient
560  Real dimer_pair_score( 0.0 );
561 
562  if ( dimer_seqsep >= cutoff ) {
563  if ( lowstrand > 0.5 ) distscore = ssdist_12;
564  dimer_pair_score += phithetascore + distscore;
565  }
566 
567  // std::cout << "pts: " << ss1 << ' ' << ss2 << ' ' << phithetascore << ' ' << cutoff << std::endl;
568 
569  if ( phithetascore < 0.0 ) {
570 //car bin dpall to get idot
571 //km changed bins 5 and 6
572  int idot;
573  if ( dpall > 0.33 && dpall <= 0.66 ) {
574  idot = 2;
575  } else if ( dpall > 0.66 && dpall <= 1.00 ) {
576  idot = 3;
577  } else if ( dpall > 1.00 && dpall <= 1.33 ) {
578  idot = 4;
579  } else if ( dpall > 1.33 && dpall <= 1.60 ) {
580  idot = 5;
581  } else if ( dpall > 1.60 && dpall <= 1.80 ) {
582  idot = 6;
583  } else if ( dpall > 1.80 && dpall <= 2.00 ) {
584  idot = 5;
585  } else {
586  idot = 1;
587  }
588 
589 //car lookup the dotscore
590  Real dotscore = ds_( idot );
591 
592 //car again, if the distance between pairs is too small, don't add this
593 //car term to the total
594 // LOCAL STRANDS DON'T GET SO MUCH OF A SCORE BONUS
595  if ( dimer_seqsep >= cutoff ) dimer_pair_score += dotscore; // dimer_pair_score(ss1,ss2)
596 
597 //car note that ss_orient is 1 if phithetascore<0 and dotscore<0 and dist<6.5
598 //car but these terms not in dimer_pair_score if dimer_seqsep < cutoff
599  if ( dotscore < 0.0 ) ss_orient = 1; // ss_orient(ss1,ss2)
600 
601 //js quick fix for rsigma dependence on sign1,sign2 by evaluating here.
602 //js
603  Real sig;
604  sigma( pt2, cen1, vdist, sig );
605  if ( sig > 179.0 ) {
606  sig = 179.0;
607  } else if ( sig < 0.0 ) {
608  sig = 0.0;
609  }
610  int isig = static_cast< int >( sig / 10 ) + 1;
611  if ( dist > 6.4 ) {
612  dist = 6.4;
613  } else if ( dist < 3.5 ) {
614  dist = 3.5;
615  }
616  int idist = static_cast< int >( ( dist - 3.5 ) / 0.25 ) + 1;
617 
618  //tempscore_rsigma = rsigma_dot_(idist,isig,sign1,sign2);
619 
620  // The definition of dimer signs (sign1,sign2)
621  // appears inverted (1 should be 2, vice versa).
622  Real tempscore_rsigma = rsigma_dot_(idist, isig, 3 - sign1, 3 - sign2);
623 
624  // Modify sigma potential to no longer give an rsigma bonus
625  // to strands in wrong register.
626  if (sign1 == 1 && sign2 == 1 && sig < 110. && sig > 70.) tempscore_rsigma = 0.0;
627  if (sign1 == 1 && sign2 == 2 && (sig < 75. || sig > 95.)) tempscore_rsigma = 0.0;;
628  if (sign1 == 2 && sign2 == 1 && (sig < 90. || sig > 110.)) tempscore_rsigma = 0.0;
629  if (sign1 == 2 && sign2 == 2 && sig < 120. && sig > 80.) tempscore_rsigma = 0.0;
630 
631  if ( tempscore_rsigma > 0.0 ) {
632 //car add in all unfavorable rsigma scores (these pairs may not contribute
633 //car to ss_score if they have a favorable dimer_pair_score)
634 //car note there are no positive scores in structure_db.cc as of 7/03
635  if (symmetric) { // multiply with score factors for the edge
636  rsigma_score += tempscore_rsigma*symm_info->score_multiply(SS_resnum_ss1, SS_resnum_ss2);
637  } else {
638  rsigma_score += tempscore_rsigma;
639  // std::cout << "rsigma: " << ss1 << ' ' << ss2 << ' ' << tempscore_rsigma << std::endl;
640  }
641  } else {
642 //car and favorable ones if phitheta and dot score favorable & dist<6.5
643 //car note that rsigma is not subject to the favorable-dimer-interactions-must
644 //car be-consistent-pairwise-strands rule that is applied to the ss_score
645 //car below
646  if ( ss_orient == 1 ) {
647  if (symmetric) { // multiply with score factors for the edge
648  rsigma_score += tempscore_rsigma*symm_info->score_multiply(SS_resnum_ss1, SS_resnum_ss2);
649  } else {
650  rsigma_score += tempscore_rsigma;
651  }
652  }
653  // ss_orient(ss1,ss2)
654  }
655 
656  // NOTE: there was a barcode section here in the original classic rosetta code that was taken out
657 
658  //////////////////////////////
659  // barcode sspair constraints:
660  //
662  // these are scored regardless of dimer_seqsep
663  // (eg to penalize hairpins even in score5)
664  // but only if the interaction is favorable
665  // ie dimer_score < 0.0
666  //
667  // the score is equal to
668  // -1 * weight * dimer_score
669  //
670  // the -1 is so that a positive weight in the barcode file
671  // will penalize occurrence of the feature
672  //
673  float tmp_distscore( lowstrand > 0.5 ? ssdist_12 : 0.0 );
674  // reconstruct dimer_score w/o the dimer_seqsep cutoff:
675  float const dimer_score
676  ( phithetascore + tmp_distscore + dotscore );
677  if ( dimer_score < 0.0 ) {
678  // score is added directly to sspair score
679 
680  // offset the residue position for the second dimer
681  // if they are anti-parallel. This has the effect that
682  // if the dimers are aligned, then the residues passed
683  // in will in fact be aligned as well.
684  int const dimer2_offset( theta > 90.0 ? 1 : 0 );
685 
686  core::Size const resnum_ss1( SS_resnum_ss1 );
687  core::Size const resnum_ss2_offset( SS_resnum_ss2+dimer2_offset);
688 
689  //static_cast< SS_KILLHAIRPINS_Info const &>( pose.data().get( core::pose::datacache::CacheableDataType::SS_KILLHAIRPINS_INFO )));
690 
691  float const score_delta( hairpin_killing_score( pose, resnum_ss1,
692  resnum_ss2_offset,
693  theta, dimer_score ));
694  if (symmetric) { // multiply with score factors for the edge
695  ss_score += dimer_pair_score*symm_info->score_multiply(SS_resnum_ss1, SS_resnum_ss2); // [ l ]; // dimer_pair_score(ss1,ss2)
696  ss_score += score_delta*symm_info->score_multiply(SS_resnum_ss1, SS_resnum_ss2);
697  } else {
698  ss_score += score_delta;
699  }
700  //if ( false && std::abs( score_delta ) > 0.1 )
701  if ( false && std::abs( score_delta ) > 0.1 )
702  std::cout << "Apply score: " << score_delta << ' ' <<
703  SS_resnum_ss1 << ' ' << SS_resnum_ss2 << std::endl;
704  }
705  }
706 
707  //BARCODE END
708 
709  // rhiju Allow penalty for locally paired strands to be set by user.
710  int sequence_separation = std::abs( strands.SS_resnum(ss2) - strands.SS_resnum(ss1) );
711  if ( sequence_separation <= 11) {
712  dimer_pair_score += wts.get_localstrandpair_penalty() *
713  SS_penalty(sequence_separation);
714  }
715 
716 //car now add pairs that interact favorably to a list for later trimming...
717 //car pairs that interact unfavorably count toward the ss_score
718 //car and then are zeroed out.
719 
720 // std::cout << "rsigma: " << ss1 << ' ' << ss2 << ' ' << tempscore_rsigma << std::endl;
721 
722  if ( dimer_pair_score < 0.0 ) {
723 //car here we should also build a list of what dimers ss1 and ss2 are close
724 //car to so that we can speed up the check for disallowed pairs at the end
725 //car of this function
726  dimer_pairs.push_back( new DimerPairing( ss1, ss2, sign1, sign2, dimer_pair_score ) );
727 
728  if (symmetric) { // multiply with score factors for the edge
729  // We need to have all possible dimer pairs present for the sheet detection to work. The energy graph does not contain all residues, only the ones in the scoring subunit and edges to the scoring subunit. So we need to add dimer pairongs for no-scoring subunits to make the list complete.
730 
731  // Map a residue pair to all other symmetric pairs and store in a vector of pairs
732  std::vector < std::pair < Size, Size > > symm_ss_pairs (symm_info->map_symmetric_res_pairs( SS_resnum_ss1, SS_resnum_ss2 ) );
733  std::vector< std::pair < Size, Size > >::const_iterator it_begin = symm_ss_pairs.begin();
734  std::vector< std::pair < Size, Size > >::const_iterator it_end = symm_ss_pairs.end();
735  std::vector< std::pair < Size, Size > >::const_iterator it;
736  for ( it = it_begin; it != it_end ; ++it ) {
737  Size clone_SS_resnum_ss1 ( it->first );
738  Size clone_SS_resnum_ss2 ( it->second );
739  int symm_ss1_clone ( strands.SS_dimer ( clone_SS_resnum_ss1 ) );
740  int symm_ss2_clone ( strands.SS_dimer ( clone_SS_resnum_ss2 ) );
741  if ( symm_info->bb_follows( clone_SS_resnum_ss1 ) == 0 || symm_info->bb_follows( clone_SS_resnum_ss2 ) == 0 ) continue; // Do not add we are in a scoring subunit. These are already added...
742  if ( symm_ss1_clone == 0 || symm_ss2_clone == 0 ) continue; // if there are no strands at clone postions...
743  if ( clone_SS_resnum_ss1 > clone_SS_resnum_ss2 ) continue; // strands have to be in sequence order
744 
745  dimer_pairs.push_back( new DimerPairing( symm_ss1_clone, symm_ss2_clone, sign1, sign2, dimer_pair_score ) );
746  }
747  }
748 
749  } else {
750  if (symmetric) { // multiply with the score_mulptipy for the edge
751  if ( symm_info->bb_follows(SS_resnum_ss1) !=0 && symm_info->bb_follows(SS_resnum_ss2) != 0 ) continue; // we have already added this score
752  ss_score += dimer_pair_score*symm_info->score_multiply(SS_resnum_ss1, SS_resnum_ss2); // [ l ]; // dimer_pair_score(ss1,ss2)
753  } else {
754  ss_score += dimer_pair_score; // [ l ]; // dimer_pair_score(ss1,ss2)
755  }
756  }
757  } // good phi/th ( phithetascore<0.0 )
758 
759 //js collect data on neighbors of dimers for making sheets later
760 //js somewhat odd method of selecting the two neighbors for determining what
761 //js makes a sheet. Selects the first and last dimer that follow the current
762 //js dimer in sequence. Not completely sure it is even symmetric.
763 //js There has been discussion of replacing this with something like
764 //js a) a check that these dimers are also well oriented according to SS_strand_score
765 //js b) or possibly using the good two that are selected with later.
766 
767 
768  if ( dist <= 5.5 ) { // && ss_orient(i,j) == 1} ) {
769  if ( dimer_neighbor_1ss1 == 0 ) {
770  dimer_neighbor_1ss1 = ss2;
771  } else if ( strands.SS_strand(dimer_neighbor_1ss1) != strands.SS_strand(ss2) ) {
772  dimer_neighbor_2ss1 = ss2;
773  }
774  if ( ( dimer_neighbor_1ss1 != ss2 ) &&
775  ( dimer_neighbor_2ss1 != ss2 ) ) {
776  if ( strands.dimer_neighbor(1,ss2) == 0 ) {
777  strands.dimer_neighbor(1,ss2) = ss1;
778  } else if ( strands.SS_strand(strands.dimer_neighbor(1,ss2)) != SS_strand_ss1 ) {
779  strands.dimer_neighbor(2,ss2) = ss1;
780  }
781  }
782  } // within sheet distance cutoff (5.5 Angstrom)
783 
784  if (symmetric) { // multiply with score factors for the edge
785  // We need to have all possible dimer pairs present for the sheet detection to work. The energy graph does not contain all residues, only the ones in the scoring subunit and edges to the scoring subunit. So we need to add dimer neighbors for no-scoring subunits to make the list complete.
786 
787 
788  std::vector < std::pair < Size, Size > > symm_ss_pairs (symm_info->map_symmetric_res_pairs( SS_resnum_ss1, SS_resnum_ss2 ) );
789  std::vector< std::pair < Size, Size > >::const_iterator it_begin = symm_ss_pairs.begin();
790  std::vector< std::pair < Size, Size > >::const_iterator it_end = symm_ss_pairs.end();
791  std::vector< std::pair < Size, Size > >::const_iterator it;
792  for ( it = it_begin; it != it_end ; ++it ) {
793  Size clone_SS_resnum_ss1 ( it->first );
794  Size clone_SS_resnum_ss2 ( it->second );
795  int symm_ss1_clone ( strands.SS_dimer ( clone_SS_resnum_ss1 ) );
796  int symm_ss2_clone ( strands.SS_dimer ( clone_SS_resnum_ss2 ) );
797 
798  if ( symm_info->bb_follows( clone_SS_resnum_ss1 ) == 0 || symm_info->bb_follows( clone_SS_resnum_ss2 ) == 0 ) continue;
799  if ( symm_ss1_clone == 0 || symm_ss2_clone == 0 ) continue;
800  if ( clone_SS_resnum_ss1 > clone_SS_resnum_ss2 ) continue;
801 
802  int & dimer_neighbor_1ss1_clone( strands.dimer_neighbor(1,symm_ss1_clone) );
803  int & dimer_neighbor_2ss1_clone( strands.dimer_neighbor(2,symm_ss1_clone) );
804 
805  if ( dist <= 5.5 ) { // && ss_orient(i,j) == 1} ) {
806  if ( dimer_neighbor_1ss1_clone == 0 ) {
807  dimer_neighbor_1ss1_clone = symm_ss2_clone;
808  } else if ( strands.SS_strand(dimer_neighbor_1ss1_clone) != strands.SS_strand(symm_ss2_clone) ) {
809  dimer_neighbor_2ss1_clone = symm_ss2_clone;
810  }
811  if ( ( dimer_neighbor_1ss1_clone != symm_ss2_clone ) &&
812  ( dimer_neighbor_2ss1_clone != symm_ss2_clone ) ) {
813  if ( strands.dimer_neighbor(1,symm_ss2_clone) == 0 ) {
814  strands.dimer_neighbor(1,symm_ss2_clone) = symm_ss1_clone;
815  } else if ( strands.SS_strand(strands.dimer_neighbor(1,symm_ss2_clone)) != strands.SS_strand( symm_ss1_clone ) ) {
816  strands.dimer_neighbor(2,symm_ss2_clone) = symm_ss1_clone;
817  }
818  }
819  } // within sheet distance cutoff (5.5 Angstrom)
820  }
821  }
822 
823  } // within distance cutoff (6.5 Angstrom)
824  } // not the same strand
825  } // nbrs of SS_resnum_ss1
826  } // ss1
827 
828 
829 //car okay, we've now scored all dimer pairs and we have to figure out
830 //car if there are inconsistent pairs on our list (ie each dimer can
831 //car interact with at most two strands, one on each side; note that
832 //car a dimer can interact with multiple dimers on a single side, as long
833 //car as they're in the same strand)
834 //car
835 //car What follows below is very inefficient, but here's the idea:
836 //car loop through the list of favorable pairs to find the best score;
837 //car this pair is 'allowed' and added to the total. This pair now
838 //car defines which strand is to one side of dimer1 and which strand is
839 //car to one side of dimer2 (the side is defined by signdimer). So
840 //car now we loop through all possible dimer pairs and if they are
841 //car not in
842 //car then mark them as disallowed by setting the score for that pair
843 //car (ie dimer_pair_score) to zero.
844 //car Now repeat this for the next-best scoring pair that remains in the
845 //car the favorable pairs list. When there are no more allowed pairs,
846 //car escape.
847 //car this will be sped up enormously by
848 //car 1. sort the allowed pairs list so we just have to loop through it 1x
849 //car 2. save a list (above) of every dimer that a particular dimer is
850 //car near so that marking disallowed pairs is fast
851 
852 // TOTAL SS_SCORE (DONT LET A DIMER INTERACT WITH MORE THAN 2 OTHERS)
853 // UNLESS THE SCORE IS UNFAVORABLE, THEN IT STILL GETS THE PENALTY
854 //car (note the penalties have already been added in)
855 
856 
857 
858  std::sort( dimer_pairs.begin(), dimer_pairs.end(), dimer_pairing_pointer_sorter );
859 
860  for ( DimerPairings::iterator it= dimer_pairs.begin(), ite= dimer_pairs.end(); it != ite; ++it ) {
861  DimerPairing const & pairing( **it );
862  if ( !pairing.valid() ) continue;
863  if (symmetric) { // multiply with score factors for the edge
864  int dim1 ( strands.SS_resnum( pairing.dimer1()) );
865  int dim2 ( strands.SS_resnum( pairing.dimer2()) );
866  if ( symm_info->bb_follows(dim1) !=0 && symm_info->bb_follows(dim2) != 0 ) continue;
867  ss_score += pairing.score()*symm_info->score_multiply( dim1, dim2 );
868  } else {
869  ss_score += pairing.score();
870  }
871 
872  int const dimer1( pairing.dimer1() );
873  int const dimer2( pairing.dimer2() );
874 
875  int const sign1( pairing.sign1() );
876  int const sign2( pairing.sign2() );
877 
878  assert( dimer1 < dimer2 );
879 
880 // std::cout << "ss_dimer: " << strands.SS_resnum(dimer1) << ' ' << strands.SS_resnum(dimer2) << ' ' <<
881 // pairing.score() << std::endl;
882 
883 
884 //DB BONUS FOR NONLOCAL PAIRS!!
885 //car this was added to correct for an excess of local strand pairs
886 //car and really should probably go above where each dimer is calculated...
887 //car ask DB about this...
888 
889  if ( std::abs( strands.SS_resnum(dimer2) - strands.SS_resnum(dimer1) ) > 11 &&
890  std::abs( strands.SS_strand_end(1,dimer2) - strands.SS_strand_end(2,dimer1) ) > 8 ) {
891  if (symmetric) { // multiply with score factors for the edge
892  int dim1 ( strands.SS_resnum( pairing.dimer1()) );
893  int dim2 ( strands.SS_resnum( pairing.dimer2()) );
894  if ( symm_info->bb_follows(dim1) !=0 && symm_info->bb_follows(dim2) != 0 ) continue; // we have already added these
895  ss_score += -0.2*symm_info->score_multiply(strands.SS_resnum(dimer1), strands.SS_resnum(dimer2) );
896  } else {
897  ss_score -= 0.2;
898  }
899  }
900 
901  int const SS_strand_dimer1 = strands.SS_strand( dimer1 );
902  int const SS_strand_dimer2 = strands.SS_strand( dimer2 );
903 
904 // ARE THERE OTHER DIMERS INTERACTING WITH THE BEST PAIR?
905 
906  DimerPairings::iterator it2( it );
907  ++it2;
908 
909  for ( ; it2 != ite; ++it2 ) {
910 
911  DimerPairing & other( **it2 );
912  if ( !other.valid() ) continue;
913 
914  int const other_strand1( strands.SS_strand( other.dimer1() ) );
915  int const other_strand2( strands.SS_strand( other.dimer2() ) );
916 
917 //car if dimer1 and ss2 interact favorably
918 //car and ss2 and dimer2 are in different strands
919 //car and ss2 is on the same side of dimer1 as dimer2 is...
920 //car then mark this pair as dissallowed
921 
922  if ( ( other.dimer1() == dimer1 && other_strand2 != SS_strand_dimer2 && other.sign1() == sign1 ) ||
923  ( other.dimer2() == dimer1 && other_strand1 != SS_strand_dimer2 && other.sign2() == sign1 ) ||
924  ( other.dimer1() == dimer2 && other_strand2 != SS_strand_dimer1 && other.sign1() == sign2 ) ||
925  ( other.dimer2() == dimer2 && other_strand1 != SS_strand_dimer1 && other.sign2() == sign2 ) ) {
926  other.valid( false );
927  }
928  } // it2
929  } // it
930 
931  // modify by proper weighting
932  ss_score *= 0.498 * 0.75;
933  rsigma_score *= 0.1;
934 }
935 
936 
937 ///////////////////////////////////////////////////////////////////////////////
938 ///////////////////////////////////////////////////////////////////////////////
939 float
941  pose::Pose const & pose,
942  Size const & pos1,
943  Size const & pos2,
944  Real const & theta,
945  float const & ss_score
946 ) const
947 {
948  ////using core::pose::datacache::CacheableDataType::core::pose::datacache::CacheableDataType::SS_KILLHAIRPINS_INFO;
949  basic::ProfileThis doit( basic::SECONDARY_STRUCTURE_ENERGY );
950  float total_score(0.0);
951  // will this be too slow? called inside sspair score
952  // for each dimer pair... well -- actually only for dimer_pairs
953  // with favorable dimer scores... probably not too many then
954 
955  //ITERATE OVER HAIRPINS
956  //for ( constraint_const_iterator it = cst_list.begin(),
957  // it_end = cst_list.end(); it != it_end; ++it ) {
959 
960  runtime_assert( dynamic_cast< SS_Killhairpins_Info const *>( &( pose.data().get( core::pose::datacache::CacheableDataType::SS_KILLHAIRPINS_INFO ))));
961  SS_Killhairpins_Info kill_hairpin_info( static_cast< SS_Killhairpins_Info const &>( pose.data().get( core::pose::datacache::CacheableDataType::SS_KILLHAIRPINS_INFO )));
962 
963  if ( theta < 0.0 || theta > 180.0 ) {
964  //CHANGE TO RUNTIME ASSERT
965  std::cout << "WARNING:: sspair_constraint_score: theta should lie " <<
966  " between 0 and 180 degrees! theta = "<< theta << std::endl;
967  return 0.0;
968  }
969 
970  //ALL HAIRPINS ARE ANTIPARALLEL
971  //int const orientation( int_value );
972 
973  if ( (kill_hairpin_info.check_hairpin(pos1, pos2)) && kill_hairpin_info.kill_antiparallel() &&
974  ( theta > 90.0 ) ) { //theta > 90.0 means the pairing is antiparallel
975  float const penalty(100.0); //PENALTY VALUE, MAYBE PUT IN DATA CACHE???
976  // penalty constraint or unmatched bonus constraint
977  total_score += -1 * penalty * ss_score;
978  }
979 
980  if ( (kill_hairpin_info.check_hairpin(pos1, pos2)) && kill_hairpin_info.kill_parallel() &&
981  ( theta <= 90.0 ) ) { //theta <= 90.0 means the pairing is parallel
982  float const penalty(100.0); //PENALTY VALUE, MAYBE PUT IN DATA CACHE???
983  // penalty constraint or unmatched bonus constraint
984  total_score += -1 * penalty * ss_score;
985  }
986 
987  }
988  return total_score;
989 }
990 
991 //////////////////////////////////////
992 //////////////////////////////////////
993 
994 
995 /// @details
996 /// apl This function reads the strand pairing information for all dimer
997 /// apl neighbors to determine how many strands are in each sheet. It
998 /// apl uses a fast conected-component detection data structure to do so.
999 /// apl Once the number of strands for each sheet is known, a per-sheet "poker
1000 /// apl hand score" is computed and these scores summed.
1001 /// apl Old comments follow.
1002 ///
1003 ///js This function takes a set of dimer neighbors, and determines how
1004 ///js many sheets there, and how many strands are in each sheet
1005 ///js This information is then used to calculate the "poker hand" score,
1006 ///js which reflects to probability of that distribution of strands and
1007 ///js sheets.
1008 ///js In current version, it seems to simply penalize sheets with fewer
1009 ///js strands compared to those with more strands.
1010 ///
1011 ///js This function looks at a list of dimers, which contains up to
1012 ///js two neighbors for each dimer. In priniciple these neighbors would
1013 ///js be hydrogen bond partners in neighboring strands. This function
1014 ///js will take this list, however it is made.
1015 ///
1016 ///js Currently, dimer neighbors are defined somewhat arbitrarily.
1017 ///js If I understand the code correctly, the first and last dimers in
1018 ///js sequence that follow the current dimer, and that are within 6.5
1019 ///js angstroms, are the neighbors. There is no orientation dependence
1020 ///js on what counts as a strand neighbor.
1021 ///
1022 ///js A sheet is then loosely defined by all the strands that are connected
1023 ///js by one of these neighbors. This amounts to "single-linkage clustering."
1024 ///js A sheet is determined by the set of strands that can be linked by
1025 ///js the dimer neighbors. Note that a one neighbor is enough to say that
1026 ///js two strands are in a sheet.
1027 ///
1028 ///js The final score is put into sheet_score, and is determined by the
1029 ///js number of sheets of each size.
1030 ///
1031 ///js Basic strategy: go through all dimers, finding neigboring strands
1032 ///js Because each dimer can only have two neighbors we can first search
1033 ///js all the way down one side, and then the other. This will give a set
1034 ///js of dimers that are connected. The strands in which these dimers reside
1035 ///js are then considered connected into sheets. By going through all
1036 ///js dimers with the proper bookkeeping, we can determine how many sheets
1037 ///js there are, and how many strands in each.
1038 
1039 Real
1041  pose::Pose const & pose
1042 ) const
1043 {
1044  basic::ProfileThis doit( basic::SECONDARY_STRUCTURE_SHEETS_FROM_DIMERS_ENERGY );
1045  SS_Info const & ss_info( retrieve_const_ss_info_from_pose( pose ) );
1046  Strands const & strands( ss_info.strands() );
1047  //std::cout << "strands.total_strands " << strands.total_strands << std::endl;
1048 
1049 // We need to set up some stuff for symmetry
1050  bool symmetric=false;
1052  if (core::pose::symmetry::is_symmetric( pose ) ) {
1053  symmetric=true;
1054  SymmetricConformation const & SymmConf (
1055  dynamic_cast<SymmetricConformation const &> ( pose.conformation()) );
1056  symm_info = SymmConf.Symmetry_Info()->clone();
1057  }
1058 
1059 
1060  graph::DisjointSets sheet_sets( strands.total_strands );
1061  for ( int ii = 1; ii <= strands.total_SS_dimer; ++ii ) {
1062  //std::cout << "strands.SS_strand(" << ii << ") = " << strands.SS_strand( ii ) << " with neighbs: " << strands.dimer_neighbor( 1, ii ) << " " << strands.dimer_neighbor( 2, ii ) << std::endl;
1063  int const ii_sheet = strands.SS_strand( ii );
1064  for ( int direction = 1; direction <= 2; ++direction ) {
1065  int const ii_neighbor = strands.dimer_neighbor( direction, ii );
1066  if ( ii_neighbor != 0 ) {
1067  int const ii_neighbor_sheet = strands.SS_strand( ii_neighbor );
1068  sheet_sets.ds_union( ii_sheet, ii_neighbor_sheet );
1069  }
1070  }
1071  }
1072 
1073 
1074  /// This code duplicates r++ behavior -- but it's not at all clear this is what should be done
1075  /*utility::vector1< bool > visited( strands.total_SS_dimer, false );
1076  graph::DisjointSets sheet_sets( strands.total_strands );
1077 
1078  for ( int ii = 1; ii <= strands.total_SS_dimer; ++ii ) {
1079  if ( visited[ ii ] ) continue;
1080  visited[ ii ] = true;
1081  for ( int direction = 1; direction <= 2; ++direction ) {
1082  int searching = ii;
1083  while ( true ) {
1084  int neighbor = strands.dimer_neighbor( direction, ii );
1085  if ( neighbor != 0 ) {
1086  if ( visited[ neighbor ] ) break;
1087  int const searching_sheet = strands.SS_strand( searching );
1088  int const neighbor_sheet = strands.SS_strand( neighbor );
1089  sheet_sets.ds_union( searching_sheet, neighbor_sheet );
1090  visited[ neighbor ] = true;
1091  searching = neighbor;
1092  } else {
1093  break;
1094  }
1095  }
1096  }
1097  }*/
1098 
1099  if ( symmetric ) {
1100  // The basic idea is to go through all sheets and weigh the sheet_score by the multiply_score factors.
1101  // If a sheet is across a subunit interface the score gets weighted by the score factors for that interface.
1102  // Otherwise the weight is equal to the weight of the scoring subunit
1103 
1104  // We need to be able to know in which subunit a particular strand resides. So we make a map of residue
1105  // numbers of the end of a strand to the strand number.
1106  utility::vector1< Size > sheet_sizes_sym;
1107  utility::vector1< Size > strand_to_SS_resnum (strands.total_strands, 1 );
1108  for ( int i = 2; i <= strands.total_SS_dimer; ++i ) {
1109  if ( strands.SS_strand_end(1,i) != strands.SS_strand_end(1,i-1) ) {
1110  strand_to_SS_resnum[ strands.SS_strand( i ) ] = strands.SS_strand_end(1,i);
1111  }
1112  }
1113 
1114  // Create a reduced set of strands that have scoring weights > 0.
1115  utility::vector1< Size > weight_sheets;
1116  graph::DisjointSets reduced_sheet_sets;
1117  std::map< Size, utility::vector1< Size > > const set_and_nodes ( sheet_sets.sets() );
1118  std::map< Size, utility::vector1< Size > >::const_iterator it_start = set_and_nodes.begin();
1119  std::map< Size, utility::vector1< Size > >::const_iterator it_end = set_and_nodes.end();
1120  // Loop over all sheets
1121  for ( std::map< Size, utility::vector1< Size > >::const_iterator it = it_start; it != it_end; ++it ) {
1122  utility::vector1< Size > const node_list ( sheet_sets.nodes_in_set( it->first ) );
1123  utility::vector1< Size >::const_iterator itn_start = node_list.begin();
1124  utility::vector1< Size >::const_iterator itn_end = node_list.end();
1125  Size strand_res_native = 0;
1126  Size weight = 0;
1127  // Loop over all strands in sheet
1128  for ( utility::vector1< Size >::const_iterator itn = itn_start; itn != itn_end; ++itn ) {
1129  Size strand_res (strand_to_SS_resnum[ *itn ] );
1130  // determine the weight. Two cases: in scoring subunit or across an inteface to the scoring
1131  // subunit
1132  if ( symm_info->bb_is_independent( strand_res ) ) {
1133  strand_res_native = strand_res;
1134  weight = symm_info->score_multiply(strand_res_native,strand_res_native);
1135  } else {
1136  if ( strand_res !=0 ) continue; //if we don't have a strand in the scoring subunit
1137  Size new_weight (symm_info->score_multiply(strand_res_native, strand_res) );
1138  if ( new_weight > weight ) weight = new_weight;
1139  }
1140  }
1141  // Only add sheets with weights > 0
1142  if ( weight > 0 ) {
1143  sheet_sizes_sym.push_back( it->second.size() );
1144  weight_sheets.push_back( weight );
1145  }
1146  }
1147 
1148  Real sheet_score( 0.0 );
1149  Size const size_four( 4 );
1150  for ( Size ii = 1; ii <= sheet_sizes_sym.size(); ++ii ) {
1151  sheet_score += weight_sheets[ ii ]*m_term_( std::min( sheet_sizes_sym[ ii ], size_four ) );
1152  }
1153  return sheet_score * 2.019; // pre-weighting from r++::structure.cc:733
1154  }
1155 
1156  utility::vector1< Size > sheet_sizes = sheet_sets.disjoint_set_sizes();
1157 
1158  Real sheet_score( 0.0 );
1159  Size const size_four( 4 );
1160  for ( Size ii = 1; ii <= sheet_sizes.size(); ++ii ) {
1161  sheet_score += m_term_( std::min( sheet_sizes[ ii ], size_four ) );
1162  }
1163 
1164  /// APL -- to be ported in the future
1165  //if ( get_handedness_score_flag() && files_paths::use_filter(files_paths::sheet_type) ){
1166  // int result = 0;
1167  // sheet_filter::SheetFilter sf(position_, secstruct_, total_residue_);
1168  // sf.compute_result(result); // Trigger evaluation if Ingo's sheet filter, including handedness checks.
1169  // sheet_score += sf.get_handedness_score();
1170  //}
1171 
1172  //std::cout << " SHEET-SCORE: " << sheet_score << std::endl;
1173  return sheet_score * 2.019; // pre-weighting from r++::structure.cc:733
1174 }
1175 
1176 
1177 
1178 
1179 
1180 /// @details identifies secondary structure at the start of scoring and loads the Strands/Helices
1181 /// data
1182 void
1184  pose::Pose const & pose,
1185  Helices & helices,
1186  Strands & strands
1187 ) const
1188 {
1189 
1190  conformation::Conformation const & conf( pose.conformation() ); // get secstruct info from this guy
1191  int const total_residue( pose.total_residue() );
1192 
1193  FArray1D_int dimer_type( total_residue ); // what type of dimer each position is
1194  // 0-none, 1-SS 2-HH
1195 
1196  //car find SSdimers and HHdimers
1197  //car find N-terminal ends of SS elements
1198  //car save a map of the dimers to aid finding C-termini later
1199  int lastH = 1;
1200  int lastE = 1;
1201  int lastL = 1;
1202  helices.total_HH_dimer = 0;
1203  strands.total_SS_dimer = 0;
1204  for ( int i = 1; i <= total_residue; ++i ) strands.SS_dimer(i) = 0; // initialize
1205 
1206  //std::cout << "secstruct: ";
1207  for ( int i = 1; i <= total_residue; ++i ) {
1208  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
1210  continue;
1211  }
1212  char const c = conf.secstruct(i);
1213  //std::cout << conf.secstruct(i);
1214  if ( c == 'L' ) {
1215  lastL = i;
1216  } else if ( c == 'E' ) {
1217  lastE = i;
1218  } else if ( c == 'H' ) {
1219  lastH = i;
1220  }
1221 
1222  dimer_type(i) = 0;
1223  if ( i <= total_residue-1 ) {
1224  if ( conf.secstruct(i) == 'E' && conf.secstruct(i+1) == 'E' ) {
1225  ++strands.total_SS_dimer;
1226  strands.SS_resnum(strands.total_SS_dimer) = i;
1227  strands.SS_dimer ( i ) = strands.total_SS_dimer; // reverse mapping -- add to ctor,operator=,etc
1228  strands.SS_strand_end(1, strands.total_SS_dimer) = std::max(lastH,lastL);
1229  dimer_type(i) = 1;
1230  }
1231  }
1232  if ( i >= 2 && i <= total_residue-2 ) {
1233  if ( conf.secstruct(i-1) == 'H' && conf.secstruct(i) == 'H' && conf.secstruct(i+1) == 'H' &&
1234  conf.secstruct(i+2) == 'H' ) {
1235  ++helices.total_HH_dimer;
1236  helices.HH_resnum(helices.total_HH_dimer) = i;
1237  //helices.HH_dimer ( i ) = helices.total_HH_dimer; // reverse mapping, is this needed?
1238  helices.HH_helix_end(1, helices.total_HH_dimer) = std::max(lastE,lastL);
1239  dimer_type(i) = 2;
1240  }
1241  }
1242  }
1243  //std::cout << std::endl;
1244 
1245  lastH = total_residue;
1246  lastE = total_residue;
1247  lastL = total_residue;
1248  int iHH = helices.total_HH_dimer;
1249  int iSS = strands.total_SS_dimer;
1250 
1251  for ( int i = total_residue; i >= 1; --i ) {
1252  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
1254  continue;
1255  }
1256  char const c = conf.secstruct(i);
1257  if ( c == 'L' ) {
1258  lastL = i;
1259  } else if ( c == 'E' ) {
1260  lastE = i;
1261  } else if ( c == 'H' ) {
1262  lastH = i;
1263  }
1264 
1265  if ( dimer_type(i) == 1 ) {
1266  strands.SS_strand_end(2, iSS) = std::min(lastH, lastL);
1267  --iSS;
1268  } else if ( dimer_type(i) == 2 ) {
1269  helices.HH_helix_end(2, iHH) = std::min(lastE, lastL);
1270  --iHH;
1271  }
1272  }
1273 
1274  //car assign strand numbers to ss_dimers
1275  if ( strands.total_SS_dimer > 0 ) {
1276  strands.SS_strand(1) = 1; // first ss-dimer belongs to strand 1
1277  strands.total_strands = 1;
1278 
1279  for ( int i = 2; i <= strands.total_SS_dimer; ++i ) {
1280  if ( strands.SS_strand_end(1,i) == strands.SS_strand_end(1,i-1) ) {
1281  strands.SS_strand(i) = strands.SS_strand(i-1); // same strand
1282  } else {
1283  ++strands.total_strands;
1284  strands.SS_strand(i) = strands.total_strands;
1285  }
1286  }
1287  } else {
1288  strands.total_strands = 0;
1289  }
1290  ///std::cout << " strands.total_strands " << strands.total_strands;// << std::endl;
1291 
1292 }
1293 
1294 
1295 /// @brief function reads in two points in sequence and returns two points in space,
1296 /// @brief the endpoints of the axis through an alpha-helix
1297 void
1299  int const & pos1,
1300  BB_Pos const & bb_pos,
1301  Vector & p1,
1302  Vector & p2
1303 ) const
1304 {
1305  int const s1 = pos1-1;
1306  int const s2 = pos1;
1307  int const s3 = pos1+1;
1308  int const s4 = pos1+2;
1309 
1310  static Real const eleven_inv = 1.0 / 11.0;
1311 
1312  Vector const Epos_sum( ( bb_pos.CA( s1 ) + bb_pos.C( s1 ) ) +
1313  ( bb_pos.N( s2 ) + bb_pos.CA( s2 ) + bb_pos.C( s2 ) ) +
1314  ( bb_pos.N( s3 ) + bb_pos.CA( s3 ) + bb_pos.C( s3 ) ) +
1315  ( bb_pos.N( s4 ) + bb_pos.CA( s4 ) ) );
1316 
1317  p1 = ( Epos_sum + bb_pos.N( s1 ) ) * eleven_inv;
1318  p2 = ( Epos_sum + bb_pos.C( s4 ) ) * eleven_inv;
1319 
1320 // for ( int i = 1; i <= 3; ++i ) {
1321 // Real const Epos_sum =
1322 // Eposition(i,2,s1) + Eposition(i,4,s1) +
1323 // Eposition(i,1,s2) + Eposition(i,2,s2) + Eposition(i,4,s2) +
1324 // Eposition(i,1,s3) + Eposition(i,2,s3) + Eposition(i,4,s3) +
1325 // Eposition(i,1,s4) + Eposition(i,2,s4);
1326 // p1(i) = ( Epos_sum + Eposition(i,1,s1) ) * eleven_inv;
1327 // p2(i) = ( Epos_sum + Eposition(i,4,s4) ) * eleven_inv;
1328 // }
1329 }
1330 
1331 
1332 /// @brief calculate sum of dot product of the co vectors of strand dimers ss1 and ss2
1333 /// @brief with the vector connecting the midpoints of the dimer vectors (vdist)
1334 /// @brief also determine return the sign of the dot products for each dimer
1335 /// @brief to determine which direction the CO groups point
1336 void
1338  int const & ss1,
1339  int const & ss2,
1340  BB_Pos const & bb_pos,
1341  Real & dp,
1342  Vector const & vdist,
1343  int & sign1,
1344  int & sign2
1345 ) const
1346 {
1347 
1348 //car parameters
1349 // static Real const dist_co = { 1.231015f }; // length of C=O bond
1350  static Real const dist_co_inv = { 1.0f / 1.231015f };
1351 
1352 //car local
1353  Vector temp;
1354 
1355  dp = 0.0;
1356  Real dp1 = 0.0;
1357  Real dp2 = 0.0;
1358  Real sdp1 = 0.0;
1359  Real sdp2 = 0.0;
1360 
1361  for ( int i = ss1; i <= ss1+1; ++i ) {
1362  if ( i == ss1+1 ) {
1363  temp = dist_co_inv * ( bb_pos.C(i) - bb_pos.O(i) );
1364  // for ( int j = 1, l = l0; j <= 3; ++j, ++l ) {
1365  // temp(j) = -( Eposition[ l+3 ] - Eposition[ l ] ) * dist_co_inv; // 5=O, 4=C
1366  // // temp(j) = -( Eposition[ l+3 ] - Eposition[ l ] ) * dist_co_inv; // 5=O, 4=C
1367  // // -( Eposition(j,5,i) - Eposition(j,4,i) )
1368  // }
1369  } else {
1370  temp = dist_co_inv * ( bb_pos.O(i) - bb_pos.C(i) );
1371  // for ( int j = 1, l = l0; j <= 3; ++j, ++l ) {
1372  // temp(j) = ( Eposition[ l+3 ] - Eposition[ l ] ) * dist_co_inv; // 5=O, 4=C
1373  // // ( Eposition(j,5,i) - Eposition(j,4,i) )
1374  // }
1375  }
1376  //if ( vdist(1) != 10.0 ) { // why is this checked? (car)
1377  Real const tempdot = temp.dot( vdist );
1378  dp1 += std::abs(tempdot);
1379  sdp1 += tempdot;
1380  //}
1381  }
1382  dp1 *= 0.5;
1383 
1384  for ( int i = ss2; i <= ss2+1; ++i ) {
1385  if ( i == ss2+1 ) {
1386  temp = dist_co_inv * ( bb_pos.C(i) - bb_pos.O(i) );
1387  // for ( int j = 1, l = l0; j <= 3; ++j, ++l ) {
1388  // temp(j) = -( Eposition[ l+3 ] - Eposition[ l ] ) * dist_co_inv; // 5=O, 4=C
1389  // // -( Eposition(j,5,i) - Eposition(j,4,i) )
1390  // }
1391  } else {
1392  temp = dist_co_inv * ( bb_pos.O(i) - bb_pos.C(i) );
1393  // for ( int j = 1, l = l0; j <= 3; ++j, ++l ) {
1394  // temp(j) = ( Eposition[ l+3 ] - Eposition[ l ] ) * dist_co_inv; // 5=O, 4=C
1395  // // ( Eposition(j,5,i) - Eposition(j,4,i) )
1396  // }
1397  }
1398  //if ( vdist(1) != 10.0 ) {
1399  Real const tempdot = temp.dot( vdist );
1400  dp2 += std::abs(tempdot);
1401  sdp2 += tempdot;
1402  //}
1403  }
1404  dp2 *= 0.5;
1405 
1406  // if ( vdist(1) == 10.0 ) {
1407  // dp = 10.0;
1408  // } else {
1409  dp = dp1 + dp2;
1410 //js These signs tell whether the first c=o bond vector of a dimer points
1411 //js at the other dimer. sign1 = 1 means that the first c=o bond of dimer1
1412 //js points at dimer2. sign2 = 1 means that dimer2 points at dimer1. When
1413 //js sign1 or sign2 equals 2, that dimer points away from the other dimer.
1414  sign1 = ( sdp1 > 0.0 ? 2 : 1 );
1415  sign2 = ( sdp2 < 0.0 ? 2 : 1 );
1416 }
1417 
1418 
1419 /// @brief identifies the sequence separation along the fold tree
1420 /// lin the old way to calculate the sequence separation takes an asumption of no-break chain
1421 /// lin when there is chain break between pos1 and pos2, we add a gap to make a correct calculation in ss energy
1422 int
1424  pose::Pose const & pose,
1425  int pos1,
1426  int pos2,
1427  int gap_size
1428 ) const
1429 {
1430  if( pose.fold_tree().is_simple_tree() ) return std::abs( pos1 - pos2 );
1431 
1432  int begin ( std::min(pos1,pos2) );
1433  int end ( std::max(pos1,pos2) );
1434 
1435  bool is_break ( false );
1436 
1437  for ( int i = begin; i < end; ++i ) {
1438  //if( pose.fold_tree().is_cutpoint(i) ) { is_break=true; break; }
1439  if( pose.residue_type(i).is_terminus() ) { is_break=true; break; }
1440  }
1441 
1442  if( is_break ) {
1443  return end-begin+gap_size;
1444  } else {
1445  return end-begin;
1446  }
1447 
1448 }
1449 
1450 
1451 /// @brief find the vector connecting the midpoints of two line segments
1452 /// @brief defined by a1,a2 and a3,a4
1453 /// @param[out] dist length of v21
1454 /// @param[out] v21 vector connecting midpoints
1455 void
1457  Vector const & a1,
1458  Vector const & a2,
1459  Vector const & a3,
1460  Vector const & a4,
1461  Real & dist, // length of v21
1462  Vector & cen1,
1463  Vector & cen2,
1464  Vector & v21 // vector connecting midpoints
1465 )
1466 {
1467  //car find midpoint coordinates
1468  cen1 = Real( 0.5 )*( a1 + a2 );
1469  cen2 = Real( 0.5 )*( a3 + a4 );
1470 
1471  //car find distance between midpoint coordinates
1472  v21 = cen2 - cen1;
1473  dist = v21.length();
1474  // cen1(1) = ( a1(1) + a2(1) )*0.5f;
1475  // cen1(2) = ( a1(2) + a2(2) )*0.5f;
1476  // cen1(3) = ( a1(3) + a2(3) )*0.5f;
1477 
1478  // cen2(1) = ( a3(1) + a4(1) )*0.5f;
1479  // cen2(2) = ( a3(2) + a4(2) )*0.5f;
1480  // cen2(3) = ( a3(3) + a4(3) )*0.5f;
1481 
1482 // v21(1) = cen2(1) - cen1(1);
1483 // v21(2) = cen2(2) - cen1(2);
1484 // v21(3) = cen2(3) - cen1(3);
1485 // dist = std::sqrt(
1486 // v21(1) * v21(1) +
1487 // v21(2) * v21(2) +
1488 // v21(3) * v21(3) );
1489 }
1490 
1491 
1492 /// @details define a coordinate system with Z axis along cen1->a2 (v1),
1493 /// xz plane defined by cen1->a2 and v21. and origin at cen1.
1494 /// Find the spherical coordinates phi,and theta of point a4 if
1495 /// vector cen2->a4 was moved such that cen2=cen1
1496 ///
1497 /// @param[out] v21 vector connecting midpoints
1498 void
1500  Vector const & a2,
1501  Vector const & a4,
1502  Real & phi,
1503  Real & theta,
1504  Vector const & cen1,
1505  Vector const & cen2,
1506  Vector const & v21
1507 )
1508 {
1509  using numeric::conversions::degrees;
1510  using numeric::sin_cos_range;
1511 
1512  //car v1 vector from center to end of dimer1 vector
1513  //car v2 2
1514 
1515  Vector v1( a2 - cen1 );
1516  // v1(1) = a2(1) - cen1(1);
1517  // v1(2) = a2(2) - cen1(2);
1518  // v1(3) = a2(3) - cen1(3);
1519  Vector v2( a4 - cen2 );
1520  // v2(1) = a4(1) - cen2(1);
1521  // v2(2) = a4(2) - cen2(2);
1522  // v2(3) = a4(3) - cen2(3);
1523 
1524 //car find unit vector along v1 = uz
1525  Vector const uz( v1.normalized_or_zero() );
1526 
1527 //car find unit vector perpendicular v21 v1 plane
1528  Vector const uy( uz.cross( v21 ).normalized_or_zero() );
1529 
1530 //car third unit vector to define coordinate system
1531  Vector const ux( uy.cross( uz ).normalized_or_zero() );
1532 
1533 //car find projection of v2 onto each of these azes
1534  Real const v2x = v2.dot( ux ); //v2(1)*ux(1) + v2(2)*ux(2) + v2(3)*ux(3); // v2x=v2.ux
1535  Real const v2y = v2.dot( uy ); //v2(1)*uy(1) + v2(2)*uy(2) + v2(3)*uy(3); // v2y=v2.uy
1536  Real const v2z = v2.dot( uz ); //v2(1)*uz(1) + v2(2)*uz(2) + v2(3)*uz(3); // v2z=v2.uz
1537 
1538 //car and length of v2
1539  Real r1 = v2.length();
1540 
1541 //car unit vector along v21
1542  Vector const u21( v21.normalized_or_zero() );
1543 
1544 //car projection of u21 on uz
1545 // pb -- this doesnt seem to be used
1546  //Real const u21z = u21.dot( uz ); //u21(1)*uz(1) + u21(2)*uz(2) + u21(3)*uz(3); // u21z=u21.uz
1547 
1548 
1549 //car the same thing in function calls (is this expensive?)
1550 //$$$ unitvec(v1,uz);
1551 //$$$ cros(uz,v21,uy);
1552 //$$$ unitvec(uy,uy);
1553 //$$$ cros(uy,uz,ux);
1554 //$$$ unitvec(ux,ux);
1555 //$$$
1556 //$$$ v2x = dotprod(v2,ux);
1557 //$$$ v2y = dotprod(v2,uy);
1558 //$$$ v2z = dotprod(v2,uz);
1559 //$$$ r1 = std::sqrt( ( v2(1) * v2(1) )+( v2(2) * v2(2) )+( v2(3) * v2(3) ) );
1560 //$$$
1561 //$$$ unitvec(v21,u21);
1562 //$$$ u21z = dotprod(u21,uz);
1563 
1564 
1565  phi = 200.0; // why set to 200? if v2y = 0, v2 lies in xz plane and phi
1566  // is zero; if v2x=0, v2 lies in yz plane and phi is 90 or -90
1567  if ( v2y != 0.0 && v2x != 0.0 ) {
1568  phi = degrees( std::atan2( v2y, v2x ) );
1569  }
1570 
1571  Real const v2z_r1 = v2z / r1;
1572  if ( r1 != 0.0 && std::abs( v2z_r1 ) <= 1.0 ) {
1573  theta = degrees( numeric::arccos( v2z_r1 ) ); //std::acos( sin_cos_range( v2z_r1 ) ) );
1574  } else if ( v2z_r1 > 1.0 ) {
1575  theta = 0.0;
1576  } else {
1577  theta = 180.0;
1578  }
1579 }
1580 
1581 
1582 /// @brief find angle sigma between vectors cen1->a2 and v21
1583 /// @param[out] sig sigma
1584 void
1586  Vector const & a2,
1587  Vector const & cen1,
1588  Vector const & v21,
1589  Real & sig
1590 )
1591 {
1592  //car this could be done in spherical
1593 
1594  // subvec(a2,cen1,v1);
1595  // unitvec(v1,uz);
1596  // unitvec(v21,u21);
1597  Real const u21z = ( a2 - cen1 ).normalized().dot( v21.normalized() ); //dotprod(u21,uz);
1598 
1599  sig = numeric::conversions::degrees( numeric::arccos( u21z ) ); //std::acos( sin_cos_range( u21z ) );
1600 
1601  // sig = 200.0; // why 200? should be 0 or 180
1602  // if ( std::abs(u21z) <= 1.0 ) { //Objexx:SGM This logic is hackery that should be cleaned up
1603  // if ( std::abs(u21z) < 1.0 ) {
1604  // }
1605  // to_degrees( sig );
1606  // }
1607 }
1608 
1609 
1610 /// @brief load phi/theta bins for use in secondary structure scoring
1611 
1612 void
1614  std::string const & hs_filename,
1615  std::string const & ss_filename
1616 )
1617 {
1618  using ObjexxFCL::fmt::skip;
1619 
1620  // local
1621  int isep,iph,itheta,idot;
1622  Real totn,tot;
1623 
1624  typedef ObjexxFCL::FArray3D< Real > FArray3D_real;
1625  FArray3D_real pts_HS( 36, 36, 3 );
1626  FArray3D_real pts_SS( 36, 36, 3 );
1627  FArray1D_real pts_correct( 3 );
1628 //------------------------------------------------------------------------------
1629 
1630  for ( itheta = 1; itheta <= 36; ++itheta ) {
1631 // radians = pi/180.0;
1632 // angle1 = (itheta+17)*5*radians;
1633 // angle2 = (itheta+18)*5*radians;
1634 // std::cout << SS( angle1 ) << SS( angle2 ) << std::endl;
1635 // iptsn_(itheta) = 10000*std::abs(std::sin(angle1)-std::sin(angle2));
1636 // std::cout << SS( itheta ) << SS( iptsn_(itheta) ) << std::endl;
1637 // FOR PRESMOOTHED/BINNED COUNTS FROM INGO USE NO THETA NORM
1638  iptsn_(itheta) = 100;
1639  }
1640 
1641  // FIXME: need equivalent to open_data_file() function here
1642  //utility::io::izstream & HS_stream( open_data_file( hs_filename ) );
1643  utility::io::izstream HS_stream;
1644  basic::database::open( HS_stream, hs_filename );
1645  for ( isep = 1; isep <= 3; ++isep ) {
1646  for ( itheta = 1; itheta <= 36; ++itheta ) {
1647  for ( iph = 1; iph <= 36; ++iph ) {
1648  HS_stream >> pts_HS(itheta,iph,isep) >> skip;
1649  }
1650  }
1651  }
1652  HS_stream.close();
1653  HS_stream.clear();
1654 
1655  for ( isep = 1; isep <= 3; ++isep ) {
1656  tot = 0.0;
1657  totn = 0.0;
1658  for ( iph = 1; iph <= 36; ++iph ) {
1659  for ( itheta = 1; itheta <= 36; ++itheta ) {
1660  // SMALL COUNTS CORRECTION
1661  pts_HS(itheta,iph,isep) += iptsn_(itheta)*0.000001f;
1662  tot += pts_HS(itheta,iph,isep);
1663  totn += iptsn_(itheta);
1664  }
1665  }
1666  for ( iph = 1; iph <= 36; ++iph ) {
1667  for ( itheta = 1; itheta <= 36; ++itheta ) {
1668  pts_(1,isep,iph,itheta) = -std::log(pts_HS(itheta,iph,isep)/tot) +
1669  std::log(iptsn_(itheta)/totn);
1670  }
1671  }
1672  }
1673 
1674  // FIXME: need equivalent to open_data_file() function here
1675  utility::io::izstream SS_stream;
1676  basic::database::open( SS_stream, ss_filename );
1677  for ( isep = 1; isep <= 3; ++isep ) {
1678  for ( itheta = 1; itheta <= 36; ++itheta ) {
1679  for ( iph = 1; iph <= 36; ++iph ) {
1680  SS_stream >> pts_SS(itheta,iph,isep) >> skip;
1681  }
1682  }
1683  if ( isep == 1 ) SS_stream.seek_beg();
1684  }
1685  SS_stream.close();
1686  SS_stream.clear();
1687 
1688  for ( isep = 1; isep <= 3; ++isep ) {
1689  tot = 0.0;
1690  totn = 0.0;
1691  for ( iph = 1; iph <= 36; ++iph ) {
1692  for ( itheta = 1; itheta <= 36; ++itheta ) {
1693  // SMALL COUNTS CORRECTION
1694  pts_SS(itheta,iph,isep) += iptsn_(itheta)*0.000001f;
1695  tot += pts_SS(itheta,iph,isep);
1696  totn += iptsn_(itheta);
1697  }
1698  }
1699  for ( iph = 1; iph <= 36; ++iph ) {
1700  for ( itheta = 1; itheta <= 36; ++itheta ) {
1701  pts_(2,isep,iph,itheta) = -std::log(pts_SS(itheta,iph,isep)/tot) +
1702  std::log(iptsn_(itheta)/totn);
1703  }
1704  }
1705  }
1706 
1707  tot = 0.0;
1708  totn = 0.0;
1709  for ( idot = 1; idot <= 6; ++idot ) {
1710  tot += ids_(idot);
1711  totn += idsn_(idot);
1712  }
1713  for ( idot = 1; idot <= 6; ++idot ) {
1714  if ( ids_(idot) != 0 ) {
1715  ds_(idot) = -std::log(ids_(idot)/tot) + std::log(idsn_(idot)/totn);
1716  } else {
1717  ds_(idot) = 0.0;
1718  }
1719  }
1720 
1721  for ( isep = 1; isep <= 3; ++isep ) {
1722  pts_correct(isep) = 0.0;
1723  for ( iph = 1; iph <= 36; ++iph ) {
1724  for ( itheta = 1; itheta <= 36; ++itheta ) {
1725  if ( pts_(2,isep,iph,itheta) > pts_correct(isep) )
1726  pts_correct(isep) = pts_(2,isep,iph,itheta);
1727  }
1728  }
1729  }
1730 }
1731 
1732 
1733 void
1735  FArray1D_int & idsn
1736 )
1737 {
1738  // triangle-2 random numbers
1739  // data idsn/56,167,278,278,167,56/
1740  // sort of triangle-4 random numbers
1741  int i = 0;
1742  idsn( ++i ) = 5596;
1743  idsn( ++i ) = 16581;
1744  idsn( ++i ) = 27823;
1745  idsn( ++i ) = 27823;
1746  idsn( ++i ) = 16581;
1747  idsn( ++i ) = 5596;
1748 }
1749 
1750 
1751 void
1753  FArray1D_int & ids
1754 )
1755 {
1756  int i = 0;
1757  ids( ++i ) = 1;
1758  ids( ++i ) = 48;
1759  ids( ++i ) = 368;
1760  ids( ++i ) = 2378;
1761  ids( ++i ) = 7141;
1762  ids( ++i ) = 8904;
1763 }
1764 
1765 
1766 void
1768  FArray2D_real & ssdist
1769 )
1770 {
1771  // DATA 0-12A, GOES BACK TO PROTEINS 1999 PAPER
1772  // data ssdist/2.652527,0.7284873,0.0176830,-0.2566608,
1773  // # -1.471609,0.0104174,0.0679096, 0.4667910/
1774 
1775  // DATA 0-12A+, CREATED JANUARY 30, 1999
1776  FArray1A_real ssdist1d( ssdist, ssdist.size() ); // 1D view
1777  int i = 0;
1778  ssdist1d( ++i ) = 2.3962;
1779  ssdist1d( ++i ) = 0.56921;
1780  ssdist1d( ++i ) = -0.20262;
1781  ssdist1d( ++i ) = -0.55172;
1782  ssdist1d( ++i ) = -1.6408;
1783  ssdist1d( ++i ) = -0.63196;
1784  ssdist1d( ++i ) = -0.57115;
1785  ssdist1d( ++i ) = -0.26221;
1786 }
1787 
1788 
1789 void
1791  FArray1D_real & hs_dp
1792 )
1793 {
1794  int i = 0;
1795  hs_dp( ++i ) = 0.416;
1796  hs_dp( ++i ) = -0.412;
1797  hs_dp( ++i ) = -0.542;
1798  hs_dp( ++i ) = -0.489;
1799  hs_dp( ++i ) = -0.351;
1800  hs_dp( ++i ) = -0.104;
1801  hs_dp( ++i ) = 0.211;
1802  hs_dp( ++i ) = 0.494;
1803  hs_dp( ++i ) = 0.942;
1804  hs_dp( ++i ) = 1.897;
1805 }
1806 
1807 
1808 void
1810  FArray4D_real & rsigma_dot
1811 )
1812 {
1813  // section 12
1814  //js --------------------------
1815  //js new rsigma stats that take into account whether the first
1816  //js c=o bond vector points towards away from the other dimer
1817  rsigma_dot( 1, 1, 1, 2 ) = -1.038100;
1818  rsigma_dot( 1, 2, 1, 2 ) = -1.038100;
1819  rsigma_dot( 1, 3, 1, 2 ) = -1.038100;
1820  rsigma_dot( 1, 4, 1, 2 ) = -1.038100;
1821  rsigma_dot( 1, 5, 1, 2 ) = -1.038100;
1822  rsigma_dot( 1, 6, 1, 2 ) = -1.038100;
1823  rsigma_dot( 1, 7, 1, 2 ) = -1.038100;
1824  rsigma_dot( 1, 8, 1, 2 ) = -2.984000;
1825  rsigma_dot( 1, 9, 1, 2 ) = -3.746110;
1826  rsigma_dot( 1, 10, 1, 2 ) = -3.746110;
1827  rsigma_dot( 1, 11, 1, 2 ) = -2.647500;
1828  rsigma_dot( 1, 12, 1, 2 ) = -1.038100;
1829  rsigma_dot( 1, 13, 1, 2 ) = -1.038100;
1830  rsigma_dot( 1, 14, 1, 2 ) = -1.038100;
1831  rsigma_dot( 1, 15, 1, 2 ) = -1.038100;
1832  rsigma_dot( 1, 16, 1, 2 ) = -1.038100;
1833  rsigma_dot( 1, 17, 1, 2 ) = -1.038100;
1834  rsigma_dot( 1, 18, 1, 2 ) = -1.038100;
1835  rsigma_dot( 2, 1, 1, 2 ) = -0.973500;
1836  rsigma_dot( 2, 2, 1, 2 ) = -0.973500;
1837  rsigma_dot( 2, 3, 1, 2 ) = -0.973500;
1838  rsigma_dot( 2, 4, 1, 2 ) = -0.973500;
1839  rsigma_dot( 2, 5, 1, 2 ) = -0.973500;
1840  rsigma_dot( 2, 6, 1, 2 ) = -0.973500;
1841  rsigma_dot( 2, 7, 1, 2 ) = -2.072100;
1842  rsigma_dot( 2, 8, 1, 2 ) = -0.973500;
1843  rsigma_dot( 2, 9, 1, 2 ) = -4.943820;
1844  rsigma_dot( 2, 10, 1, 2 ) = -5.178220;
1845  rsigma_dot( 2, 11, 1, 2 ) = -4.823670;
1846  rsigma_dot( 2, 12, 1, 2 ) = -2.919400;
1847  rsigma_dot( 2, 13, 1, 2 ) = -2.583000;
1848  rsigma_dot( 2, 14, 1, 2 ) = -0.973500;
1849  rsigma_dot( 2, 15, 1, 2 ) = -0.973500;
1850  rsigma_dot( 2, 16, 1, 2 ) = -0.973500;
1851  rsigma_dot( 2, 17, 1, 2 ) = -0.973500;
1852  rsigma_dot( 2, 18, 1, 2 ) = -0.973500;
1853  rsigma_dot( 3, 1, 1, 2 ) = -0.912900;
1854  rsigma_dot( 3, 2, 1, 2 ) = -0.912900;
1855  rsigma_dot( 3, 3, 1, 2 ) = -0.912900;
1856  rsigma_dot( 3, 4, 1, 2 ) = -0.912900;
1857  rsigma_dot( 3, 5, 1, 2 ) = -0.912900;
1858  rsigma_dot( 3, 6, 1, 2 ) = -0.912900;
1859  rsigma_dot( 3, 7, 1, 2 ) = -2.011500;
1860  rsigma_dot( 3, 8, 1, 2 ) = -4.048400;
1861  rsigma_dot( 3, 9, 1, 2 ) = -5.981810;
1862  rsigma_dot( 3, 10, 1, 2 ) = -7.006470;
1863  rsigma_dot( 3, 11, 1, 2 ) = -6.696730;
1864  rsigma_dot( 3, 12, 1, 2 ) = -4.131780;
1865  rsigma_dot( 3, 13, 1, 2 ) = -0.912900;
1866  rsigma_dot( 3, 14, 1, 2 ) = -0.912900;
1867  rsigma_dot( 3, 15, 1, 2 ) = -0.912900;
1868  rsigma_dot( 3, 16, 1, 2 ) = -0.912900;
1869  rsigma_dot( 3, 17, 1, 2 ) = -0.912900;
1870  rsigma_dot( 3, 18, 1, 2 ) = -0.912900;
1871  rsigma_dot( 4, 1, 1, 2 ) = -0.855700;
1872  rsigma_dot( 4, 2, 1, 2 ) = -0.855700;
1873  rsigma_dot( 4, 3, 1, 2 ) = -0.855700;
1874  rsigma_dot( 4, 4, 1, 2 ) = -0.855700;
1875  rsigma_dot( 4, 5, 1, 2 ) = -0.855700;
1876  rsigma_dot( 4, 6, 1, 2 ) = -2.465200;
1877  rsigma_dot( 4, 7, 1, 2 ) = -3.420700;
1878  rsigma_dot( 4, 8, 1, 2 ) = -3.900270;
1879  rsigma_dot( 4, 9, 1, 2 ) = -6.315330;
1880  rsigma_dot( 4, 10, 1, 2 ) = -8.116270;
1881  rsigma_dot( 4, 11, 1, 2 ) = -8.329380;
1882  rsigma_dot( 4, 12, 1, 2 ) = -5.298390;
1883  rsigma_dot( 4, 13, 1, 2 ) = -1.954400;
1884  rsigma_dot( 4, 14, 1, 2 ) = -0.855700;
1885  rsigma_dot( 4, 15, 1, 2 ) = -0.855700;
1886  rsigma_dot( 4, 16, 1, 2 ) = -0.855700;
1887  rsigma_dot( 4, 17, 1, 2 ) = -0.855700;
1888  rsigma_dot( 4, 18, 1, 2 ) = -0.855700;
1889  rsigma_dot( 5, 1, 1, 2 ) = -0.801700;
1890  rsigma_dot( 5, 2, 1, 2 ) = -0.801700;
1891  rsigma_dot( 5, 3, 1, 2 ) = -0.801700;
1892  rsigma_dot( 5, 4, 1, 2 ) = -0.801700;
1893  rsigma_dot( 5, 5, 1, 2 ) = -0.801700;
1894  rsigma_dot( 5, 6, 1, 2 ) = -1.900300;
1895  rsigma_dot( 5, 7, 1, 2 ) = -3.634900;
1896  rsigma_dot( 5, 8, 1, 2 ) = -5.119160;
1897  rsigma_dot( 5, 9, 1, 2 ) = -6.381410;
1898  rsigma_dot( 5, 10, 1, 2 ) = -9.110860;
1899  rsigma_dot( 5, 11, 1, 2 ) = -9.615860;
1900  rsigma_dot( 5, 12, 1, 2 ) = -6.566870;
1901  rsigma_dot( 5, 13, 1, 2 ) = -2.411100;
1902  rsigma_dot( 5, 14, 1, 2 ) = -1.900300;
1903  rsigma_dot( 5, 15, 1, 2 ) = -0.801700;
1904  rsigma_dot( 5, 16, 1, 2 ) = -0.801700;
1905  rsigma_dot( 5, 17, 1, 2 ) = -0.801700;
1906  rsigma_dot( 5, 18, 1, 2 ) = -0.801700;
1907  rsigma_dot( 6, 1, 1, 2 ) = -0.750400;
1908  rsigma_dot( 6, 2, 1, 2 ) = -0.750400;
1909  rsigma_dot( 6, 3, 1, 2 ) = -0.750400;
1910  rsigma_dot( 6, 4, 1, 2 ) = -0.750400;
1911  rsigma_dot( 6, 5, 1, 2 ) = -0.750400;
1912  rsigma_dot( 6, 6, 1, 2 ) = -2.359800;
1913  rsigma_dot( 6, 7, 1, 2 ) = -4.511580;
1914  rsigma_dot( 6, 8, 1, 2 ) = -5.325090;
1915  rsigma_dot( 6, 9, 1, 2 ) = -6.768980;
1916  rsigma_dot( 6, 10, 1, 2 ) = -8.613260;
1917  rsigma_dot( 6, 11, 1, 2 ) = -9.405770;
1918  rsigma_dot( 6, 12, 1, 2 ) = -7.032650;
1919  rsigma_dot( 6, 13, 1, 2 ) = -3.885880;
1920  rsigma_dot( 6, 14, 1, 2 ) = -3.315300;
1921  rsigma_dot( 6, 15, 1, 2 ) = -0.750400;
1922  rsigma_dot( 6, 16, 1, 2 ) = -0.750400;
1923  rsigma_dot( 6, 17, 1, 2 ) = -0.750400;
1924  rsigma_dot( 6, 18, 1, 2 ) = -0.750400;
1925  rsigma_dot( 7, 1, 1, 2 ) = -0.701600;
1926  rsigma_dot( 7, 2, 1, 2 ) = -0.701600;
1927  rsigma_dot( 7, 3, 1, 2 ) = -0.701600;
1928  rsigma_dot( 7, 4, 1, 2 ) = -0.701600;
1929  rsigma_dot( 7, 5, 1, 2 ) = -0.701600;
1930  rsigma_dot( 7, 6, 1, 2 ) = -2.311000;
1931  rsigma_dot( 7, 7, 1, 2 ) = -4.365150;
1932  rsigma_dot( 7, 8, 1, 2 ) = -5.446520;
1933  rsigma_dot( 7, 9, 1, 2 ) = -6.795160;
1934  rsigma_dot( 7, 10, 1, 2 ) = -7.145720;
1935  rsigma_dot( 7, 11, 1, 2 ) = -7.527050;
1936  rsigma_dot( 7, 12, 1, 2 ) = -6.885740;
1937  rsigma_dot( 7, 13, 1, 2 ) = -4.508250;
1938  rsigma_dot( 7, 14, 1, 2 ) = -1.800200;
1939  rsigma_dot( 7, 15, 1, 2 ) = -2.647500;
1940  rsigma_dot( 7, 16, 1, 2 ) = -0.701600;
1941  rsigma_dot( 7, 17, 1, 2 ) = -0.701600;
1942  rsigma_dot( 7, 18, 1, 2 ) = -0.701600;
1943  rsigma_dot( 8, 1, 1, 2 ) = -0.655100;
1944  rsigma_dot( 8, 2, 1, 2 ) = -0.655100;
1945  rsigma_dot( 8, 3, 1, 2 ) = -0.655100;
1946  rsigma_dot( 8, 4, 1, 2 ) = -0.655100;
1947  rsigma_dot( 8, 5, 1, 2 ) = -0.655100;
1948  rsigma_dot( 8, 6, 1, 2 ) = -3.699600;
1949  rsigma_dot( 8, 7, 1, 2 ) = -4.089060;
1950  rsigma_dot( 8, 8, 1, 2 ) = -5.417250;
1951  rsigma_dot( 8, 9, 1, 2 ) = -6.293430;
1952  rsigma_dot( 8, 10, 1, 2 ) = -6.663890;
1953  rsigma_dot( 8, 11, 1, 2 ) = -6.788470;
1954  rsigma_dot( 8, 12, 1, 2 ) = -6.368800;
1955  rsigma_dot( 8, 13, 1, 2 ) = -4.732610;
1956  rsigma_dot( 8, 14, 1, 2 ) = -1.753700;
1957  rsigma_dot( 8, 15, 1, 2 ) = -0.655100;
1958  rsigma_dot( 8, 16, 1, 2 ) = -0.655100;
1959  rsigma_dot( 8, 17, 1, 2 ) = -0.655100;
1960  rsigma_dot( 8, 18, 1, 2 ) = -0.655100;
1961  rsigma_dot( 9, 1, 1, 2 ) = -0.610600;
1962  rsigma_dot( 9, 2, 1, 2 ) = -0.610600;
1963  rsigma_dot( 9, 3, 1, 2 ) = -0.610600;
1964  rsigma_dot( 9, 4, 1, 2 ) = -0.610600;
1965  rsigma_dot( 9, 5, 1, 2 ) = -1.709200;
1966  rsigma_dot( 9, 6, 1, 2 ) = -3.906460;
1967  rsigma_dot( 9, 7, 1, 2 ) = -3.906460;
1968  rsigma_dot( 9, 8, 1, 2 ) = -5.355550;
1969  rsigma_dot( 9, 9, 1, 2 ) = -6.070210;
1970  rsigma_dot( 9, 10, 1, 2 ) = -5.971910;
1971  rsigma_dot( 9, 11, 1, 2 ) = -6.070210;
1972  rsigma_dot( 9, 12, 1, 2 ) = -5.852370;
1973  rsigma_dot( 9, 13, 1, 2 ) = -4.901080;
1974  rsigma_dot( 9, 14, 1, 2 ) = -2.807800;
1975  rsigma_dot( 9, 15, 1, 2 ) = -2.220100;
1976  rsigma_dot( 9, 16, 1, 2 ) = -0.610600;
1977  rsigma_dot( 9, 17, 1, 2 ) = -1.709200;
1978  rsigma_dot( 9, 18, 1, 2 ) = -0.610600;
1979  rsigma_dot( 10, 1, 1, 2 ) = -0.568100;
1980  rsigma_dot( 10, 2, 1, 2 ) = -0.568100;
1981  rsigma_dot( 10, 3, 1, 2 ) = -0.568100;
1982  rsigma_dot( 10, 4, 1, 2 ) = -2.177500;
1983  rsigma_dot( 10, 5, 1, 2 ) = -2.765300;
1984  rsigma_dot( 10, 6, 1, 2 ) = -4.002050;
1985  rsigma_dot( 10, 7, 1, 2 ) = -4.802170;
1986  rsigma_dot( 10, 8, 1, 2 ) = -5.598500;
1987  rsigma_dot( 10, 9, 1, 2 ) = -5.809810;
1988  rsigma_dot( 10, 10, 1, 2 ) = -5.809810;
1989  rsigma_dot( 10, 11, 1, 2 ) = -5.732850;
1990  rsigma_dot( 10, 12, 1, 2 ) = -5.572010;
1991  rsigma_dot( 10, 13, 1, 2 ) = -4.858520;
1992  rsigma_dot( 10, 14, 1, 2 ) = -3.935360;
1993  rsigma_dot( 10, 15, 1, 2 ) = -1.666700;
1994  rsigma_dot( 10, 16, 1, 2 ) = -1.666700;
1995  rsigma_dot( 10, 17, 1, 2 ) = -0.568100;
1996  rsigma_dot( 10, 18, 1, 2 ) = -1.666700;
1997  rsigma_dot( 11, 1, 1, 2 ) = -0.527200;
1998  rsigma_dot( 11, 2, 1, 2 ) = -0.527200;
1999  rsigma_dot( 11, 3, 1, 2 ) = -0.527200;
2000  rsigma_dot( 11, 4, 1, 2 ) = -1.625900;
2001  rsigma_dot( 11, 5, 1, 2 ) = -3.746110;
2002  rsigma_dot( 11, 6, 1, 2 ) = -4.190800;
2003  rsigma_dot( 11, 7, 1, 2 ) = -4.761350;
2004  rsigma_dot( 11, 8, 1, 2 ) = -5.897880;
2005  rsigma_dot( 11, 9, 1, 2 ) = -5.850250;
2006  rsigma_dot( 11, 10, 1, 2 ) = -5.789930;
2007  rsigma_dot( 11, 11, 1, 2 ) = -5.371430;
2008  rsigma_dot( 11, 12, 1, 2 ) = -5.608640;
2009  rsigma_dot( 11, 13, 1, 2 ) = -5.306360;
2010  rsigma_dot( 11, 14, 1, 2 ) = -4.288440;
2011  rsigma_dot( 11, 15, 1, 2 ) = -3.092200;
2012  rsigma_dot( 11, 16, 1, 2 ) = -0.527200;
2013  rsigma_dot( 11, 17, 1, 2 ) = -0.527200;
2014  rsigma_dot( 11, 18, 1, 2 ) = -0.527200;
2015  rsigma_dot( 12, 1, 1, 2 ) = -0.488000;
2016  rsigma_dot( 12, 2, 1, 2 ) = -0.488000;
2017  rsigma_dot( 12, 3, 1, 2 ) = -0.488000;
2018  rsigma_dot( 12, 4, 1, 2 ) = -3.623500;
2019  rsigma_dot( 12, 5, 1, 2 ) = -4.722120;
2020  rsigma_dot( 12, 6, 1, 2 ) = -4.692710;
2021  rsigma_dot( 12, 7, 1, 2 ) = -5.197550;
2022  rsigma_dot( 12, 8, 1, 2 ) = -5.544260;
2023  rsigma_dot( 12, 9, 1, 2 ) = -5.740290;
2024  rsigma_dot( 12, 10, 1, 2 ) = -5.478450;
2025  rsigma_dot( 12, 11, 1, 2 ) = -5.347830;
2026  rsigma_dot( 12, 12, 1, 2 ) = -5.363220;
2027  rsigma_dot( 12, 13, 1, 2 ) = -5.103140;
2028  rsigma_dot( 12, 14, 1, 2 ) = -4.722120;
2029  rsigma_dot( 12, 15, 1, 2 ) = -3.984530;
2030  rsigma_dot( 12, 16, 1, 2 ) = -3.196100;
2031  rsigma_dot( 12, 17, 1, 2 ) = -0.488000;
2032  rsigma_dot( 12, 18, 1, 2 ) = -0.488000;
2033 
2034  // section 11
2035  rsigma_dot( 1, 1, 1, 1 ) = -0.552300;
2036  rsigma_dot( 1, 2, 1, 1 ) = -0.552300;
2037  rsigma_dot( 1, 3, 1, 1 ) = -0.552300;
2038  rsigma_dot( 1, 4, 1, 1 ) = -0.552300;
2039  rsigma_dot( 1, 5, 1, 1 ) = -0.552300;
2040  rsigma_dot( 1, 6, 1, 1 ) = -0.552300;
2041  rsigma_dot( 1, 7, 1, 1 ) = -0.552300;
2042  rsigma_dot( 1, 8, 1, 1 ) = -0.552300;
2043  rsigma_dot( 1, 9, 1, 1 ) = -0.552300;
2044  rsigma_dot( 1, 10, 1, 1 ) = -1.651000;
2045  rsigma_dot( 1, 11, 1, 1 ) = -0.552300;
2046  rsigma_dot( 1, 12, 1, 1 ) = -0.552300;
2047  rsigma_dot( 1, 13, 1, 1 ) = -0.552300;
2048  rsigma_dot( 1, 14, 1, 1 ) = -0.552300;
2049  rsigma_dot( 1, 15, 1, 1 ) = -0.552300;
2050  rsigma_dot( 1, 16, 1, 1 ) = -0.552300;
2051  rsigma_dot( 1, 17, 1, 1 ) = -0.552300;
2052  rsigma_dot( 1, 18, 1, 1 ) = -0.552300;
2053  rsigma_dot( 2, 1, 1, 1 ) = -0.487800;
2054  rsigma_dot( 2, 2, 1, 1 ) = -0.487800;
2055  rsigma_dot( 2, 3, 1, 1 ) = -0.487800;
2056  rsigma_dot( 2, 4, 1, 1 ) = -0.487800;
2057  rsigma_dot( 2, 5, 1, 1 ) = -0.487800;
2058  rsigma_dot( 2, 6, 1, 1 ) = -0.487800;
2059  rsigma_dot( 2, 7, 1, 1 ) = -0.487800;
2060  rsigma_dot( 2, 8, 1, 1 ) = -0.487800;
2061  rsigma_dot( 2, 9, 1, 1 ) = -0.487800;
2062  rsigma_dot( 2, 10, 1, 1 ) = -1.586400;
2063  rsigma_dot( 2, 11, 1, 1 ) = -2.097200;
2064  rsigma_dot( 2, 12, 1, 1 ) = -1.586400;
2065  rsigma_dot( 2, 13, 1, 1 ) = -0.487800;
2066  rsigma_dot( 2, 14, 1, 1 ) = -0.487800;
2067  rsigma_dot( 2, 15, 1, 1 ) = -0.487800;
2068  rsigma_dot( 2, 16, 1, 1 ) = -0.487800;
2069  rsigma_dot( 2, 17, 1, 1 ) = -0.487800;
2070  rsigma_dot( 2, 18, 1, 1 ) = -0.487800;
2071  rsigma_dot( 3, 1, 1, 1 ) = -0.427200;
2072  rsigma_dot( 3, 2, 1, 1 ) = -0.427200;
2073  rsigma_dot( 3, 3, 1, 1 ) = -0.427200;
2074  rsigma_dot( 3, 4, 1, 1 ) = -0.427200;
2075  rsigma_dot( 3, 5, 1, 1 ) = -0.427200;
2076  rsigma_dot( 3, 6, 1, 1 ) = -1.525800;
2077  rsigma_dot( 3, 7, 1, 1 ) = -2.036600;
2078  rsigma_dot( 3, 8, 1, 1 ) = -2.036600;
2079  rsigma_dot( 3, 9, 1, 1 ) = -0.427200;
2080  rsigma_dot( 3, 10, 1, 1 ) = -2.373100;
2081  rsigma_dot( 3, 11, 1, 1 ) = -1.525800;
2082  rsigma_dot( 3, 12, 1, 1 ) = -2.992100;
2083  rsigma_dot( 3, 13, 1, 1 ) = -2.373100;
2084  rsigma_dot( 3, 14, 1, 1 ) = -0.427200;
2085  rsigma_dot( 3, 15, 1, 1 ) = -0.427200;
2086  rsigma_dot( 3, 16, 1, 1 ) = -0.427200;
2087  rsigma_dot( 3, 17, 1, 1 ) = -0.427200;
2088  rsigma_dot( 3, 18, 1, 1 ) = -0.427200;
2089  rsigma_dot( 4, 1, 1, 1 ) = -0.370000;
2090  rsigma_dot( 4, 2, 1, 1 ) = -0.370000;
2091  rsigma_dot( 4, 3, 1, 1 ) = -0.370000;
2092  rsigma_dot( 4, 4, 1, 1 ) = -0.370000;
2093  rsigma_dot( 4, 5, 1, 1 ) = -0.370000;
2094  rsigma_dot( 4, 6, 1, 1 ) = -0.370000;
2095  rsigma_dot( 4, 7, 1, 1 ) = -2.315900;
2096  rsigma_dot( 4, 8, 1, 1 ) = -2.567200;
2097  rsigma_dot( 4, 9, 1, 1 ) = -2.767900;
2098  rsigma_dot( 4, 10, 1, 1 ) = -3.588900;
2099  rsigma_dot( 4, 11, 1, 1 ) = -3.414500;
2100  rsigma_dot( 4, 12, 1, 1 ) = -4.033580;
2101  rsigma_dot( 4, 13, 1, 1 ) = -3.804010;
2102  rsigma_dot( 4, 14, 1, 1 ) = -0.370000;
2103  rsigma_dot( 4, 15, 1, 1 ) = -0.370000;
2104  rsigma_dot( 4, 16, 1, 1 ) = -0.370000;
2105  rsigma_dot( 4, 17, 1, 1 ) = -0.370000;
2106  rsigma_dot( 4, 18, 1, 1 ) = -0.370000;
2107  rsigma_dot( 5, 1, 1, 1 ) = -0.316000;
2108  rsigma_dot( 5, 2, 1, 1 ) = -0.316000;
2109  rsigma_dot( 5, 3, 1, 1 ) = -0.316000;
2110  rsigma_dot( 5, 4, 1, 1 ) = -0.316000;
2111  rsigma_dot( 5, 5, 1, 1 ) = -0.316000;
2112  rsigma_dot( 5, 6, 1, 1 ) = -1.925400;
2113  rsigma_dot( 5, 7, 1, 1 ) = -3.683200;
2114  rsigma_dot( 5, 8, 1, 1 ) = -4.122610;
2115  rsigma_dot( 5, 9, 1, 1 ) = -3.812460;
2116  rsigma_dot( 5, 10, 1, 1 ) = -3.683200;
2117  rsigma_dot( 5, 11, 1, 1 ) = -3.360500;
2118  rsigma_dot( 5, 12, 1, 1 ) = -4.969910;
2119  rsigma_dot( 5, 13, 1, 1 ) = -4.869830;
2120  rsigma_dot( 5, 14, 1, 1 ) = -3.149200;
2121  rsigma_dot( 5, 15, 1, 1 ) = -0.316000;
2122  rsigma_dot( 5, 16, 1, 1 ) = -0.316000;
2123  rsigma_dot( 5, 17, 1, 1 ) = -0.316000;
2124  rsigma_dot( 5, 18, 1, 1 ) = -0.316000;
2125  rsigma_dot( 6, 1, 1, 1 ) = -0.264700;
2126  rsigma_dot( 6, 2, 1, 1 ) = -0.264700;
2127  rsigma_dot( 6, 3, 1, 1 ) = -0.264700;
2128  rsigma_dot( 6, 4, 1, 1 ) = -0.264700;
2129  rsigma_dot( 6, 5, 1, 1 ) = -0.264700;
2130  rsigma_dot( 6, 6, 1, 1 ) = -2.829600;
2131  rsigma_dot( 6, 7, 1, 1 ) = -5.680760;
2132  rsigma_dot( 6, 8, 1, 1 ) = -5.076840;
2133  rsigma_dot( 6, 9, 1, 1 ) = -4.271990;
2134  rsigma_dot( 6, 10, 1, 1 ) = -4.234950;
2135  rsigma_dot( 6, 11, 1, 1 ) = -3.761170;
2136  rsigma_dot( 6, 12, 1, 1 ) = -5.567960;
2137  rsigma_dot( 6, 13, 1, 1 ) = -6.108200;
2138  rsigma_dot( 6, 14, 1, 1 ) = -4.956010;
2139  rsigma_dot( 6, 15, 1, 1 ) = -1.874100;
2140  rsigma_dot( 6, 16, 1, 1 ) = -0.264700;
2141  rsigma_dot( 6, 17, 1, 1 ) = -0.264700;
2142  rsigma_dot( 6, 18, 1, 1 ) = -0.264700;
2143  rsigma_dot( 7, 1, 1, 1 ) = -0.215900;
2144  rsigma_dot( 7, 2, 1, 1 ) = -0.215900;
2145  rsigma_dot( 7, 3, 1, 1 ) = -0.215900;
2146  rsigma_dot( 7, 4, 1, 1 ) = -0.215900;
2147  rsigma_dot( 7, 5, 1, 1 ) = -0.215900;
2148  rsigma_dot( 7, 6, 1, 1 ) = -5.011660;
2149  rsigma_dot( 7, 7, 1, 1 ) = -7.313420;
2150  rsigma_dot( 7, 8, 1, 1 ) = -6.580620;
2151  rsigma_dot( 7, 9, 1, 1 ) = -4.726730;
2152  rsigma_dot( 7, 10, 1, 1 ) = -4.748470;
2153  rsigma_dot( 7, 11, 1, 1 ) = -2.923900;
2154  rsigma_dot( 7, 12, 1, 1 ) = -5.700670;
2155  rsigma_dot( 7, 13, 1, 1 ) = -6.799280;
2156  rsigma_dot( 7, 14, 1, 1 ) = -6.059410;
2157  rsigma_dot( 7, 15, 1, 1 ) = -2.161800;
2158  rsigma_dot( 7, 16, 1, 1 ) = -0.215900;
2159  rsigma_dot( 7, 17, 1, 1 ) = -0.215900;
2160  rsigma_dot( 7, 18, 1, 1 ) = -0.215900;
2161  rsigma_dot( 8, 1, 1, 1 ) = -0.169300;
2162  rsigma_dot( 8, 2, 1, 1 ) = -0.169300;
2163  rsigma_dot( 8, 3, 1, 1 ) = -0.169300;
2164  rsigma_dot( 8, 4, 1, 1 ) = -0.169300;
2165  rsigma_dot( 8, 5, 1, 1 ) = -0.169300;
2166  rsigma_dot( 8, 6, 1, 1 ) = -6.132930;
2167  rsigma_dot( 8, 7, 1, 1 ) = -8.735140;
2168  rsigma_dot( 8, 8, 1, 1 ) = -7.789560;
2169  rsigma_dot( 8, 9, 1, 1 ) = -5.199790;
2170  rsigma_dot( 8, 10, 1, 1 ) = -4.981530;
2171  rsigma_dot( 8, 11, 1, 1 ) = -3.882920;
2172  rsigma_dot( 8, 12, 1, 1 ) = -5.059700;
2173  rsigma_dot( 8, 13, 1, 1 ) = -7.329420;
2174  rsigma_dot( 8, 14, 1, 1 ) = -7.217740;
2175  rsigma_dot( 8, 15, 1, 1 ) = -4.723230;
2176  rsigma_dot( 8, 16, 1, 1 ) = -0.169300;
2177  rsigma_dot( 8, 17, 1, 1 ) = -0.169300;
2178  rsigma_dot( 8, 18, 1, 1 ) = -0.169300;
2179  rsigma_dot( 9, 1, 1, 1 ) = -0.124900;
2180  rsigma_dot( 9, 2, 1, 1 ) = -0.124900;
2181  rsigma_dot( 9, 3, 1, 1 ) = -0.124900;
2182  rsigma_dot( 9, 4, 1, 1 ) = -1.223500;
2183  rsigma_dot( 9, 5, 1, 1 ) = -3.069300;
2184  rsigma_dot( 9, 6, 1, 1 ) = -6.756900;
2185  rsigma_dot( 9, 7, 1, 1 ) = -8.997660;
2186  rsigma_dot( 9, 8, 1, 1 ) = -7.292710;
2187  rsigma_dot( 9, 9, 1, 1 ) = -5.704630;
2188  rsigma_dot( 9, 10, 1, 1 ) = -4.442390;
2189  rsigma_dot( 9, 11, 1, 1 ) = -4.202430;
2190  rsigma_dot( 9, 12, 1, 1 ) = -4.567550;
2191  rsigma_dot( 9, 13, 1, 1 ) = -7.550850;
2192  rsigma_dot( 9, 14, 1, 1 ) = -8.291970;
2193  rsigma_dot( 9, 15, 1, 1 ) = -5.617960;
2194  rsigma_dot( 9, 16, 1, 1 ) = -1.223500;
2195  rsigma_dot( 9, 17, 1, 1 ) = -1.223500;
2196  rsigma_dot( 9, 18, 1, 1 ) = -0.124900;
2197  rsigma_dot( 10, 1, 1, 1 ) = -0.082300;
2198  rsigma_dot( 10, 2, 1, 1 ) = -0.082300;
2199  rsigma_dot( 10, 3, 1, 1 ) = -0.082300;
2200  rsigma_dot( 10, 4, 1, 1 ) = -1.180900;
2201  rsigma_dot( 10, 5, 1, 1 ) = -3.932490;
2202  rsigma_dot( 10, 6, 1, 1 ) = -6.858840;
2203  rsigma_dot( 10, 7, 1, 1 ) = -8.186740;
2204  rsigma_dot( 10, 8, 1, 1 ) = -6.228670;
2205  rsigma_dot( 10, 9, 1, 1 ) = -5.720690;
2206  rsigma_dot( 10, 10, 1, 1 ) = -4.548250;
2207  rsigma_dot( 10, 11, 1, 1 ) = -4.451790;
2208  rsigma_dot( 10, 12, 1, 1 ) = -4.548250;
2209  rsigma_dot( 10, 13, 1, 1 ) = -7.242410;
2210  rsigma_dot( 10, 14, 1, 1 ) = -8.619920;
2211  rsigma_dot( 10, 15, 1, 1 ) = -6.349540;
2212  rsigma_dot( 10, 16, 1, 1 ) = -3.026800;
2213  rsigma_dot( 10, 17, 1, 1 ) = -1.180900;
2214  rsigma_dot( 10, 18, 1, 1 ) = -1.180900;
2215  rsigma_dot( 11, 1, 1, 1 ) = -0.041500;
2216  rsigma_dot( 11, 2, 1, 1 ) = -0.041500;
2217  rsigma_dot( 11, 3, 1, 1 ) = -0.041500;
2218  rsigma_dot( 11, 4, 1, 1 ) = -1.987400;
2219  rsigma_dot( 11, 5, 1, 1 ) = -4.275620;
2220  rsigma_dot( 11, 6, 1, 1 ) = -6.582550;
2221  rsigma_dot( 11, 7, 1, 1 ) = -6.915710;
2222  rsigma_dot( 11, 8, 1, 1 ) = -6.166200;
2223  rsigma_dot( 11, 9, 1, 1 ) = -5.483930;
2224  rsigma_dot( 11, 10, 1, 1 ) = -4.595390;
2225  rsigma_dot( 11, 11, 1, 1 ) = -4.616230;
2226  rsigma_dot( 11, 12, 1, 1 ) = -4.931860;
2227  rsigma_dot( 11, 13, 1, 1 ) = -6.246070;
2228  rsigma_dot( 11, 14, 1, 1 ) = -8.296560;
2229  rsigma_dot( 11, 15, 1, 1 ) = -6.734840;
2230  rsigma_dot( 11, 16, 1, 1 ) = -3.337400;
2231  rsigma_dot( 11, 17, 1, 1 ) = -1.140100;
2232  rsigma_dot( 11, 18, 1, 1 ) = -0.041500;
2233  rsigma_dot( 12, 1, 1, 1 ) = -0.002300;
2234  rsigma_dot( 12, 2, 1, 1 ) = -0.002300;
2235  rsigma_dot( 12, 3, 1, 1 ) = -0.002300;
2236  rsigma_dot( 12, 4, 1, 1 ) = -2.199500;
2237  rsigma_dot( 12, 5, 1, 1 ) = -4.729680;
2238  rsigma_dot( 12, 6, 1, 1 ) = -6.131350;
2239  rsigma_dot( 12, 7, 1, 1 ) = -5.729140;
2240  rsigma_dot( 12, 8, 1, 1 ) = -5.604410;
2241  rsigma_dot( 12, 9, 1, 1 ) = -5.211780;
2242  rsigma_dot( 12, 10, 1, 1 ) = -4.892640;
2243  rsigma_dot( 12, 11, 1, 1 ) = -4.992730;
2244  rsigma_dot( 12, 12, 1, 1 ) = -5.275290;
2245  rsigma_dot( 12, 13, 1, 1 ) = -5.945090;
2246  rsigma_dot( 12, 14, 1, 1 ) = -7.716970;
2247  rsigma_dot( 12, 15, 1, 1 ) = -6.693140;
2248  rsigma_dot( 12, 16, 1, 1 ) = -3.972590;
2249  rsigma_dot( 12, 17, 1, 1 ) = -1.948200;
2250  rsigma_dot( 12, 18, 1, 1 ) = -0.002300;
2251 
2252  // section 22
2253  rsigma_dot( 1, 1, 2, 2 ) = -0.550000;
2254  rsigma_dot( 1, 2, 2, 2 ) = -0.550000;
2255  rsigma_dot( 1, 3, 2, 2 ) = -0.550000;
2256  rsigma_dot( 1, 4, 2, 2 ) = -0.550000;
2257  rsigma_dot( 1, 5, 2, 2 ) = -0.550000;
2258  rsigma_dot( 1, 6, 2, 2 ) = -0.550000;
2259  rsigma_dot( 1, 7, 2, 2 ) = -0.550000;
2260  rsigma_dot( 1, 8, 2, 2 ) = -2.159400;
2261  rsigma_dot( 1, 9, 2, 2 ) = -0.550000;
2262  rsigma_dot( 1, 10, 2, 2 ) = -2.159400;
2263  rsigma_dot( 1, 11, 2, 2 ) = -0.550000;
2264  rsigma_dot( 1, 12, 2, 2 ) = -0.550000;
2265  rsigma_dot( 1, 13, 2, 2 ) = -0.550000;
2266  rsigma_dot( 1, 14, 2, 2 ) = -0.550000;
2267  rsigma_dot( 1, 15, 2, 2 ) = -0.550000;
2268  rsigma_dot( 1, 16, 2, 2 ) = -0.550000;
2269  rsigma_dot( 1, 17, 2, 2 ) = -0.550000;
2270  rsigma_dot( 1, 18, 2, 2 ) = -0.550000;
2271  rsigma_dot( 2, 1, 2, 2 ) = -0.485500;
2272  rsigma_dot( 2, 2, 2, 2 ) = -0.485500;
2273  rsigma_dot( 2, 3, 2, 2 ) = -0.485500;
2274  rsigma_dot( 2, 4, 2, 2 ) = -0.485500;
2275  rsigma_dot( 2, 5, 2, 2 ) = -0.485500;
2276  rsigma_dot( 2, 6, 2, 2 ) = -1.584100;
2277  rsigma_dot( 2, 7, 2, 2 ) = -3.050400;
2278  rsigma_dot( 2, 8, 2, 2 ) = -2.094900;
2279  rsigma_dot( 2, 9, 2, 2 ) = -2.431400;
2280  rsigma_dot( 2, 10, 2, 2 ) = -1.584100;
2281  rsigma_dot( 2, 11, 2, 2 ) = -0.485500;
2282  rsigma_dot( 2, 12, 2, 2 ) = -0.485500;
2283  rsigma_dot( 2, 13, 2, 2 ) = -0.485500;
2284  rsigma_dot( 2, 14, 2, 2 ) = -0.485500;
2285  rsigma_dot( 2, 15, 2, 2 ) = -0.485500;
2286  rsigma_dot( 2, 16, 2, 2 ) = -0.485500;
2287  rsigma_dot( 2, 17, 2, 2 ) = -0.485500;
2288  rsigma_dot( 2, 18, 2, 2 ) = -0.485500;
2289  rsigma_dot( 3, 1, 2, 2 ) = -0.424800;
2290  rsigma_dot( 3, 2, 2, 2 ) = -0.424800;
2291  rsigma_dot( 3, 3, 2, 2 ) = -0.424800;
2292  rsigma_dot( 3, 4, 2, 2 ) = -0.424800;
2293  rsigma_dot( 3, 5, 2, 2 ) = -0.424800;
2294  rsigma_dot( 3, 6, 2, 2 ) = -3.258000;
2295  rsigma_dot( 3, 7, 2, 2 ) = -4.231500;
2296  rsigma_dot( 3, 8, 2, 2 ) = -3.980180;
2297  rsigma_dot( 3, 9, 2, 2 ) = -2.370700;
2298  rsigma_dot( 3, 10, 2, 2 ) = -1.523400;
2299  rsigma_dot( 3, 11, 2, 2 ) = -2.822700;
2300  rsigma_dot( 3, 12, 2, 2 ) = -0.424800;
2301  rsigma_dot( 3, 13, 2, 2 ) = -0.424800;
2302  rsigma_dot( 3, 14, 2, 2 ) = -0.424800;
2303  rsigma_dot( 3, 15, 2, 2 ) = -0.424800;
2304  rsigma_dot( 3, 16, 2, 2 ) = -0.424800;
2305  rsigma_dot( 3, 17, 2, 2 ) = -0.424800;
2306  rsigma_dot( 3, 18, 2, 2 ) = -0.424800;
2307  rsigma_dot( 4, 1, 2, 2 ) = -0.367700;
2308  rsigma_dot( 4, 2, 2, 2 ) = -0.367700;
2309  rsigma_dot( 4, 3, 2, 2 ) = -0.367700;
2310  rsigma_dot( 4, 4, 2, 2 ) = -0.367700;
2311  rsigma_dot( 4, 5, 2, 2 ) = -3.312100;
2312  rsigma_dot( 4, 6, 2, 2 ) = -3.412200;
2313  rsigma_dot( 4, 7, 2, 2 ) = -5.509340;
2314  rsigma_dot( 4, 8, 2, 2 ) = -4.128880;
2315  rsigma_dot( 4, 9, 2, 2 ) = -3.075700;
2316  rsigma_dot( 4, 10, 2, 2 ) = -2.765600;
2317  rsigma_dot( 4, 11, 2, 2 ) = -2.765600;
2318  rsigma_dot( 4, 12, 2, 2 ) = -2.765600;
2319  rsigma_dot( 4, 13, 2, 2 ) = -0.367700;
2320  rsigma_dot( 4, 14, 2, 2 ) = -0.367700;
2321  rsigma_dot( 4, 15, 2, 2 ) = -0.367700;
2322  rsigma_dot( 4, 16, 2, 2 ) = -0.367700;
2323  rsigma_dot( 4, 17, 2, 2 ) = -0.367700;
2324  rsigma_dot( 4, 18, 2, 2 ) = -0.367700;
2325  rsigma_dot( 5, 1, 2, 2 ) = -0.313600;
2326  rsigma_dot( 5, 2, 2, 2 ) = -0.313600;
2327  rsigma_dot( 5, 3, 2, 2 ) = -0.313600;
2328  rsigma_dot( 5, 4, 2, 2 ) = -1.412200;
2329  rsigma_dot( 5, 5, 2, 2 ) = -3.021700;
2330  rsigma_dot( 5, 6, 2, 2 ) = -4.779520;
2331  rsigma_dot( 5, 7, 2, 2 ) = -6.825360;
2332  rsigma_dot( 5, 8, 2, 2 ) = -4.657420;
2333  rsigma_dot( 5, 9, 2, 2 ) = -3.358100;
2334  rsigma_dot( 5, 10, 2, 2 ) = -3.609400;
2335  rsigma_dot( 5, 11, 2, 2 ) = -4.245440;
2336  rsigma_dot( 5, 12, 2, 2 ) = -3.021700;
2337  rsigma_dot( 5, 13, 2, 2 ) = -1.412200;
2338  rsigma_dot( 5, 14, 2, 2 ) = -0.313600;
2339  rsigma_dot( 5, 15, 2, 2 ) = -0.313600;
2340  rsigma_dot( 5, 16, 2, 2 ) = -0.313600;
2341  rsigma_dot( 5, 17, 2, 2 ) = -0.313600;
2342  rsigma_dot( 5, 18, 2, 2 ) = -0.313600;
2343  rsigma_dot( 6, 1, 2, 2 ) = -0.262300;
2344  rsigma_dot( 6, 2, 2, 2 ) = -0.262300;
2345  rsigma_dot( 6, 3, 2, 2 ) = -0.262300;
2346  rsigma_dot( 6, 4, 2, 2 ) = -1.871800;
2347  rsigma_dot( 6, 5, 2, 2 ) = -2.208200;
2348  rsigma_dot( 6, 6, 2, 2 ) = -6.862190;
2349  rsigma_dot( 6, 7, 2, 2 ) = -7.463490;
2350  rsigma_dot( 6, 8, 2, 2 ) = -4.837030;
2351  rsigma_dot( 6, 9, 2, 2 ) = -4.436700;
2352  rsigma_dot( 6, 10, 2, 2 ) = -4.916280;
2353  rsigma_dot( 6, 11, 2, 2 ) = -5.687270;
2354  rsigma_dot( 6, 12, 2, 2 ) = -4.405450;
2355  rsigma_dot( 6, 13, 2, 2 ) = -2.208200;
2356  rsigma_dot( 6, 14, 2, 2 ) = -0.262300;
2357  rsigma_dot( 6, 15, 2, 2 ) = -1.360900;
2358  rsigma_dot( 6, 16, 2, 2 ) = -0.262300;
2359  rsigma_dot( 6, 17, 2, 2 ) = -0.262300;
2360  rsigma_dot( 6, 18, 2, 2 ) = -0.262300;
2361  rsigma_dot( 7, 1, 2, 2 ) = -0.213500;
2362  rsigma_dot( 7, 2, 2, 2 ) = -0.213500;
2363  rsigma_dot( 7, 3, 2, 2 ) = -0.213500;
2364  rsigma_dot( 7, 4, 2, 2 ) = -0.213500;
2365  rsigma_dot( 7, 5, 2, 2 ) = -4.256580;
2366  rsigma_dot( 7, 6, 2, 2 ) = -8.696750;
2367  rsigma_dot( 7, 7, 2, 2 ) = -7.275720;
2368  rsigma_dot( 7, 8, 2, 2 ) = -4.746130;
2369  rsigma_dot( 7, 9, 2, 2 ) = -4.145350;
2370  rsigma_dot( 7, 10, 2, 2 ) = -4.923060;
2371  rsigma_dot( 7, 11, 2, 2 ) = -6.725270;
2372  rsigma_dot( 7, 12, 2, 2 ) = -5.620700;
2373  rsigma_dot( 7, 13, 2, 2 ) = -2.611400;
2374  rsigma_dot( 7, 14, 2, 2 ) = -0.213500;
2375  rsigma_dot( 7, 15, 2, 2 ) = -0.213500;
2376  rsigma_dot( 7, 16, 2, 2 ) = -0.213500;
2377  rsigma_dot( 7, 17, 2, 2 ) = -0.213500;
2378  rsigma_dot( 7, 18, 2, 2 ) = -0.213500;
2379  rsigma_dot( 8, 1, 2, 2 ) = -0.167000;
2380  rsigma_dot( 8, 2, 2, 2 ) = -0.167000;
2381  rsigma_dot( 8, 3, 2, 2 ) = -0.167000;
2382  rsigma_dot( 8, 4, 2, 2 ) = -1.265600;
2383  rsigma_dot( 8, 5, 2, 2 ) = -6.383610;
2384  rsigma_dot( 8, 6, 2, 2 ) = -9.098560;
2385  rsigma_dot( 8, 7, 2, 2 ) = -6.418910;
2386  rsigma_dot( 8, 8, 2, 2 ) = -4.561460;
2387  rsigma_dot( 8, 9, 2, 2 ) = -4.174340;
2388  rsigma_dot( 8, 10, 2, 2 ) = -4.979190;
2389  rsigma_dot( 8, 11, 2, 2 ) = -7.462060;
2390  rsigma_dot( 8, 12, 2, 2 ) = -7.337890;
2391  rsigma_dot( 8, 13, 2, 2 ) = -3.722400;
2392  rsigma_dot( 8, 14, 2, 2 ) = -0.167000;
2393  rsigma_dot( 8, 15, 2, 2 ) = -0.167000;
2394  rsigma_dot( 8, 16, 2, 2 ) = -0.167000;
2395  rsigma_dot( 8, 17, 2, 2 ) = -0.167000;
2396  rsigma_dot( 8, 18, 2, 2 ) = -0.167000;
2397  rsigma_dot( 9, 1, 2, 2 ) = -0.122600;
2398  rsigma_dot( 9, 2, 2, 2 ) = -0.122600;
2399  rsigma_dot( 9, 3, 2, 2 ) = -0.122600;
2400  rsigma_dot( 9, 4, 2, 2 ) = -1.221200;
2401  rsigma_dot( 9, 5, 2, 2 ) = -7.827370;
2402  rsigma_dot( 9, 6, 2, 2 ) = -8.067400;
2403  rsigma_dot( 9, 7, 2, 2 ) = -5.809530;
2404  rsigma_dot( 9, 8, 2, 2 ) = -4.966740;
2405  rsigma_dot( 9, 9, 2, 2 ) = -4.327250;
2406  rsigma_dot( 9, 10, 2, 2 ) = -4.884730;
2407  rsigma_dot( 9, 11, 2, 2 ) = -7.072410;
2408  rsigma_dot( 9, 12, 2, 2 ) = -8.543900;
2409  rsigma_dot( 9, 13, 2, 2 ) = -5.252450;
2410  rsigma_dot( 9, 14, 2, 2 ) = -1.732000;
2411  rsigma_dot( 9, 15, 2, 2 ) = -0.122600;
2412  rsigma_dot( 9, 16, 2, 2 ) = -0.122600;
2413  rsigma_dot( 9, 17, 2, 2 ) = -0.122600;
2414  rsigma_dot( 9, 18, 2, 2 ) = -0.122600;
2415  rsigma_dot( 10, 1, 2, 2 ) = -0.080000;
2416  rsigma_dot( 10, 2, 2, 2 ) = -0.080000;
2417  rsigma_dot( 10, 3, 2, 2 ) = -1.689400;
2418  rsigma_dot( 10, 4, 2, 2 ) = -2.913200;
2419  rsigma_dot( 10, 5, 2, 2 ) = -7.579420;
2420  rsigma_dot( 10, 6, 2, 2 ) = -6.907620;
2421  rsigma_dot( 10, 7, 2, 2 ) = -5.422330;
2422  rsigma_dot( 10, 8, 2, 2 ) = -5.161400;
2423  rsigma_dot( 10, 9, 2, 2 ) = -4.590850;
2424  rsigma_dot( 10, 10, 2, 2 ) = -4.970340;
2425  rsigma_dot( 10, 11, 2, 2 ) = -6.331900;
2426  rsigma_dot( 10, 12, 2, 2 ) = -8.504850;
2427  rsigma_dot( 10, 13, 2, 2 ) = -6.881280;
2428  rsigma_dot( 10, 14, 2, 2 ) = -2.644900;
2429  rsigma_dot( 10, 15, 2, 2 ) = -0.080000;
2430  rsigma_dot( 10, 16, 2, 2 ) = -1.178600;
2431  rsigma_dot( 10, 17, 2, 2 ) = -0.080000;
2432  rsigma_dot( 10, 18, 2, 2 ) = -0.080000;
2433  rsigma_dot( 11, 1, 2, 2 ) = -0.039200;
2434  rsigma_dot( 11, 2, 2, 2 ) = -1.137800;
2435  rsigma_dot( 11, 3, 2, 2 ) = -2.437100;
2436  rsigma_dot( 11, 4, 2, 2 ) = -4.356660;
2437  rsigma_dot( 11, 5, 2, 2 ) = -6.159470;
2438  rsigma_dot( 11, 6, 2, 2 ) = -6.109910;
2439  rsigma_dot( 11, 7, 2, 2 ) = -5.082600;
2440  rsigma_dot( 11, 8, 2, 2 ) = -5.203960;
2441  rsigma_dot( 11, 9, 2, 2 ) = -5.029610;
2442  rsigma_dot( 11, 10, 2, 2 ) = -5.180840;
2443  rsigma_dot( 11, 11, 2, 2 ) = -5.633880;
2444  rsigma_dot( 11, 12, 2, 2 ) = -7.850740;
2445  rsigma_dot( 11, 13, 2, 2 ) = -8.236990;
2446  rsigma_dot( 11, 14, 2, 2 ) = -3.258000;
2447  rsigma_dot( 11, 15, 2, 2 ) = -2.604100;
2448  rsigma_dot( 11, 16, 2, 2 ) = -1.648600;
2449  rsigma_dot( 11, 17, 2, 2 ) = -0.039200;
2450  rsigma_dot( 11, 18, 2, 2 ) = -0.039200;
2451  rsigma_dot( 12, 1, 2, 2 ) = 0.000000;
2452  rsigma_dot( 12, 2, 2, 2 ) = -2.197200;
2453  rsigma_dot( 12, 3, 2, 2 ) = -2.708000;
2454  rsigma_dot( 12, 4, 2, 2 ) = -5.093700;
2455  rsigma_dot( 12, 5, 2, 2 ) = -5.802070;
2456  rsigma_dot( 12, 6, 2, 2 ) = -5.587200;
2457  rsigma_dot( 12, 7, 2, 2 ) = -5.198450;
2458  rsigma_dot( 12, 8, 2, 2 ) = -5.459540;
2459  rsigma_dot( 12, 9, 2, 2 ) = -5.068860;
2460  rsigma_dot( 12, 10, 2, 2 ) = -5.272950;
2461  rsigma_dot( 12, 11, 2, 2 ) = -5.370590;
2462  rsigma_dot( 12, 12, 2, 2 ) = -6.597100;
2463  rsigma_dot( 12, 13, 2, 2 ) = -7.631870;
2464  rsigma_dot( 12, 14, 2, 2 ) = -5.043380;
2465  rsigma_dot( 12, 15, 2, 2 ) = -3.218800;
2466  rsigma_dot( 12, 16, 2, 2 ) = -2.833200;
2467  rsigma_dot( 12, 17, 2, 2 ) = -2.197200;
2468  rsigma_dot( 12, 18, 2, 2 ) = 0.000000;
2469 
2470  // section 21
2471  rsigma_dot( 1, 1, 2, 1 ) = -0.974100;
2472  rsigma_dot( 1, 2, 2, 1 ) = -0.974100;
2473  rsigma_dot( 1, 3, 2, 1 ) = -0.974100;
2474  rsigma_dot( 1, 4, 2, 1 ) = -0.974100;
2475  rsigma_dot( 1, 5, 2, 1 ) = -0.974100;
2476  rsigma_dot( 1, 6, 2, 1 ) = -0.974100;
2477  rsigma_dot( 1, 7, 2, 1 ) = -0.974100;
2478  rsigma_dot( 1, 8, 2, 1 ) = -2.920000;
2479  rsigma_dot( 1, 9, 2, 1 ) = -3.171400;
2480  rsigma_dot( 1, 10, 2, 1 ) = -0.974100;
2481  rsigma_dot( 1, 11, 2, 1 ) = -2.583600;
2482  rsigma_dot( 1, 12, 2, 1 ) = -0.974100;
2483  rsigma_dot( 1, 13, 2, 1 ) = -0.974100;
2484  rsigma_dot( 1, 14, 2, 1 ) = -0.974100;
2485  rsigma_dot( 1, 15, 2, 1 ) = -0.974100;
2486  rsigma_dot( 1, 16, 2, 1 ) = -0.974100;
2487  rsigma_dot( 1, 17, 2, 1 ) = -0.974100;
2488  rsigma_dot( 1, 18, 2, 1 ) = -0.974100;
2489  rsigma_dot( 2, 1, 2, 1 ) = -0.909600;
2490  rsigma_dot( 2, 2, 2, 1 ) = -0.909600;
2491  rsigma_dot( 2, 3, 2, 1 ) = -0.909600;
2492  rsigma_dot( 2, 4, 2, 1 ) = -0.909600;
2493  rsigma_dot( 2, 5, 2, 1 ) = -0.909600;
2494  rsigma_dot( 2, 6, 2, 1 ) = -0.909600;
2495  rsigma_dot( 2, 7, 2, 1 ) = -0.909600;
2496  rsigma_dot( 2, 8, 2, 1 ) = -4.343580;
2497  rsigma_dot( 2, 9, 2, 1 ) = -6.015540;
2498  rsigma_dot( 2, 10, 2, 1 ) = -4.205430;
2499  rsigma_dot( 2, 11, 2, 1 ) = -2.008200;
2500  rsigma_dot( 2, 12, 2, 1 ) = -2.519000;
2501  rsigma_dot( 2, 13, 2, 1 ) = -0.909600;
2502  rsigma_dot( 2, 14, 2, 1 ) = -0.909600;
2503  rsigma_dot( 2, 15, 2, 1 ) = -0.909600;
2504  rsigma_dot( 2, 16, 2, 1 ) = -0.909600;
2505  rsigma_dot( 2, 17, 2, 1 ) = -0.909600;
2506  rsigma_dot( 2, 18, 2, 1 ) = -0.909600;
2507  rsigma_dot( 3, 1, 2, 1 ) = -0.849000;
2508  rsigma_dot( 3, 2, 2, 1 ) = -0.849000;
2509  rsigma_dot( 3, 3, 2, 1 ) = -0.849000;
2510  rsigma_dot( 3, 4, 2, 1 ) = -0.849000;
2511  rsigma_dot( 3, 5, 2, 1 ) = -0.849000;
2512  rsigma_dot( 3, 6, 2, 1 ) = -0.849000;
2513  rsigma_dot( 3, 7, 2, 1 ) = -3.046200;
2514  rsigma_dot( 3, 8, 2, 1 ) = -5.990630;
2515  rsigma_dot( 3, 9, 2, 1 ) = -7.627760;
2516  rsigma_dot( 3, 10, 2, 1 ) = -6.013760;
2517  rsigma_dot( 3, 11, 2, 1 ) = -2.794900;
2518  rsigma_dot( 3, 12, 2, 1 ) = -2.458400;
2519  rsigma_dot( 3, 13, 2, 1 ) = -0.849000;
2520  rsigma_dot( 3, 14, 2, 1 ) = -0.849000;
2521  rsigma_dot( 3, 15, 2, 1 ) = -0.849000;
2522  rsigma_dot( 3, 16, 2, 1 ) = -0.849000;
2523  rsigma_dot( 3, 17, 2, 1 ) = -0.849000;
2524  rsigma_dot( 3, 18, 2, 1 ) = -0.849000;
2525  rsigma_dot( 4, 1, 2, 1 ) = -0.791800;
2526  rsigma_dot( 4, 2, 2, 1 ) = -0.791800;
2527  rsigma_dot( 4, 3, 2, 1 ) = -0.791800;
2528  rsigma_dot( 4, 4, 2, 1 ) = -0.791800;
2529  rsigma_dot( 4, 5, 2, 1 ) = -0.791800;
2530  rsigma_dot( 4, 6, 2, 1 ) = -2.401300;
2531  rsigma_dot( 4, 7, 2, 1 ) = -3.736250;
2532  rsigma_dot( 4, 8, 2, 1 ) = -6.512120;
2533  rsigma_dot( 4, 9, 2, 1 ) = -8.856760;
2534  rsigma_dot( 4, 10, 2, 1 ) = -7.235940;
2535  rsigma_dot( 4, 11, 2, 1 ) = -4.010690;
2536  rsigma_dot( 4, 12, 2, 1 ) = -2.401300;
2537  rsigma_dot( 4, 13, 2, 1 ) = -1.890400;
2538  rsigma_dot( 4, 14, 2, 1 ) = -0.791800;
2539  rsigma_dot( 4, 15, 2, 1 ) = -0.791800;
2540  rsigma_dot( 4, 16, 2, 1 ) = -0.791800;
2541  rsigma_dot( 4, 17, 2, 1 ) = -0.791800;
2542  rsigma_dot( 4, 18, 2, 1 ) = -0.791800;
2543  rsigma_dot( 5, 1, 2, 1 ) = -0.737700;
2544  rsigma_dot( 5, 2, 2, 1 ) = -0.737700;
2545  rsigma_dot( 5, 3, 2, 1 ) = -0.737700;
2546  rsigma_dot( 5, 4, 2, 1 ) = -0.737700;
2547  rsigma_dot( 5, 5, 2, 1 ) = -0.737700;
2548  rsigma_dot( 5, 6, 2, 1 ) = -2.683700;
2549  rsigma_dot( 5, 7, 2, 1 ) = -4.171730;
2550  rsigma_dot( 5, 8, 2, 1 ) = -7.436010;
2551  rsigma_dot( 5, 9, 2, 1 ) = -9.773380;
2552  rsigma_dot( 5, 10, 2, 1 ) = -8.510500;
2553  rsigma_dot( 5, 11, 2, 1 ) = -4.669570;
2554  rsigma_dot( 5, 12, 2, 1 ) = -3.445800;
2555  rsigma_dot( 5, 13, 2, 1 ) = -1.836400;
2556  rsigma_dot( 5, 14, 2, 1 ) = -0.737700;
2557  rsigma_dot( 5, 15, 2, 1 ) = -0.737700;
2558  rsigma_dot( 5, 16, 2, 1 ) = -0.737700;
2559  rsigma_dot( 5, 17, 2, 1 ) = -0.737700;
2560  rsigma_dot( 5, 18, 2, 1 ) = -0.737700;
2561  rsigma_dot( 6, 1, 2, 1 ) = -0.686500;
2562  rsigma_dot( 6, 2, 2, 1 ) = -0.686500;
2563  rsigma_dot( 6, 3, 2, 1 ) = -0.686500;
2564  rsigma_dot( 6, 4, 2, 1 ) = -0.686500;
2565  rsigma_dot( 6, 5, 2, 1 ) = -0.686500;
2566  rsigma_dot( 6, 6, 2, 1 ) = -0.686500;
2567  rsigma_dot( 6, 7, 2, 1 ) = -4.297370;
2568  rsigma_dot( 6, 8, 2, 1 ) = -7.670240;
2569  rsigma_dot( 6, 9, 2, 1 ) = -9.274480;
2570  rsigma_dot( 6, 10, 2, 1 ) = -8.780530;
2571  rsigma_dot( 6, 11, 2, 1 ) = -5.395980;
2572  rsigma_dot( 6, 12, 2, 1 ) = -2.632400;
2573  rsigma_dot( 6, 13, 2, 1 ) = -3.084300;
2574  rsigma_dot( 6, 14, 2, 1 ) = -0.686500;
2575  rsigma_dot( 6, 15, 2, 1 ) = -0.686500;
2576  rsigma_dot( 6, 16, 2, 1 ) = -0.686500;
2577  rsigma_dot( 6, 17, 2, 1 ) = -0.686500;
2578  rsigma_dot( 6, 18, 2, 1 ) = -0.686500;
2579  rsigma_dot( 7, 1, 2, 1 ) = -0.637700;
2580  rsigma_dot( 7, 2, 2, 1 ) = -0.637700;
2581  rsigma_dot( 7, 3, 2, 1 ) = -0.637700;
2582  rsigma_dot( 7, 4, 2, 1 ) = -0.637700;
2583  rsigma_dot( 7, 5, 2, 1 ) = -1.736300;
2584  rsigma_dot( 7, 6, 2, 1 ) = -3.682200;
2585  rsigma_dot( 7, 7, 2, 1 ) = -4.645000;
2586  rsigma_dot( 7, 8, 2, 1 ) = -6.967380;
2587  rsigma_dot( 7, 9, 2, 1 ) = -7.766160;
2588  rsigma_dot( 7, 10, 2, 1 ) = -7.608390;
2589  rsigma_dot( 7, 11, 2, 1 ) = -5.416790;
2590  rsigma_dot( 7, 12, 2, 1 ) = -3.773160;
2591  rsigma_dot( 7, 13, 2, 1 ) = -3.345700;
2592  rsigma_dot( 7, 14, 2, 1 ) = -2.834900;
2593  rsigma_dot( 7, 15, 2, 1 ) = -2.247100;
2594  rsigma_dot( 7, 16, 2, 1 ) = -0.637700;
2595  rsigma_dot( 7, 17, 2, 1 ) = -0.637700;
2596  rsigma_dot( 7, 18, 2, 1 ) = -0.637700;
2597  rsigma_dot( 8, 1, 2, 1 ) = -0.591100;
2598  rsigma_dot( 8, 2, 2, 1 ) = -0.591100;
2599  rsigma_dot( 8, 3, 2, 1 ) = -0.591100;
2600  rsigma_dot( 8, 4, 2, 1 ) = -0.591100;
2601  rsigma_dot( 8, 5, 2, 1 ) = -2.788400;
2602  rsigma_dot( 8, 6, 2, 1 ) = -4.087650;
2603  rsigma_dot( 8, 7, 2, 1 ) = -4.702020;
2604  rsigma_dot( 8, 8, 2, 1 ) = -6.084200;
2605  rsigma_dot( 8, 9, 2, 1 ) = -6.877140;
2606  rsigma_dot( 8, 10, 2, 1 ) = -6.827510;
2607  rsigma_dot( 8, 11, 2, 1 ) = -5.980210;
2608  rsigma_dot( 8, 12, 2, 1 ) = -4.087650;
2609  rsigma_dot( 8, 13, 2, 1 ) = -3.635700;
2610  rsigma_dot( 8, 14, 2, 1 ) = -4.202060;
2611  rsigma_dot( 8, 15, 2, 1 ) = -2.537100;
2612  rsigma_dot( 8, 16, 2, 1 ) = -0.591100;
2613  rsigma_dot( 8, 17, 2, 1 ) = -0.591100;
2614  rsigma_dot( 8, 18, 2, 1 ) = -0.591100;
2615  rsigma_dot( 9, 1, 2, 1 ) = -0.546700;
2616  rsigma_dot( 9, 2, 2, 1 ) = -0.546700;
2617  rsigma_dot( 9, 3, 2, 1 ) = -0.546700;
2618  rsigma_dot( 9, 4, 2, 1 ) = -0.546700;
2619  rsigma_dot( 9, 5, 2, 1 ) = -3.254700;
2620  rsigma_dot( 9, 6, 2, 1 ) = -4.102040;
2621  rsigma_dot( 9, 7, 2, 1 ) = -4.916140;
2622  rsigma_dot( 9, 8, 2, 1 ) = -5.788440;
2623  rsigma_dot( 9, 9, 2, 1 ) = -5.777800;
2624  rsigma_dot( 9, 10, 2, 1 ) = -6.126420;
2625  rsigma_dot( 9, 11, 2, 1 ) = -5.997730;
2626  rsigma_dot( 9, 12, 2, 1 ) = -4.721080;
2627  rsigma_dot( 9, 13, 2, 1 ) = -4.102040;
2628  rsigma_dot( 9, 14, 2, 1 ) = -4.157610;
2629  rsigma_dot( 9, 15, 2, 1 ) = -3.111600;
2630  rsigma_dot( 9, 16, 2, 1 ) = -1.645300;
2631  rsigma_dot( 9, 17, 2, 1 ) = -0.546700;
2632  rsigma_dot( 9, 18, 2, 1 ) = -0.546700;
2633  rsigma_dot( 10, 1, 2, 1 ) = -0.504100;
2634  rsigma_dot( 10, 2, 2, 1 ) = -0.504100;
2635  rsigma_dot( 10, 3, 2, 1 ) = -0.504100;
2636  rsigma_dot( 10, 4, 2, 1 ) = -0.504100;
2637  rsigma_dot( 10, 5, 2, 1 ) = -3.548700;
2638  rsigma_dot( 10, 6, 2, 1 ) = -4.873580;
2639  rsigma_dot( 10, 7, 2, 1 ) = -5.176960;
2640  rsigma_dot( 10, 8, 2, 1 ) = -5.756400;
2641  rsigma_dot( 10, 9, 2, 1 ) = -5.573030;
2642  rsigma_dot( 10, 10, 2, 1 ) = -5.702630;
2643  rsigma_dot( 10, 11, 2, 1 ) = -5.668920;
2644  rsigma_dot( 10, 12, 2, 1 ) = -5.078840;
2645  rsigma_dot( 10, 13, 2, 1 ) = -4.678520;
2646  rsigma_dot( 10, 14, 2, 1 ) = -4.310790;
2647  rsigma_dot( 10, 15, 2, 1 ) = -4.217700;
2648  rsigma_dot( 10, 16, 2, 1 ) = -2.113600;
2649  rsigma_dot( 10, 17, 2, 1 ) = -0.504100;
2650  rsigma_dot( 10, 18, 2, 1 ) = -0.504100;
2651  rsigma_dot( 11, 1, 2, 1 ) = -0.463300;
2652  rsigma_dot( 11, 2, 2, 1 ) = -0.463300;
2653  rsigma_dot( 11, 3, 2, 1 ) = -0.463300;
2654  rsigma_dot( 11, 4, 2, 1 ) = -2.409200;
2655  rsigma_dot( 11, 5, 2, 1 ) = -4.313460;
2656  rsigma_dot( 11, 6, 2, 1 ) = -5.225480;
2657  rsigma_dot( 11, 7, 2, 1 ) = -5.493750;
2658  rsigma_dot( 11, 8, 2, 1 ) = -5.353660;
2659  rsigma_dot( 11, 9, 2, 1 ) = -5.154660;
2660  rsigma_dot( 11, 10, 2, 1 ) = -5.397780;
2661  rsigma_dot( 11, 11, 2, 1 ) = -5.726000;
2662  rsigma_dot( 11, 12, 2, 1 ) = -5.480590;
2663  rsigma_dot( 11, 13, 2, 1 ) = -4.018660;
2664  rsigma_dot( 11, 14, 2, 1 ) = -4.313460;
2665  rsigma_dot( 11, 15, 2, 1 ) = -4.574180;
2666  rsigma_dot( 11, 16, 2, 1 ) = -2.861200;
2667  rsigma_dot( 11, 17, 2, 1 ) = -0.463300;
2668  rsigma_dot( 11, 18, 2, 1 ) = -1.561900;
2669  rsigma_dot( 12, 1, 2, 1 ) = -0.424100;
2670  rsigma_dot( 12, 2, 2, 1 ) = -0.424100;
2671  rsigma_dot( 12, 3, 2, 1 ) = -2.822000;
2672  rsigma_dot( 12, 4, 2, 1 ) = -3.132100;
2673  rsigma_dot( 12, 5, 2, 1 ) = -5.115440;
2674  rsigma_dot( 12, 6, 2, 1 ) = -5.697090;
2675  rsigma_dot( 12, 7, 2, 1 ) = -5.747100;
2676  rsigma_dot( 12, 8, 2, 1 ) = -5.386930;
2677  rsigma_dot( 12, 9, 2, 1 ) = -5.019210;
2678  rsigma_dot( 12, 10, 2, 1 ) = -5.186260;
2679  rsigma_dot( 12, 11, 2, 1 ) = -5.775950;
2680  rsigma_dot( 12, 12, 2, 1 ) = -5.600240;
2681  rsigma_dot( 12, 13, 2, 1 ) = -4.394380;
2682  rsigma_dot( 12, 14, 2, 1 ) = -3.257300;
2683  rsigma_dot( 12, 15, 2, 1 ) = -3.920600;
2684  rsigma_dot( 12, 16, 2, 1 ) = -3.643000;
2685  rsigma_dot( 12, 17, 2, 1 ) = -1.522700;
2686  rsigma_dot( 12, 18, 2, 1 ) = -0.424100;
2687 }
2688 
2689 void
2691  FArray1D_real & m_term
2692 )
2693 {
2694  m_term(1) = 1.87;
2695  m_term(2) = .61;
2696  m_term(3) = .74;
2697  m_term(4) = .17; // score for 4 or more
2698 }
2699 
2700 /// @brief Penalty for pairing strand dimers that are close in sequence.
2701 /// @details Inferred from the log ratio of pairing probabilities of strands
2702 /// @details in the PDB vs. in Rosetta decoys. Calculated as a function of
2703 /// @details strand separation.
2704 void
2706  FArray1D_real & SS_penalty
2707 )
2708 {
2709  // For strand separations less than 5, statistics become small, so
2710  // set penalty to be a constant.
2711  SS_penalty( 1) = 1.13386;
2712  SS_penalty( 2) = 1.13386;
2713  SS_penalty( 3) = 1.13386;
2714  SS_penalty( 4) = 1.13386;
2715  SS_penalty( 5) = 1.13386;
2716  SS_penalty( 6) = 0.70241;
2717  SS_penalty( 7) = 0.57908;
2718  SS_penalty( 8) = 0.44451;
2719  SS_penalty( 9) = 0.31653;
2720  SS_penalty(10) = 0.22074;
2721  SS_penalty(11) = 0.14869;
2722 }
2723 
2724 
2725 } // ns scoring
2726 } // ns core
2727 
2728 
2729 
2730 /// @brief This function takes a set of dimer neighbors, and determines how
2731 /// @brief many sheets there, and how many strands are in each sheet
2732 /// @brief This information is then used to calculate the "poker hand" score,
2733 /// @brief which reflects to probability of that distribution of strands and
2734 /// @brief sheets.
2735 //
2736 //js This function takes a set of dimer neighbors, and determines how
2737 //js many sheets there, and how many strands are in each sheet
2738 //js This information is then used to calculate the "poker hand" score,
2739 //js which reflects to probability of that distribution of strands and
2740 //js sheets.
2741 //js In current version, it seems to simply penalize sheets with fewer
2742 //js strands compared to those with more strands.
2743 //
2744 //js This function looks at a list of dimers, which contains up to
2745 //js two neighbors for each dimer. In priniciple these neighbors would
2746 //js be hydrogen bond partners in neighboring strands. This function
2747 //js will take this list, however it is made.
2748 //
2749 //js Currently, dimer neighbors are defined somewhat arbitrarily.
2750 //js If I understand the code correctly, the first and last dimers in
2751 //js sequence that follow the current dimer, and that are within 6.5
2752 //js angstroms, are the neighbors. There is no orientation dependence
2753 //js on what counts as a strand neighbor.
2754 //
2755 //js A sheet is then loosely defined by all the strands that are connected
2756 //js by one of these neighbors. This amounts to "single-linkage clustering."
2757 //js A sheet is determined by the set of strands that can be linked by
2758 //js the dimer neighbors. Note that a one neighbor is enough to say that
2759 //js two strands are in a sheet.
2760 //
2761 //js The final score is put into sheet_score, and is determined by the
2762 //js number of sheets of each size.
2763 //
2764 //js Basic strategy: go through all dimers, finding neigboring strands
2765 //js Because each dimer can only have two neighbors we can first search
2766 //js all the way down one side, and then the other. This will give a set
2767 //js of dimers that are connected. The strands in which these dimers reside
2768 //js are then considered connected into sheets. By going through all
2769 //js dimers with the proper bookkeeping, we can determine how many sheets
2770 //js there are, and how many strands in e
2771 
2772 
2773 /**
2774 
2775 NOT PORTING IN FIRST PASS (PB)
2776 
2777 void
2778 SecondaryStructurePotential::sheets_from_dimers(
2779  Real & sheet_score
2780 )
2781 {
2782  int const & total_residue = *total_residue_; // yab: misc removal
2783 
2784  static FArray1D_bool searched( MAX_RES() );
2785  static FArray1D_int strand_sheet( MAX_RES() );
2786  // 40 is the maximum number of strands
2787  static FArray1D_int num_of_strands( MAX_RES() );
2788  // 11 is the maxmumber number of sheets
2789  static FArray2D_int strand_sheet_list( MAX_RES(), MAX_RES() );
2790  static FArray1D_real const m_term( 4, m_term_initializer );
2791 
2792  for ( int current_dimer = 1; current_dimer <= strands.total_SS_dimer;
2793  ++current_dimer ) {
2794 //js Set all dimers as unchecked.
2795  searched(current_dimer) = false;
2796 //js set all sheet locations as null
2797 //js dimer_sheet(current_dimer) = 0
2798  }
2799  for ( int current_strand = 1; current_strand <= strands.total_strands;
2800  ++current_strand ) {
2801 //js Set the sheets of all strands as null
2802  strand_sheet(current_strand) = 0;
2803  }
2804  for ( int current_sheet = 1; current_sheet <= total_residue;
2805  ++current_sheet ) {
2806  num_of_strands(current_sheet) = 0;
2807  }
2808 
2809 //js Find the neighbors of each dimer. Some will be found during
2810 //js the search, some will be initial nodes. That is why we keep
2811 //js track of whether it has been searched.
2812  int num_of_sheets = 0;
2813  int current_sheet = 0;
2814  for ( int current_dimer = 1; current_dimer <= strands.total_SS_dimer;
2815  ++current_dimer ) {
2816  if ( !searched(current_dimer) ) {
2817 //js we need to check this one
2818  searched(current_dimer) = true;
2819  int current_strand = strands.SS_strand(current_dimer);
2820  // place node strand in sheet
2821  if ( strand_sheet(current_strand) == 0 ) { // it is not in a sheet, so:
2822  // make new sheet
2823  ++num_of_sheets;
2824  current_sheet = num_of_sheets;
2825 
2826  // place strand in current sheet
2827  strand_sheet(current_strand) = current_sheet;
2828  ++num_of_strands(current_sheet);
2829  strand_sheet_list(num_of_strands(current_sheet),current_sheet) =
2830  current_strand;
2831  } else {
2832  current_sheet = strand_sheet(current_strand);
2833  }
2834  for ( int direction = 1; direction <= 2; ++direction ) {
2835  // the two directions of searching
2836  int neighbor = strands.dimer_neighbor(direction,current_dimer);
2837  while ( neighbor != 0 ) {
2838 // if ( neighbor != 0 ) {
2839 //js if ( !searched(neighbor) ) {
2840  searched(neighbor) = true;
2841 
2842  current_strand = strands.SS_strand(neighbor);
2843  if ( strand_sheet(current_strand) == 0 ) {
2844 // js if neighbor strand is not in a sheet already, put it in the working sheet
2845  strand_sheet(current_strand) = current_sheet;
2846  ++num_of_strands(current_sheet);
2847 
2848  strand_sheet_list(num_of_strands(current_sheet),current_sheet) =
2849  current_strand;
2850  } else if ( strand_sheet(current_strand) != current_sheet ) {
2851 // js if neighbor strand is already in a different sheet, merge the sheets.
2852 // js the sheet of the new strand must have a lower sheet number, so give the
2853 // js strands of the current sheet to its sheet
2854  int const new_sheet = strand_sheet(current_strand);
2855  int & num_of_strandsnew_sheet( num_of_strands(new_sheet) );
2856  for ( int merge = 1,
2857  lss = strand_sheet_list.index(merge,current_sheet),
2858  mergee = num_of_strands(current_sheet);
2859  merge <= mergee; ++merge, ++lss ) {
2860  ++num_of_strandsnew_sheet;
2861  int const strand_sheet_list_mc = strand_sheet_list[ lss ];
2862  // strand_sheet_list(merge,current_sheet)
2863  strand_sheet_list(num_of_strandsnew_sheet,new_sheet) =
2864  strand_sheet_list_mc;
2865  strand_sheet(strand_sheet_list_mc) = new_sheet;
2866  }
2867  --num_of_sheets;
2868 // rhiju After merging one sheet with another, need to erase traces
2869 // rhiju of sheet that got eaten up, and reorder other sheets.
2870  num_of_strands(current_sheet) = 0;
2871  for (int shiftsheet = current_sheet; shiftsheet <= num_of_sheets;
2872  ++shiftsheet){
2873  num_of_strands(shiftsheet) = num_of_strands(shiftsheet+1);
2874  for (int i = 1; i <= num_of_strands(shiftsheet); ++i){
2875  int strandtoshift = strand_sheet_list(i,shiftsheet+1);
2876  strand_sheet_list(i,shiftsheet) = strandtoshift;
2877  strand_sheet(strandtoshift) = shiftsheet;
2878  }
2879  }
2880  current_sheet = new_sheet;
2881  }
2882 //js }
2883  neighbor = strands.dimer_neighbor(direction,neighbor);
2884  }
2885  }
2886  }
2887  }
2888 
2889 //js calculate score, based on the number of sheets of each size
2890  Real sheet_score_sum = 0.0;
2891  for ( int current_sheet = 1; current_sheet <= num_of_sheets; ++current_sheet ) {
2892  sheet_score_sum += m_term( std::min( num_of_strands(current_sheet), 4 ) );
2893  }
2894  sheet_score = sheet_score_sum;
2895  // sheet_score *+ get_sheet_wt();
2896 
2897  // FIXME: keep Ingo's sheet filter? the sheet filter class is in classic rosetta
2898  // sheet_filter.h/sheet_filter.cc and should be self contained, so it's
2899  // directly liftable into mini without much modification
2900  // FIXME: need equivalent for files::paths below
2901  if ( get_handedness_score_flag() && files_paths::use_filter(files_paths::sheet_type) ){
2902  int result = 0;
2903  sheet_filter::SheetFilter sf(position_, secstruct_, total_residue_);
2904  sf.compute_result(result); // Trigger evaluation if Ingo's sheet filter, including handedness checks.
2905  sheet_score += sf.get_handedness_score();
2906  }
2907 
2908  // modify by proper weighting
2909  sheet_score *= 2.019 * get_sheet_weight();
2910 }
2911 
2912 **/
2913