17 #include <basic/Tracer.hh>
27 #include <utility/exit.hh>
34 #include <utility/vector1.hh>
35 #include <utility/options/IntegerVectorOption.hh>
40 #include <numeric/NumericTraits.hh>
42 static basic::Tracer
TR(
"protocols.topology.Sheet" );
51 SheetSet::~SheetSet() {}
58 is_geometry_initialized_( false )
65 num_strands_( order_strands.
size() ),
66 is_barrel_( is_barrel ),
67 order_strands_( order_strands ),
68 orient_strands_( orient_strands ),
69 is_geometry_initialized_( false )
71 runtime_assert( order_strands.size() == orient_strands.size() );
78 num_strands_( s.num_strands_ ),
79 is_barrel_( s.is_barrel_ ),
80 order_strands_( s.order_strands_ ),
81 orient_strands_( s.orient_strands_ ),
82 strand_order_( s.strand_order_ ),
83 sheet_plane_( s.sheet_plane_ ),
84 sheet_center_( s.sheet_center_ ),
85 ca_cb_orients_( s.ca_cb_orients_ ),
86 is_geometry_initialized_( s.is_geometry_initialized_ )
110 out <<
"#Strand " << i <<
": " <<
order[ i ] <<
"," << orient[ i ] << std::endl;;
143 Size begin( strands[ st ]->begin() );
146 if( begin == 1 ) begin = 2;
149 for(
Size ir=begin-1; ir<=end+1; ir++ ) {
150 for (
Size j = 1; j<=5; ++j ) {
152 atom_map.
set( atom,
true );
165 surfaces[ 1 ] += rsd_sasa[ iaa ];
167 surfaces[ 2 ] += rsd_sasa[ iaa ];
180 runtime_assert( ssinfo->bbpos_is_set() );
211 for(
Size ii=1; ii<=bb_pos.size(); ii++ ) {
215 Real half_pi = numeric::NumericTraits<Real>::pi()/2.0;
217 anchor.resize( strands.size(), 0 );
221 Size const begin( strands[ st ]->begin() );
223 anchor[ st ] = begin;
225 Vector cacb = bb_pos.CB( begin ) - bb_pos.CA( begin );
228 for(
Size jj=begin+1; jj<=
end; jj++ ) {
229 cacb = bb_pos.CB( jj ) - bb_pos.CA( jj );
231 if( max_angle < angle ) {
242 Size const begin( strands[ st ]->begin() );
245 Vector const cacb = bb_pos.CB( anchor[ st ] ) - bb_pos.CA( anchor[ st ] );
252 for(
Size jj=anchor[ st ]; jj>=begin+1; --jj ) {
253 Real dot = ( bb_pos.CB( jj ) - bb_pos.CA( jj ) ).dot( bb_pos.CB( jj-1 ) - bb_pos.CA( jj-1 ) );
261 for(
Size jj=anchor[ st ]; jj<=end-1; ++jj ) {
262 Real dot = ( bb_pos.CB( jj ) - bb_pos.CA( jj ) ).dot( bb_pos.CB( jj+1 ) - bb_pos.CA( jj+1 ) );
323 out <<
"#### Sheet Info " << std::endl;
326 if( sop->is_barrel() ){
327 out <<
"## Barrel " << i <<
":" << std::endl;
329 out <<
"## Sheet " << i <<
":" << std::endl;
353 runtime_assert( s <=
sheets_.size() );
362 if( s == 0 )
return 0;
380 for( VecSize::const_iterator it=
order.begin(), ite=
order.end(); it!=ite; ++it ){
391 sheets_[ i ]->calc_geometry( ssinfo );
404 for(
Size i=1; i<=ssinfo->strands().size(); i++ ) {
405 sheet_number_.insert( std::map< Size, Size >::value_type( i, 0 ) );
409 if( spairset_in->num_strands() < 2 ) {
426 for( StrandPairings::const_iterator iter = spairs.begin(); iter != spairs.end(); ++iter ) {
428 sheet_set.ds_union( sp.
s1(), sp.
s2() );
432 std::map< Size, VecSize > sset = sheet_set.sets();
433 std::map< Size, VecSize >::iterator it = sset.begin();
434 while( it != sset.end() ) {
439 VecSize list_strands = (*it).second;
440 if( list_strands.size() <= 1 ) {
445 for( VecSize::const_iterator itt = list_strands.begin(); itt != list_strands.end(); ++itt ) {
448 order_strands.push_back( s );
451 TR.Error <<
"Error, num of neighbor strands > 2 " << std::endl;
452 runtime_assert(
false );
457 order_strands.push_back( list_strands.front() );
459 runtime_assert( order_strands.size() == 2 );
460 sort ( order_strands.begin(), order_strands.end() );
461 order_strands.erase( order_strands.end() - 1 );
466 if( neighbor[1] < neighbor[2] ) {
467 order_strands.insert( order_strands.begin() + 1, neighbor[1] );
469 order_strands.insert( order_strands.begin() + 1, neighbor[2] );
472 order_strands.insert( order_strands.begin() + 1, neighbor[1] );
476 for(
Size i=2; i<= list_strands.size()-1; i++ ){
477 Size s1 = order_strands[ i ];
480 for(
Size j=1; j<=neighbor.size(); j++ ){
481 if( neighbor[ j ] != order_strands[ i-1 ] ){
482 order_strands.insert( order_strands.begin() + i, neighbor[j] );
489 orient_strands.push_back( 1 );
490 for(
Size i=1; i<=order_strands.size()-1; i++ ){
491 Size s1( order_strands[ i ] );
492 Size s2( order_strands[ i+1 ] );
495 if( spairop->orient() ==
'P' ){
496 orient_strands.push_back( orient_strands[ i ] );
498 orient_strands.push_back( orient_strands[ i ]*-1 );
502 SheetOP sop =
new Sheet( order_strands, orient_strands, ibarrel );