34 #include <basic/Tracer.hh>
42 #include <utility/exit.hh>
43 #include <utility/string_util.hh>
44 #include <utility/tag/Tag.hh>
45 #include <utility/vector1.hh>
50 #include <utility/vector0.hh>
53 static basic::Tracer
TR(
"protocols.jd2.parser.FragmentReader" );
82 TR.Error <<
"No type option. " << std::endl;
83 runtime_assert(
false );
86 TR.Error <<
"Read type " <<
read_type_ <<
" is not registered " << std::endl;
87 runtime_assert(
false );
102 end_ = tag->getOption<
Size>(
"end", 0 );
113 String const blueprint( tag->getOption<
String>(
"blueprint",
"" ) );
114 if( blueprint !=
"" ){
118 bool use_sequence_bias( tag->getOption<
bool>(
"use_sequence_bias", 0 ) );
119 if( use_sequence_bias ) {
125 use_abego_ = tag->getOption<
bool>(
"use_abego", 0 );
129 ss_ = tag->getOption<
String>(
"ss",
"" );
133 runtime_assert( !
ss_.empty() );
136 aa_ = tag->getOption<
String>(
"aa",
"" );
139 runtime_assert(
ss_.length() == aa_.length() );
142 TR <<
"Since option begin is emptry, Fragment is defined from the first residue. " << std::endl;
148 runtime_assert( end_ == begin_ +
ss_.length() - 1 );
150 end_ = begin_ +
ss_.length() - 1;
152 TR <<
"Picking fragments from vall for poistions " << begin_ <<
"-" << end_
153 <<
" based on ss=" <<
ss_ <<
", aa=" << aa_ << std::endl;
162 TR <<
"Picking Fragments from " <<
filename_ <<
" for poistions " << begin_ <<
"-" << end_ << std::endl;
164 runtime_assert( begin_ <= end_ );
200 while( num++ <=
nfrags_ && silent_input->has_another_pose() ){
201 silent_input->fill_pose( pose_in, *residue_set );
235 if ( cf.get() != NULL && of.get() == NULL ) {
236 for( FrameIterator it=cf->begin(),
end( cf->end() ); it!=
end; ++it ) {
237 frames.push_back(
new Frame( **it ) );
239 }
else if ( of.get() != NULL && cf.get() == NULL ) {
240 for( FrameIterator it=of->begin(),
end( of->end() ); it!=
end; ++it ) {
241 frames.push_back(
new Frame( **it ) );
244 TR <<
"[ ERROR ] FragmentIO returned not proper fragset. See the code." << std::endl;
245 runtime_assert(
false );
247 fragset->add( frames );
260 for (
Size j = 0, je = length; j < je; ++j ) {
262 TR <<
"picking " <<
nfrags_ <<
" " <<
frag_size_ <<
"-mers for position " << ( begin_ + j ) << std::endl;
265 ss_sub.append(
frag_size_ - ss_sub.length(),
'D' );
270 if ( !
aa_.empty() ) {
273 aa_sub.append(
frag_size_ - aa_sub.length(),
'.' );
282 runtime_assert(
ss_.length() ==
blueprint_->abego().size() );
287 abego_sub[ pos ] =
"X";
298 frame->add_fragment(
pick_fragments( ss_sub, aa_sub, abego_sub,
nfrags_,
true, IndependentBBTorsionSRFD() ) );
310 frames.push_back( frame );
312 fragset->add( frames );