22 #include <utility/tag/Tag.hh>
29 #include <basic/Tracer.hh>
31 #include <utility/vector0.hh>
32 #include <utility/excn/Exceptions.hh>
33 #include <utility/vector1.hh>
36 namespace simple_filters {
38 static basic::Tracer
TR(
"protocols.filters.AtomicDistanceFilter" );
47 parent(
"AtomicDistance" ),
50 atomdesg1_( atom_desig1 ),
51 atomdesg2_( atom_desig2 ),
69 using namespace core::conformation;
80 TR <<
"WARNING! Residue "<<
residue1_<<
" of type "<<res1.type().name()<<
" does not have atom with name "<<
atomdesg1_<<std::endl;
81 return nearest_distance;
88 TR <<
"WARNING! Residue "<<
residue2_<<
" of type "<<res2.type().name()<<
" does not have atom with name "<<
atomdesg2_<<std::endl;
89 return nearest_distance;
94 bool found1(
false), found2(
false);
95 for (
core::Size ii(a1start); ii <= a1end; ++ii) {
98 for (
core::Size jj(a2start); jj <= a2end; ++jj) {
101 core::Real const dist( res1.atom(ii).xyz().distance( res2.atom(jj).xyz() ) );
102 if ( dist < nearest_distance ) {
103 nearest_distance = dist;
111 TR <<
"WARNING! Residue "<<
residue1_<<
" of type "<<res1.type().name()<<
" does not have atom with "<<(
astype1_?
"type ":
"name ")<<
atomdesg1_<<std::endl;
113 else if ( ! found2 ) {
114 TR <<
"WARNING! Residue "<<
residue2_<<
" of type "<<res2.type().name()<<
" does not have atom with "<<(
astype2_?
"type ":
"name ")<<
atomdesg2_<<std::endl;
116 return( nearest_distance );
146 TR <<
"Residue number "<<res1<<
" not found in pose."<<std::endl;
147 throw utility::excn::EXCN_RosettaScriptsOption(
"Residue number not found. Check xml file");
150 TR <<
"Residue number "<<res2<<
" not found in pose."<<std::endl;
151 throw utility::excn::EXCN_RosettaScriptsOption(
"Residue number not found. Check xml file");
154 if( tag->hasOption(
"atomtype1" ) ) {
155 if( tag->hasOption(
"atomname1" ) ) {
156 throw utility::excn::EXCN_RosettaScriptsOption(
"Can't set both atomname1 and atomtype1. Check xml file");
166 if( tag->hasOption(
"atomtype2" ) ) {
167 if( tag->hasOption(
"atomname2" ) ) {
168 throw utility::excn::EXCN_RosettaScriptsOption(
"Can't set both atomname2 and atomtype2. Check xml file");