17 #include <utility/exit.hh>
18 #include <boost/foreach.hpp>
19 #define foreach BOOST_FOREACH
21 #include <basic/Tracer.hh>
22 #include <utility/vector1.hh>
23 #include <utility/file/FileName.hh>
24 #include <utility/io/izstream.hh>
29 namespace protein_interface_design {
32 static basic::Tracer
TR(
"protocols.protein_interface_design.movers.SpliceSegment" );
34 using namespace core::sequence;
38 sequence_profile_.clear();
39 pdb_to_profile_map_.clear();
48 TR<<
"reading sequence profile from "<<file_name<<std::endl;
49 new_seqprof->read_from_file( fname );
50 sequence_profile_.insert( pair< string, SequenceProfileOP >( segment_name, new_seqprof ) );
55 return sequence_profile_[ segment_name ];
60 pdb_to_profile_map_.insert( pair< string, string >( pdb, profile_name ) );
66 return sequence_profile_[ pdb_to_profile_map_[ pdb_name ] ];
71 return sequence_profile_[ profile_name ];
80 for(
core::Size pos = 1; pos <= prof->size(); ++pos ){
81 current_profile_size++;
82 concatenated_profile->prof_row( prof->prof_row( pos ), current_profile_size );
85 TR<<
"concatenated "<<profiles.size()<<
" profiles with a total length of "<<concatenated_profile->size()<<std::endl;
86 return concatenated_profile;
92 utility::io::izstream data( file_name );
94 utility_exit_with_message(
"File not found " + file_name );
95 TR<<
"Loading pdb profile pairs from file "<<file_name<<std::endl;
97 getline( data, line );
98 if( line.length() > 2 )
99 utility_exit_with_message(
"pdb/profile file empty or corrupted "+file_name );
100 istringstream line_stream( line );
101 while( !line_stream.eof() ){
103 line_stream >> pdb >> profile;
104 pdb_to_profile_map_.insert( pair< string, string >( pdb, profile ) );