Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NonlocalPair.hh
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 protocols/frag_picker/nonlocal/NonlocalPair.hh
11 /// @brief a nonlocal fragment pair.
12 /// @author David E. Kim (dekim@u.washington.edu)
13 
14 
15 #ifndef INCLUDED_protocols_frag_picker_nonlocal_NonlocalPair_hh
16 #define INCLUDED_protocols_frag_picker_nonlocal_NonlocalPair_hh
17 
18 // unit headers
20 
21 // package headers
26 
27 // type headers
28 #include <core/types.hh>
29 
30 // utility headers
31 #include <utility/pointer/owning_ptr.hh>
32 #include <utility/pointer/ReferenceCount.hh>
33 #include <utility/vector1.hh>
34 
35 // C++ headers
36 #include <iostream>
37 #include <map>
38 
39 namespace protocols {
40 namespace frag_picker {
41 namespace nonlocal {
42 
43 typedef std::pair<Size,Size> PosPair;
44 typedef std::pair<FragmentCandidateOP, scores::FragmentScoreMapOP> Candidate;
45 
46 using namespace core;
47 using namespace protocols::frag_picker;
48 
49 /// @brief represents a nonlocal fragment pair.
50 /// @detailed NonlocalPair contains query start positions for each fragment of pair i and j, and their corresponding fragment candidate
52 public:
53  NonlocalPair( Size query_pos_i, Size query_pos_j, Candidate candidate_i, Candidate candidate_j,
54  Size candidate_i_rank, Size candidate_j_rank, utility::vector1<ContactOP> & contacts ) {
55  query_position_i_ = query_pos_i;
56  query_position_j_ = query_pos_j;
57  candidate_i_ = candidate_i;
58  candidate_j_ = candidate_j;
59  candidate_i_rank_ = candidate_i_rank;
60  candidate_j_rank_ = candidate_j_rank;
61  contacts_ = contacts;
62  }
63 
65 
67  return contacts_;
68  }
69 
71  return candidate_i_;
72  }
73 
75  return candidate_j_;
76  }
77 
79  return candidate_i_rank_;
80  }
81 
83  return candidate_j_rank_;
84  }
85 
87  return query_position_i_;
88  }
89 
91  return query_position_j_;
92  }
93 
94  void print(std::ostream& out) {
95  out << "pair: " << query_position_i_ << " " << query_position_j_ << " " <<
96  candidate_i_.first->get_residue(1)->resi() << " " << candidate_j_.first->get_residue(1)->resi() <<
97  " " << candidate_i_rank_ << " " << candidate_j_rank_;
98  std::map<ContactType, Size> contact_type_cnt;
99  std::map<ContactType, Size>::iterator iter;
100  for (Size i=1; i<=contacts_.size(); ++i) contact_type_cnt[contacts_[i]->type()]++;
101  for ( iter = contact_type_cnt.begin(); iter != contact_type_cnt.end(); iter++ )
102  out << " " << contact_name(iter->first) << " " << iter->second;
103  out << std::endl;
104  candidate_i_.first->print_fragment(out);
105  out << std::endl;
106  candidate_j_.first->print_fragment(out);
107  out << std::endl;
108  }
109 
110 private:
118 };
119 
120 } // nonlocal
121 } // frag_picker
122 } // protocols
123 
124 
125 #endif /* INCLUDED_protocols_frag_picker_nonlocal_NonlocalPair_HH */