31 #include <boost/assign.hpp>
32 #include <boost/assign/std/vector.hpp>
33 #include <boost/unordered/unordered_map.hpp>
52 #include <basic/prof.hh>
53 #include <basic/Tracer.hh>
54 #include <basic/options/option.hh>
55 #include <basic/options/keys/in.OptionKeys.gen.hh>
56 #include <numeric/util.hh>
57 #include <numeric/xyzVector.hh>
58 #include <numeric/model_quality/maxsub.hh>
59 #include <numeric/model_quality/rms.hh>
60 #include <ObjexxFCL/FArray1D.hh>
61 #include <ObjexxFCL/FArray2D.hh>
62 #include <utility/exit.hh>
64 #include <utility/vector1.hh>
69 using namespace ObjexxFCL;
74 static basic::Tracer
tr(
"core.scoring.rms_util");
78 const std::map<core::Size, core::Size>& residues) {
86 static map<char, string> gdtsc_atom = boost::assign::map_list_of
109 tr.Warning <<
"Reference and model must be fullatom for gdtsc()" << std::endl;
114 int expected_num_atoms = residues.size();
115 int actual_num_atoms = 0;
116 FArray2D<Real> coords_ref(3, expected_num_atoms);
117 FArray2D<Real> coords_mod(3, expected_num_atoms);
120 for (map<Size, Size>::const_iterator i = residues.begin(); i != residues.end(); ++i, ++count) {
121 const Size ref_idx = i->first;
122 const Size mod_idx = i->second;
126 if (ref_residue != mod_residue) {
127 tr.Warning <<
"Reference and model must have identical sequences for gdtha-- "
128 << ref_residue <<
" != " << mod_residue << std::endl;
133 const NamedAtomID ref_atom(gdtsc_atom[ref_residue], ref_idx);
135 coords_ref(1, count) = xyz_ref.x();
136 coords_ref(2, count) = xyz_ref.y();
137 coords_ref(3, count) = xyz_ref.z();
139 const NamedAtomID mod_atom(gdtsc_atom[mod_residue], mod_idx);
141 coords_mod(1, count) = xyz_mod.x();
142 coords_mod(2, count) = xyz_mod.y();
143 coords_mod(3, count) = xyz_mod.z();
150 for (
Size i = 1; i <= num_dists; ++i) {
151 Real dist_threshold = 0.5 * i;
154 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
155 numeric::model_quality::maxsub(
156 actual_num_atoms, coords_ref, coords_mod,
157 mxrms, mxpsi, nali, mxzscore, mxeval, mxscore,
158 dist_threshold, dist_threshold);
160 Real pct_residues =
static_cast<Real>(nali) / static_cast<Real>(actual_num_atoms);
164 return sum / num_dists;
169 const std::map<core::Size, core::Size>& residues) {
176 int expected_num_atoms = residues.size();
177 int actual_num_atoms = 0;
178 FArray2D<Real> coords_ref(3, expected_num_atoms);
179 FArray2D<Real> coords_mod(3, expected_num_atoms);
182 for (std::map<Size, Size>::const_iterator i = residues.begin(); i != residues.end(); ++i, ++count) {
183 const Size ref_idx = i->first;
184 const Size mod_idx = i->second;
188 if (ref_residue != mod_residue) {
189 tr.Warning <<
"Reference and model must have identical sequences for gdtha-- "
190 << ref_residue <<
" != " << mod_residue << std::endl;
195 const NamedAtomID ref_atom(
"CA", ref_idx);
197 coords_ref(1, count) = xyz_ref.x();
198 coords_ref(2, count) = xyz_ref.y();
199 coords_ref(3, count) = xyz_ref.z();
201 const NamedAtomID mod_atom(
"CA", mod_idx);
203 coords_mod(1, count) = xyz_mod.x();
204 coords_mod(2, count) = xyz_mod.y();
205 coords_mod(3, count) = xyz_mod.z();
209 Real dists[] = {0.5, 1.0, 2.0, 4.0};
213 for (
Size i = 0; i < num_dists; ++i) {
214 Real dist_threshold = dists[i];
217 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
218 numeric::model_quality::maxsub(
219 actual_num_atoms, coords_ref, coords_mod,
220 mxrms, mxpsi, nali, mxzscore, mxeval, mxscore,
221 dist_threshold, dist_threshold);
223 Real pct_residues =
static_cast<Real>(nali) / static_cast<Real>(actual_num_atoms);
227 return sum / num_dists;
231 residue_selection.clear();
233 for(
Size ir = 1; ir <= nres; ++ir ) {
234 bool exclude_residue =
false;
235 for(
Size ex = 1; ex <= exclude_list.size(); ex ++ ){
236 if(
int(exclude_list[ex]) ==
int(ir) ) {
237 exclude_residue =
true;
242 if ( !exclude_residue ) {
243 residue_selection.push_back( ir );
255 using namespace basic::options;
256 using namespace basic::options::OptionKeys;
258 if ( option[ in::file::native_exclude_res ].user() ) {
269 using namespace basic::options;
270 using namespace basic::options::OptionKeys;
272 if ( option[ in::file::native_exclude_res ].user() ) {
290 using namespace core;
291 using namespace core::chemical;
292 using namespace core::conformation;
294 if( rsd1.
type().
name3() != rsd2.
type().
name3() ) utility_exit_with_message(
"Residue type name3 mismatch");
295 if( rsd1.
nheavyatoms() != rsd2.
nheavyatoms() ) utility_exit_with_message(
"Residue number-of-heavy-atoms mismatch");
303 while( old2new.size() > 0 ) {
305 if( counter%10000 == 0 )
tr.Info << counter <<
" so far..." << std::endl;
321 p1_coords.push_back( rsd1.
xyz( j ) );
322 p2_coords.push_back( rsd2.
xyz( old2new[j] ) );
325 runtime_assert( p1_coords.size() == p2_coords.size() );
326 int const natoms = p1_coords.size();
327 ObjexxFCL::FArray2D< core::Real > p1a( 3, natoms );
328 ObjexxFCL::FArray2D< core::Real > p2a( 3, natoms );
329 for (
int j = 0; j < natoms; ++j ) {
330 for (
int k = 0; k < 3; ++k ) {
331 p1a(k+1,j+1) = p1_coords[j][k];
332 p2a(k+1,j+1) = p2_coords[j][k];
335 core::Real const curr_rms = numeric::model_quality::rms_wrapper( natoms, p1a, p2a );
337 if( curr_rms < best_rms ) {
349 sum2 += diff.length_squared();
353 core::Real const curr_rms = std::sqrt(sum2 / natoms);
355 if( curr_rms < best_rms ) {
362 tr.Debug << counter <<
" automorphisms from iterator; best rms is " << best_rms << std::endl;
495 bool ResRangePredicate::operator()(
500 if ( resno < start_ || resno > end_ ) {
return false; }
501 else {
return (*pred_)(pose1, pose2, resno, atomno); }
504 bool SelectedResPredicate::operator()(
509 if ( std::find( selected_.begin(), selected_.end(), resno ) == selected_.end() ) {
return false; }
510 else {
return (*pred_)(pose1, pose2, resno, atomno); }
513 bool ExcludedResPredicate::operator()(
518 if ( std::find( excluded_.begin(), excluded_.end(), resno ) != excluded_.end() ) {
return false; }
519 else {
return (*pred_)(pose1, pose2, resno, atomno); }
530 using namespace core;
533 return CA_rmsd( pose1, pose2, start, end );
543 PROF_START( basic::CA_RMSD_EVALUATION );
544 using namespace core;
547 FArray2D< core::Real > p1a;
548 FArray2D< core::Real > p2a;
552 if ( (
int) (end - start + 1) > natoms ) {
tr.Warning <<
"WARNING: In CA_rmsd, residue range " << start <<
" to " << end
553 <<
" requested but only " << natoms <<
" protein CA atoms found." << std::endl; }
555 Real rms = numeric::model_quality::rms_wrapper( natoms, p1a, p2a );
556 if(
rms < 0.00001)
rms = 0.0;
557 PROF_STOP( basic::CA_RMSD_EVALUATION );
565 FArray2D<core::Real>* coords) {
572 coords->dimension(3, residues.size());
574 for (
Size i = 1; i <= residues.size(); ++i) {
575 const NamedAtomID id(
"CA", residues[i]);
577 (*coords)(1, i) = xyz.x();
578 (*coords)(2, i) = xyz.y();
579 (*coords)(3, i) = xyz.z();
585 const std::map<core::Size, core::Size>& residues) {
592 for (std::map<Size, Size>::const_iterator i = residues.begin(); i != residues.end(); ++i) {
593 Size res_1 = i->first;
594 Size res_2 = i->second;
595 residues_1.push_back(res_1);
596 residues_2.push_back(res_2);
604 return numeric::model_quality::rms_wrapper(residues.size(), p1, p2);
609 const std::map<core::Size, core::Size>& residues) {
616 for (std::map<Size, Size>::const_iterator i = residues.begin(); i != residues.end(); ++i) {
617 Size res_1 = i->first;
618 Size res_2 = i->second;
619 residues_1.push_back(res_1);
620 residues_2.push_back(res_2);
628 Real m_1_1, m_2_2, m_3_3, m_4_3, m_7_4;
629 return xyz_gdtmm(p1, p2, m_1_1, m_2_2, m_3_3, m_4_3, m_7_4);
640 PROF_START( basic::CA_RMSD_EVALUATION );
641 using namespace core;
644 FArray2D< core::Real > p1a;
645 FArray2D< core::Real > p2a;
650 Real rms = numeric::model_quality::rms_wrapper( natoms, p1a, p2a );
651 if(
rms < 0.00001)
rms = 0.0;
652 PROF_STOP( basic::CA_RMSD_EVALUATION );
662 using namespace core;
666 return bb_rmsd( pose1, pose2, start, end, blank );
677 using namespace core;
688 using namespace core;
703 using namespace core;
712 std::list< Size > residue_selection
714 PROF_START( basic::CA_RMSD_EVALUATION );
715 using namespace core;
718 FArray2D< core::Real > p1a;
719 FArray2D< core::Real > p2a;
723 if ( (
int) residue_selection.size() > natoms ) {
tr.Warning <<
"WARNING: In CA_rmsd " << residue_selection.size()
724 <<
" residues selected but only " << natoms <<
" protein CA atoms found." << std::endl; }
727 PROF_STOP( basic::CA_RMSD_EVALUATION );
728 return numeric::model_quality::rms_wrapper( natoms, p1a, p2a );
737 using namespace core;
746 std::list< Size > residue_selection
749 using namespace core;
760 using namespace core;
778 FArray2D< double > p1a( 3, nres1 );
779 FArray2D< double > p2a( 3, nres1 );
783 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
785 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rms );
794 std::list< Size > residue_selection,
798 using namespace core;
801 FArray2D< core::Real > p1a;
802 FArray2D< core::Real > p2a;
806 if ( (
int) residue_selection.size() > natoms ) {
tr.Warning <<
"WARNING: In CA_maxsub " << residue_selection.size()
807 <<
" residues selected but only " << natoms <<
" protein CA atoms found." << std::endl; }
809 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
811 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rms );
817 FArray2D< core::Real > p1a,
818 FArray2D< core::Real > p2a,
821 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
823 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore );
838 FArray2D< double > p1a( 3, nres1 );
839 FArray2D< double > p2a( 3, nres1 );
843 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
845 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore );
854 std::list< Size > residue_selection,
867 if ( (
int) residue_selection.size() > natoms ) {
tr.Warning <<
"WARNING: In CA_gdtmm " << residue_selection.size()
868 <<
" residues selected but only " << natoms <<
" protein CA atoms found." << std::endl; }
895 FArray2D< core::Real > p1a,
896 FArray2D< core::Real > p2a
905 FArray2D< core::Real > p1a,
906 FArray2D< core::Real > p2a,
913 int natoms = p1a.size2();
914 runtime_assert( (p1a.size() == p2a.size()) && (p1a.size2() == p2a.size2()) );
915 double mxrms, mxpsi, mxzscore, mxscore, mxeval;
921 tr.Trace <<
"call maxsub with rmstol " << rmstol <<
" and disttol " << disttol << std::endl;
922 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rmstol, disttol );
927 tr.Trace <<
"call maxsub with rmstol " << rmstol <<
" and disttol " << disttol << std::endl;
928 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rmstol, disttol );
933 tr.Trace <<
"call maxsub with rmstol " << rmstol <<
" and disttol " << disttol << std::endl;
934 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rmstol, disttol );
939 tr.Trace <<
"call maxsub with rmstol " << rmstol <<
" and disttol " << disttol << std::endl;
940 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rmstol, disttol );
945 tr.Trace <<
"call maxsub with rmstol " << rmstol <<
" and disttol " << disttol << std::endl;
946 numeric::model_quality::maxsub( natoms, p1a, p2a, mxrms, mxpsi, nali, mxzscore, mxeval, mxscore, rmstol, disttol );
949 return (m_1_1 + m_2_2 + m_3_3 + m_4_3 + m_7_4 )/5.0;
958 return CA_gdtmm( pose1, pose2, m_1_1, m_2_2, m_3_3, m_4_3, m_7_4 );
965 std::list< Size> residue_selection
968 return CA_gdtmm( pose1, pose2, residue_selection, m_1_1, m_2_2, m_3_3, m_4_3, m_7_4 );
1007 using namespace numeric::model_quality;
1017 FArray1D_double wt(natoms);
1023 Vector const zero_vector(0.0);
1027 AtomID
const & aid( atom_map[
id::AtomID( j,i) ] );
1028 Vector const & x1( aid.valid() ? ref_pose.
xyz( aid ) : zero_vector );
1030 wt( atomno ) = ( aid.valid() ? 1.0 : 0.0 );
1031 if ( aid.valid() ) ++nsup;
1032 for (
Size k=1; k<= 3; ++k ) {
1033 xx1(k,atomno) = x1(k);
1034 xx2(k,atomno) = x2(k);
1038 runtime_assert( atomno == natoms );
1042 FArray1D_double COM(3);
1043 COMAS(xx1,wt,natoms,COM(1),COM(2),COM(3));
1047 rmsfitca2(natoms,xx1,xx2,wt,nsup,
rms);
1050 double tmp1,tmp2,tmp3;
1051 COMAS(xx1,wt,natoms,tmp1,tmp2,tmp3);
1054 runtime_assert( std::abs(tmp1) + std::abs(tmp2) + std::abs(tmp3) < 1e-3 );
1063 for (
Size k=1; k<= 3; ++k ) x2(k) = xx2(k,atomno) + COM(k);
1067 runtime_assert( atomno == natoms );
1070 return ( static_cast < Real > (
rms ) );
1085 if ( ! mod_pose.
residue(ii).
has(
"CA") )
continue;
1086 if ( ! ref_pose.
residue(ii).
has(
"CA") )
continue;
1090 atom_map.set( id1, id2 );
1102 using namespace core;
1103 using namespace conformation::symmetry;
1108 dynamic_cast<SymmetricConformation const & > ( pose.
conformation()) );
1112 int const nres_monomer ( symm_info->num_independent_residues() );
1113 int const N ( symm_info->subunits() );
1114 int const nres ( symm_info->num_total_residues_without_pseudo() );
1115 FArray2D< core::Real > p1a_shuffle( 3, nres );
1121 FArray2D< core::Real > p1a;
1122 FArray2D< core::Real > p2a;
1124 if (natoms%nres_monomer != 0 ) {
1125 tr.Warning <<
"CA atoms in fill_rmsd " << natoms <<
"is not a multiple of number of residues per subunit " << nres_monomer << std::endl;
1129 std::vector< std::vector<int> > shuffle_map;
1131 for (
int j=1; j <
int (shuffle_map.size()); j++ ){
1132 for (
int i=0; i <
N; ++i ) {
1133 int const begin ( shuffle_map.at(j).at(i)*nres_monomer*3);
1134 for (
int k = 0; k < nres_monomer*3; ++k ) {
1135 int const begin_shuffled (i*nres_monomer*3);
1136 p1a_shuffle[begin_shuffled+k] = p1a[begin+k];
1139 Real rms_shuffle = numeric::model_quality::rms_wrapper( natoms, p1a_shuffle, p2a );
1140 if ( rms_shuffle <
rms ) {
1145 if(
rms < 0.00001)
rms = 0.0;
1154 std::vector<int> sequence,
1156 std::vector< std::vector<int> > & map
1159 if (
int(sequence.size()) == N ){
1160 map.push_back(sequence);
1163 for (
int i=0; i<
N; i++) {
1165 for (
int j=0; j <
int(sequence.size()); j++) {
1166 if (sequence.at(j) == i )
1170 std::vector<int> sequence_tmp (sequence);
1171 sequence_tmp.push_back(i);
1183 std::map< core::id::AtomID, core::id::AtomID > atom_id_map
1187 for (
Size n = 1; n <= mod_pose.
total_residue(); n++ ) calc_rms_res.push_back( n );
1198 std::map< core::id::AtomID, core::id::AtomID > atom_id_map,
1203 for (
Size n = 1; n <= calc_rms_res.size(); n++ ) is_calc_rms[ calc_rms_res[ n ] ] =
true;
1207 for ( std::map< core::id::AtomID, core::id::AtomID >::const_iterator iter = atom_id_map.begin();
1208 iter != atom_id_map.end(); iter++ ) {
1210 assert ( mod_pose.
residue( (iter->first).rsd() ).atom_name( (iter->first).atomno() ) ==
1211 ref_pose.
residue( (iter->second).rsd() ).atom_name( (iter->second).atomno() ) );
1213 if ( !is_calc_rms[ (iter->first).rsd() ] )
continue;
1214 if ( !is_calc_rms[ (iter->second).rsd() ] )
continue;
1216 Vector const & p1( mod_pose.
xyz( iter->first ));
1217 Vector const & p2( ref_pose.
xyz( iter->second ));
1218 p1_coords.push_back( p1 );
1219 p2_coords.push_back( p2 );
1221 return numeric::model_quality::calc_rms( p1_coords, p2_coords );
1229 std::map< core::id::AtomID, core::id::AtomID > atom_id_map
1234 for ( std::map< core::id::AtomID, core::id::AtomID >::const_iterator iter = atom_id_map.begin();
1235 iter != atom_id_map.end(); iter++ ) {
1237 assert ( mod_pose.
residue( (iter->first).rsd() ).atom_name( (iter->first).atomno() ) ==
1238 ref_pose.
residue( (iter->second).rsd() ).atom_name( (iter->second).atomno() ) );
1240 Vector const & p1( mod_pose.
xyz( iter->first ));
1241 Vector const & p2( ref_pose.
xyz( iter->second ));
1242 p1_coords.push_back( p1 );
1243 p2_coords.push_back( p2 );
1245 return numeric::model_quality::calc_rms( p1_coords, p2_coords );
1252 std::map< core::id::AtomID, core::id::AtomID > atom_id_map ){
1255 for (
Size n = 1; n <= mod_pose.
total_residue(); n++ ) calc_rms_res.push_back( n );
1264 std::map< core::id::AtomID, core::id::AtomID > atom_id_map,
1269 for (
Size n = 1; n <= calc_rms_res.size(); n++ ) is_calc_rms[ calc_rms_res[ n ] ] =
true;
1273 for ( std::map< core::id::AtomID, core::id::AtomID >::const_iterator iter = atom_id_map.begin();
1274 iter != atom_id_map.end(); iter++ ) {
1276 assert ( mod_pose.
residue( (iter->first).rsd() ).atom_name( (iter->first).atomno() ) ==
1277 ref_pose.
residue( (iter->second).rsd() ).atom_name( (iter->second).atomno() ) );
1279 if ( !is_calc_rms[ (iter->first).rsd() ] )
continue;
1280 if ( !is_calc_rms[ (iter->second).rsd() ] )
continue;
1282 Vector const & p1( mod_pose.
xyz( iter->first ));
1283 Vector const & p2( ref_pose.
xyz( iter->second ));
1285 sum += (p1 - p2).length_squared();
1288 return std::sqrt( sum / natoms );
1297 std::map< core::id::AtomID, core::id::AtomID > atom_id_map;
1305 using namespace core::id;
1306 using namespace core::conformation;
1308 atom_id_map.clear();
1317 if ( !rsd2.
has( name ) )
continue;
1324 atom_id_map[ AtomID( j, i ) ] = AtomID( j2, i ) ;
1333 runtime_assert( res1->name3() == res2->name3() );
1334 std::vector< core::Size > compare_atoms;
1337 if( fxnal_group_only ) {
1339 if( name1 ==
"GLY" )
1340 compare_atoms.push_back( res1->atom_index(
"CA"));
1341 if( name1 ==
"ALA" )
1342 compare_atoms.push_back( res1->atom_index(
"CB"));
1343 if( name1 ==
"SER" )
1344 compare_atoms.push_back( res1->atom_index(
"OG"));
1345 if( name1 ==
"THR" )
1346 compare_atoms.push_back( res1->atom_index(
"OG1"));
1347 if( name1 ==
"CYS" )
1348 compare_atoms.push_back( res1->atom_index(
"SG"));
1349 if( name1 ==
"VAL" ) {
1350 compare_atoms.push_back( res1->atom_index(
"CG1"));
1351 compare_atoms.push_back( res1->atom_index(
"CG2"));
1353 if( name1 ==
"LEU" ) {
1354 compare_atoms.push_back( res1->atom_index(
"CD1"));
1355 compare_atoms.push_back( res1->atom_index(
"CD2"));
1357 if( name1 ==
"ILE" ) {
1358 compare_atoms.push_back( res1->atom_index(
"CD1"));
1359 compare_atoms.push_back( res1->atom_index(
"CG2"));
1361 if( name1 ==
"MET" ) {
1362 compare_atoms.push_back( res1->atom_index(
"CE"));
1363 compare_atoms.push_back( res1->atom_index(
"SD"));
1365 if( name1 ==
"PRO" )
1366 compare_atoms.push_back( res1->atom_index(
"CG"));
1367 if( name1 ==
"PHE" ) {
1368 compare_atoms.push_back( res1->atom_index(
"CZ"));
1369 compare_atoms.push_back( res1->atom_index(
"CE1"));
1370 compare_atoms.push_back( res1->atom_index(
"CE2"));
1372 if( name1 ==
"TYR" )
1373 compare_atoms.push_back( res1->atom_index(
"OH"));
1374 if( name1 ==
"TRP" )
1375 compare_atoms.push_back( res1->atom_index(
"NE1"));
1376 if( name1 ==
"ASP" ) {
1377 compare_atoms.push_back( res1->atom_index(
"OD1"));
1378 compare_atoms.push_back( res1->atom_index(
"OD2"));
1380 if( name1 ==
"GLU" ) {
1381 compare_atoms.push_back( res1->atom_index(
"OE1"));
1382 compare_atoms.push_back( res1->atom_index(
"OE2"));
1384 if( name1 ==
"ASN" ) {
1385 compare_atoms.push_back( res1->atom_index(
"OD1"));
1386 compare_atoms.push_back( res1->atom_index(
"ND2"));
1388 if( name1 ==
"GLN" ) {
1389 compare_atoms.push_back( res1->atom_index(
"OE1"));
1390 compare_atoms.push_back( res1->atom_index(
"NE2"));
1392 if( name1 ==
"HIS" ) {
1393 compare_atoms.push_back( res1->atom_index(
"ND1"));
1394 compare_atoms.push_back( res1->atom_index(
"NE2"));
1396 if( name1 ==
"LYS" )
1397 compare_atoms.push_back( res1->atom_index(
"NZ"));
1398 if( name1 ==
"ARG" ) {
1399 compare_atoms.push_back( res1->atom_index(
"NH1"));
1400 compare_atoms.push_back( res1->atom_index(
"NH2"));
1410 if( !res1->atom_type(j).is_heavyatom() )
continue;
1411 compare_atoms.push_back( j );
1416 for ( std::vector< core::Size >::const_iterator it = compare_atoms.begin(); it != compare_atoms.end(); ++it ) {
1418 core::Vector const diff = res1->xyz(atomno) - res2->xyz(atomno);
1419 sum2 += diff.length_squared();
1422 return std::sqrt(sum2 / compare_atoms.size() );
1430 protein_backbone_heavy_atoms.push_back(
" CA " );
1438 std::map< core::id::AtomID, core::id::AtomID > & atom_id_map ){
1441 protein_backbone_heavy_atoms.push_back(
" N ");
1442 protein_backbone_heavy_atoms.push_back(
" CA ");
1443 protein_backbone_heavy_atoms.push_back(
" C ");
1444 protein_backbone_heavy_atoms.push_back(
" O ");
1452 std::map< core::id::AtomID, core::id::AtomID > & atom_id_map ){
1453 using namespace core::id;
1454 using namespace core::conformation;
1455 using namespace core::chemical;
1457 atom_id_map.clear();
1465 for (
Size n = 1; n <= atom_names_to_find.size(); n++ ) {
1466 std::string const & atom_name = atom_names_to_find[ n ];
1477 atom_id_map[ AtomID( j1, i ) ] = AtomID( j2, i ) ;
1491 boost::unordered_map<core::Size, core::Real>* rmsds) {
1497 const FoldTree& tree = model.
fold_tree();
1498 for (
Size i = 1; i <= tree.nres(); ++i) {
1499 if (!tree.is_jump_point(i))
1506 (*rmsds)[i] =
CA_rmsd(reference, model, i - 1, i + 1);