24 #include <basic/Tracer.hh>
26 #include <utility/string_util.hh>
27 #include <utility/tag/Tag.hh>
29 #include <utility/vector0.hh>
30 #include <utility/vector1.hh>
39 static basic::Tracer
TR(
"core.pack.task.operation.ResFilters");
48 sub_filters_(sub_filters)
57 TR.Debug <<
"ResFilterComposition without sub-filters defined: " << *tag << std::endl;
72 if ( res_filter_factory && res_filter_factory->has_type( type ) ) {
73 ResFilterOP filter = res_filter_factory->newResFilter( type );
74 filter->parse_tag( *subtag );
168 polar_(false), apolar_(false), aromatic_(false), charged_(false)
173 polar_(polar), apolar_(apolar), aromatic_(aromatic), charged_(charged)
180 runtime_assert( index > 0 && index <= pose.
total_residue() );
183 return (
polar_ && residue.is_polar()) ||
184 (
apolar_ && residue.is_apolar()) ||
191 if ( tag->hasOption(
"polar") )
polar_ = tag->getOption<
bool>(
"polar");
192 if ( tag->hasOption(
"apolar") )
apolar_ = tag->getOption<
bool>(
"apolar");
193 if ( tag->hasOption(
"aromatic") )
aromatic_ = tag->getOption<
bool>(
"aromatic");
194 if ( tag->hasOption(
"charged") )
charged_ = tag->getOption<
bool>(
"charged");
215 runtime_assert( index > 0 && index <= pose.
total_residue() );
242 return ( ! parent::operator()( pose, index ) );
273 runtime_assert( index > 0 && index <= pose.
total_residue() );
286 if ( tag->hasOption(
"name3") )
289 name3_set.insert(names.begin(), names.end());
308 return ( ! parent::operator()( pose, index ) );
340 runtime_assert( index > 0 && index <= pose.
total_residue() );
353 if ( tag->hasOption(
"indices") ) {
358 end( values.end() ); it !=
end; ++it ) {
359 std::istringstream ss( *it );
366 TR <<
"ResidueIndex with indices:";
390 return ( ! parent::operator()( pose, index ) );
422 runtime_assert( index > 0 && index <= pose.
total_residue() );
424 utility_exit_with_message(
"can't apply ResiduePDBIndexIs filter on pose without pdb info");
440 if ( tag->hasOption(
"indices") ) {
446 end( values.end() ); it !=
end; ++it ) {
449 if ( chainposstr.size() != 2 ) utility_exit_with_message(
"can't parse pdb index " + *it);
450 char chain( *chainposstr.front().begin() );
451 std::istringstream ss( chainposstr.back() );
458 TR <<
"ResiduePDBIndex with indices:";
461 TR <<
" " << it->chain_ <<
'.' << it->pos_;
482 return ( ! parent::operator()( pose, index ) );
505 runtime_assert( index > 0 && index <= pose.
total_residue() );
507 utility_exit_with_message(
"Can't apply ChainIs filter on pose without pdb info");
509 return( (pose.
pdb_info()->chain(index) ==
chain_) ?
true :
false );
521 chain_ = tag->getOption<
char>(
"chain",
'A');
535 return ( ! parent::operator()( pose, index ) );