20 #include <ObjexxFCL/format.hh>
21 #include <ObjexxFCL/FArray1A.hh>
24 #include <utility/vector1.fwd.hh>
25 #include <utility/io/izstream.hh>
26 #include <utility/exit.hh>
27 #include <basic/Tracer.hh>
33 #include <utility/vector1.hh>
36 static basic::Tracer
tr(
"core.scoring.dssp");
43 using namespace basic;
44 using namespace ObjexxFCL;
50 orientation_ = data(3);
60 if ( orientation_ == PARALLEL ) {
61 if ( pleating_ == 1 ) {
63 }
else if ( pleating_ == 2 ) {
66 std::cout <<
"unrecognized pleating:" << fmt::SS( pleating_ ) << std::endl;
67 utility::exit( EXIT_FAILURE, __FILE__, __LINE__);
82 utility::io::izstream pairing_stream( pairing_file );
83 if ( !pairing_stream ) {
84 tr.Fatal <<
"can't open pairings file!!!" << pairing_file << std::endl;
85 pairing_stream.close();
86 utility::exit( EXIT_FAILURE, __FILE__, __LINE__);
89 pairing_stream.close();
95 while ( getline( pairing_stream, line ) ) {
96 std::istringstream line_stream( line );
99 line_stream >> a >> b >> o >> pleat;
100 if ( line_stream.fail() || o.size() != 1 ) {
101 std::cout <<
"[ERROR] unable to parse " << line << std::endl;
105 if ( o ==
"A" || o ==
"1" ) {
107 }
else if ( o ==
"P" || o ==
"2") {
109 }
else if ( o ==
"X" ) {
112 std::cout <<
"bad orientation: " << o << std::endl;
116 if ( pleat ==
"O" || pleat==
"1" ) {
118 }
else if ( pleat ==
"I" || pleat ==
"2" ) {
120 }
else if ( pleat ==
"X" ) {
123 std::cout <<
"bad pleating: " << pleat << std::endl;
126 if ( ( a < 1 || b < 1 ) || ( a ==
b ) || ( c != 1 && c != 2 && c != 0 ) ||
127 ( d != 1 && d != 2 && d != 0 ) ) {
128 std::cout <<
"bad pairing:" <<
129 fmt::SS( a ) << fmt::SS( b ) << fmt::SS( c ) << fmt::SS( d ) << std::endl;
130 utility::exit( EXIT_FAILURE, __FILE__, __LINE__);
135 pairings.push_back( p );
141 out << fmt::RJ(5, p.
Pos1() ) << fmt::RJ(5, p.
Pos2() ) <<
" "
148 for (PairingsList::const_iterator it= p.begin(),
149 eit = p.end(); it!=eit; ++it ) {
150 out << (*it) <<
"\n";
156 for ( PairingsList::const_iterator it = pairings.begin(), eit = pairings.end();
158 if ( it->Orientation() == 0 || it->Pleating() == 0 )
return false;