OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
domain_find.hh
Go to the documentation of this file.
1 #ifndef OST_MOL_ALG_DOMAIN_FIND_HH
2 #define OST_MOL_ALG_DOMAIN_FIND_HH
3 
5 
6 #include "module_config.hh"
7 #include "contact_overlap.hh"
8 
9 namespace ost { namespace mol { namespace alg {
10 
11 struct Domain {
13  inter_s(0), inter_d(0), intra_s(0), intra_d(0), views(v) {}
14  Domain(): inter_s(0), inter_d(0), intra_s(0), intra_d(0) {}
15 
20 
21  bool operator==(const Domain& rhs) const {
22  return views==rhs.views && inter_s == rhs.inter_s &&
23  inter_d == rhs.inter_d && intra_s == rhs.intra_s &&
24  intra_d == rhs.intra_d;
25  }
27 };
28 
29 
30 class Domains;
31 
32 typedef boost::shared_ptr<Domains> DomainsPtr;
33 
35 public:
36 
37  static DomainsPtr FromAln(ost::seq::AlignmentHandle aln,
38  Real tolerance, Real radius, Real threshold,
39  int idx_a=-1, int idx_b=-1);
40 
41  static DomainsPtr FromCOM(const SimilarityMatrix& sim,
43  Real tolerance, int idx_a=-1, int idx_b=-1);
44 
45  // version of domain find which operates on two distances matrices
46  // we on purpose only return the connected components, since the
47  // distance matrices may not need to correpsond to an actual
48  // entity view.
49  static DomainsPtr FromDistMats(const DistanceMatrix& dmat_a,
50  const DistanceMatrix& dmat_b,
51  Real tolerance,
52  Real radius,
53  Real threshold,
54  int num_threads,
55  bool defined_only,
56  bool adj_map);
57  size_t GetNumFreeResidues() const { return num_free_; }
58 
59  Real GetFreeD() const { return free_d_; }
60  Real GetFreeS() const { return free_s_; }
61 
62  const std::vector<Domain>& GetDomains() const { return domains_; }
63  const std::vector<int>& GetComponents() const { return components_; }
64 
65  ost::img::ImageHandle GetAdjMap() const { return adj_map_; }
66 private:
67  Domains(): num_free_(0), free_s_(0), free_d_(0) {}
68  // holds the steps of the algorithm. mainly for debuggin purposes
69  ost::img::ImageHandle adj_map_;
70  int num_free_;
71  Real free_s_;
72  Real free_d_;
73  std::vector<Domain> domains_;
74  std::vector<int> components_;
75 };
76 
77 typedef std::map<int, Domain> DomainsMap;
78 
79 }}}
80 #endif
81 
#define DLLEXPORT_OST_MOL_ALG
float Real
Definition: base.hh:44
Real GetFreeS() const
Definition: domain_find.hh:60
size_t GetNumFreeResidues() const
Definition: domain_find.hh:57
Real GetFreeD() const
Definition: domain_find.hh:59
ost::mol::EntityViewList views
Definition: domain_find.hh:26
std::vector< EntityView > EntityViewList
Definition: view_type_fw.hh:49
std::map< int, Domain > DomainsMap
Definition: domain_find.hh:77
boost::shared_ptr< Domains > DomainsPtr
Definition: domain_find.hh:30
bool operator==(const Domain &rhs) const
Definition: domain_find.hh:21
ost::img::ImageHandle GetAdjMap() const
Definition: domain_find.hh:65
const std::vector< Domain > & GetDomains() const
Definition: domain_find.hh:62
Manage shared instances of images.
Domain(const ost::mol::EntityViewList &v)
Definition: domain_find.hh:12
representation of a multiple sequence alignemnt consisting of two or more sequences ...
const std::vector< int > & GetComponents() const
Definition: domain_find.hh:63