24 #include <utility/tag/Tag.hh>
31 #include <basic/Tracer.hh>
33 #include <utility/vector0.hh>
34 #include <utility/vector1.hh>
37 namespace simple_filters {
39 static basic::Tracer
TR(
"protocols.filters.AtomicContactFilter" );
44 protocols::moves::ResId( 0 )
50 protocols::moves::ResId( res2 ),
52 distance_( distance ),
53 sidechain_( sidechain ),
54 backbone_( backbone ),
72 using namespace core::conformation;
75 TR.Error<<
"ERROR: residue2 has not been defined"<<std::endl;
84 Atoms::const_iterator atom1_begin( res1.atom_begin() ), atom1_end( res1.atom_end() ), atom2_begin( res2.atom_begin() ), atom2_end( res2.atom_end() );
87 atom2_begin = res2.sidechainAtoms_begin();
90 atom1_end = res1.sidechainAtoms_begin();
91 atom2_end = res2.sidechainAtoms_begin();
94 atom1_end = res1.heavyAtoms_end();
95 atom2_end = res2.heavyAtoms_end();
97 for( Atoms::const_iterator atom1=atom1_begin; atom1!=atom1_end; ++atom1 ){
98 for( Atoms::const_iterator atom2=atom2_begin; atom2!=atom2_end; ++atom2 ){
99 core::Real const dist( atom1->xyz().distance( atom2->xyz() ) );
100 if( dist <= nearest_distance ) nearest_distance = dist;
104 return( nearest_distance );
117 out<<
"Minimal distance between residues "<<
residue1_<<
" and "<<
get_resid()<<
" is "<<dist<<std::endl;
127 if ( tag->hasOption(
"range1") ) {
129 std::istringstream range_str( tag->getOption<
std::string >(
"range1" ) );
131 range_str >> num1 >> num2;
132 if ( !range_str.good() )
TR <<
"cannot read parameter range1" << std::endl;
142 if( tag->hasOption(
"residue2" ) ){
149 TR<<
"AtomicContact: residue2 was not defined. A mover/filter will have to set it during the protocol\n";
151 sidechain_ = tag->getOption<
bool >(
"sidechain", 1 );
152 backbone_ = tag->getOption<
bool >(
"backbone", 0 );
153 protons_ = tag->getOption<
bool >(
"protons", 0 );