25 #include <basic/Tracer.hh>
28 #include <utility/exit.hh>
29 #include <utility/io/izstream.hh>
35 #include <utility/vector1.hh>
44 namespace picking_old {
50 static basic::Tracer
TR(
"core.fragment.picking_old.vall.vall_io" );
61 utility::io::izstream stream( filename );
63 utility_exit_with_message(
"can't open file: " + filename );
68 Size prior_library_size = library.
size();
71 TR <<
"Reading Vall library from " << filename <<
" ... " << std::endl;
73 time_t time_start = time( NULL );
81 if ( preallocate > 0 ) {
87 while ( getline( stream, line ) ) {
89 prior_id = current_residue.
id();
90 prior_resi = current_residue.
resi();
95 if ( ( current_residue.
resi() != prior_resi + 1 ) || ( current_residue.
id() != prior_id ) ) {
96 if ( section.
size() > 0 ) {
104 if ( n_lines % 100000 == 0 ) {
105 TR <<
" " << n_lines << std::endl;
109 if ( section.
size() > 0 ) {
114 if ( library.
size() <= ( preallocate / 2 ) ) {
120 time_t time_end = time( NULL );
122 TR <<
"... done. Read " << n_lines <<
" lines. Time elapsed: " << ( time_end - time_start ) <<
" seconds." << std::endl;
123 TR <<
"Prior library contained " << prior_library_size <<
" sections totaling " << prior_n_residues <<
" residues." << std::endl;
124 TR <<
"Added " << library.
size() <<
" sections to library totaling " << library.
n_residues() <<
" residues." << std::endl;