00001 #ifndef OST_MOL_ALG_DOMAIN_FIND_HH
00002 #define OST_MOL_ALG_DOMAIN_FIND_HH
00003
00004 #include <ost/seq/alignment_handle.hh>
00005
00006 #include "module_config.hh"
00007 #include "contact_overlap.hh"
00008
00009 namespace ost { namespace mol { namespace alg {
00010
00011 struct Domain {
00012 Domain(const ost::mol::EntityViewList& v):
00013 inter_s(0), inter_d(0), intra_s(0), intra_d(0), views(v) {}
00014 Domain(): inter_s(0), inter_d(0), intra_s(0), intra_d(0) {}
00015
00016 Real inter_s;
00017 Real inter_d;
00018 Real intra_s;
00019 Real intra_d;
00020
00021 bool operator==(const Domain& rhs) const {
00022 return views==rhs.views && inter_s == rhs.inter_s &&
00023 inter_d == rhs.inter_d && intra_s == rhs.intra_s &&
00024 intra_d == rhs.intra_d;
00025 }
00026 ost::mol::EntityViewList views;
00027 };
00028
00029
00030 class Domains;
00031
00032 typedef boost::shared_ptr<Domains> DomainsPtr;
00033
00034 class DLLEXPORT_OST_MOL_ALG Domains {
00035 public:
00036
00037 static DomainsPtr FromAln(ost::seq::AlignmentHandle aln,
00038 Real tolerance, Real radius, Real threshold,
00039 int idx_a=-1, int idx_b=-1);
00040
00041 static DomainsPtr FromCOM(const SimilarityMatrix& sim,
00042 ost::seq::AlignmentHandle aln,
00043 Real tolerance, int idx_a=-1, int idx_b=-1);
00044
00045
00046
00047
00048
00049 static DomainsPtr FromDistMats(const DistanceMatrix& dmat_a,
00050 const DistanceMatrix& dmat_b,
00051 Real tolerance,
00052 Real radius,
00053 Real threshold,
00054 int num_threads,
00055 bool defined_only,
00056 bool adj_map);
00057 size_t GetNumFreeResidues() const { return num_free_; }
00058
00059 Real GetFreeD() const { return free_d_; }
00060 Real GetFreeS() const { return free_s_; }
00061
00062 const std::vector<Domain>& GetDomains() const { return domains_; }
00063 const std::vector<int>& GetComponents() const { return components_; }
00064
00065 ost::img::ImageHandle GetAdjMap() const { return adj_map_; }
00066 private:
00067 Domains(): num_free_(0), free_s_(0), free_d_(0) {}
00068
00069 ost::img::ImageHandle adj_map_;
00070 int num_free_;
00071 Real free_s_;
00072 Real free_d_;
00073 std::vector<Domain> domains_;
00074 std::vector<int> components_;
00075 };
00076
00077 typedef std::map<int, Domain> DomainsMap;
00078
00079 }}}
00080 #endif
00081