| Line | |
|---|
| 1 | #ifndef ClustSetMSA_h |
|---|
| 2 | #define ClustSetMSA_h |
|---|
| 3 | |
|---|
| 4 | class MSA; |
|---|
| 5 | class Clust; |
|---|
| 6 | |
|---|
| 7 | #include "clustset.h" |
|---|
| 8 | #include "msadist.h" |
|---|
| 9 | |
|---|
| 10 | // Distance matrix based set. |
|---|
| 11 | // Computes distances between leaves, never between |
|---|
| 12 | // joined clusters (leaves this to distance matrix method). |
|---|
| 13 | class ClustSetMSA : public ClustSet |
|---|
| 14 | { |
|---|
| 15 | public: |
|---|
| 16 | ClustSetMSA(const MSA &msa, MSADist &MD) : |
|---|
| 17 | m_ptrMSA(&msa), |
|---|
| 18 | m_ptrMSADist(&MD) |
|---|
| 19 | { |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | public: |
|---|
| 23 | virtual unsigned GetLeafCount() |
|---|
| 24 | { |
|---|
| 25 | return m_ptrMSA->GetSeqCount(); |
|---|
| 26 | } |
|---|
| 27 | virtual const char *GetLeafName(unsigned uNodeIndex) |
|---|
| 28 | { |
|---|
| 29 | return m_ptrMSA->GetSeqName(uNodeIndex); |
|---|
| 30 | } |
|---|
| 31 | virtual unsigned GetLeafId(unsigned uNodeIndex) |
|---|
| 32 | { |
|---|
| 33 | return m_ptrMSA->GetSeqId(uNodeIndex); |
|---|
| 34 | } |
|---|
| 35 | virtual void JoinNodes(const Clust &C, unsigned uLeftNodeIndex, |
|---|
| 36 | unsigned uRightNodeIndex, unsigned uJoinedNodeIndex, |
|---|
| 37 | double *ptrdLeftLength, double *ptrdRightLength) |
|---|
| 38 | { |
|---|
| 39 | Quit("ClustSetMSA::JoinNodes, should never be called"); |
|---|
| 40 | } |
|---|
| 41 | virtual double ComputeDist(const Clust &C, unsigned uNodeIndex1, |
|---|
| 42 | unsigned uNodeIndex2) |
|---|
| 43 | { |
|---|
| 44 | return m_ptrMSADist->ComputeDist(*m_ptrMSA, uNodeIndex1, uNodeIndex2); |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | public: |
|---|
| 48 | const MSA &GetMSA(); |
|---|
| 49 | |
|---|
| 50 | private: |
|---|
| 51 | const MSA *m_ptrMSA; |
|---|
| 52 | MSADist *m_ptrMSADist; |
|---|
| 53 | }; |
|---|
| 54 | |
|---|
| 55 | #endif // ClustSetMSA_h |
|---|
Note: See
TracBrowser
for help on using the repository browser.