Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
coord_util.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file src/protocols/comparative_modeling/coord_util.cc
11 /// @author James Thompson
12 
13 // AUTO-REMOVED #include <core/io/silent/SilentStruct.hh>
14 #include <core/pose/Pose.hh>
15 
19 
20 #include <ObjexxFCL/FArray2D.hh>
21 
22 #include <numeric/xyzVector.hh>
23 
24 #include <utility/vector1.hh>
25 
26 
27 namespace protocols {
28 namespace comparative_modeling {
29 
31  core::pose::Pose const & model,
32  core::pose::Pose const & native,
34  int & natoms,
35  ObjexxFCL::FArray2D< core::Real > & p1a,
36  ObjexxFCL::FArray2D< core::Real > & p2a,
37  std::string const & atom_name = "CA"
38 ) {
39  using core::Size;
40  using namespace core::id;
41  using namespace core::sequence;
42  SequenceMapping mapping( aln.sequence_mapping(1,2) );
43 
44  natoms = 0;
45  for ( Size ii = 1; ii <= model.total_residue(); ++ii ) {
46  if (!model.residue(ii).is_protein()) continue;
47  Size const native_ii( mapping[ii] );
48  bool skip(
49  native_ii == 0 ||
50  native_ii > native.total_residue()
51  );
52  if ( !skip ) ++natoms;
53  }
54  p1a.dimension(3,natoms);
55  p2a.dimension(3,natoms);
56 
57  Size n_gap(0);
58  for ( Size ii = 1; ii <= model.total_residue(); ++ii ) {
59  if (!model.residue(ii).is_protein()) continue;
60  Size const native_ii(mapping[ii]);
61  bool skip(
62  native_ii == 0 ||
63  native_ii > native.total_residue()
64  );
65  if ( skip ) {
66  n_gap++;
67  } else {
68  using core::Real;
69  numeric::xyzVector< Real > model_xyz ( model.residue(ii).xyz(atom_name) );
70  numeric::xyzVector< Real > native_xyz( native.residue(native_ii).xyz(atom_name) );
71  for ( Size jj = 1; jj <= 3; ++jj ) {
72  p1a(jj,ii - n_gap) = native_xyz[jj-1];
73  p2a(jj,ii - n_gap) = model_xyz [jj-1];
74  }
75  }
76  }
77 } // gather_coords
78 
79 }
80 }