Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_treecluster.hpp
1/*
2##############################################################################
3# File: ms_treecluster.hpp #
4# Mascot Parser toolkit #
5# Utility functions for hierarchical clustering #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2012 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Source: parser/inc/ms_treecluster.hpp $
12# $Author: villek@matrixscience.com $
13# $Date: 2019-05-10 10:45:13 +0100 $
14# $Revision: 3770d1f7ee65bb20469e6c0ca909b2045b16fd74 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
15##############################################################################
16*/
17
18#ifndef MS_TREECLUSTER_HPP
19#define MS_TREECLUSTER_HPP
20
21
22#include <string>
23#include <vector>
24
25
26namespace matrix_science {
34
48 class MS_MASCOTRESFILE_API ms_treecluster: public ms_errors
49 {
50 public:
51
53
68 TCD_CITY_BLOCK
69 };
70
72 ms_treecluster(int rows, int columns);
73
75 ms_treecluster(const ms_treecluster& right);
76
79
80#ifndef SWIG
82 ms_treecluster& operator=(const ms_treecluster& right);
83#endif
85 void copyFrom(const ms_treecluster* right);
86
88 void defaultValues();
89
91 bool setRow(int row, std::vector< double > datarow, std::vector< int > maskrow);
92
94 bool cluster(TREE_CLUSTER_DISTANCE tcd,
96 const std::vector< double > & weight,
97 std::vector< int > &left,
98 std::vector< int > &right,
99 std::vector< double > &distance,
100 bool transpose = false );
101
102 private:
103 int numRows_;
104 int numCols_;
105 double ** data_;
106 int ** mask_;
107
108 void freeMemory();
109
110 }; // ms_treecluster // end of tools_group
112} // matrix_science
113
114#endif // MS_TREECLUSTER_HPP
115
116/*------------------------------- End of File -------------------------------*/
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
TREE_CLUSTER_METHOD
Flags for getTreeClusterNodes().
Definition: ms_mascotresults.hpp:128
This class is an interface to the cluster algorithm described at http://bonsai.hgc....
Definition: ms_treecluster.hpp:49
TREE_CLUSTER_DISTANCE
Flags for cluster().
Definition: ms_treecluster.hpp:60
@ TCD_EUCLIDEAN
'e': Euclidean distance
Definition: ms_treecluster.hpp:67
@ TCD_KENDALLS_TAU_CORRELATION
'k': Kendall tau rank correlation coefficient
Definition: ms_treecluster.hpp:66
@ TCD_ABS_UNCENTERED_CORRELATION
'x': Absolute uncentered Pearson correlation
Definition: ms_treecluster.hpp:64
@ TCD_UNCENTERED_CORRELATION
'u': Uncentered Pearson correlation (equivalent to the cosine of the angle between two data vectors)
Definition: ms_treecluster.hpp:63
@ TCD_SPEARMANS_RANK_CORRELATION
's': Spearman�s rank correlation;
Definition: ms_treecluster.hpp:65
@ TCD_CORRELATION
'c': Pearson correlation coefficient
Definition: ms_treecluster.hpp:61
@ TCD_ABS_CORRELATION
'a': Absolute value of the Pearson correlation coefficient
Definition: ms_treecluster.hpp:62