-
Notifications
You must be signed in to change notification settings - Fork 0
/
Analyzer.h
78 lines (60 loc) · 2.18 KB
/
Analyzer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef ANALYZER_H
#define ANALYZER_H
#include "CSVFile.h"
#include "Constraints.h"
#include <map>
#include <list>
#include "Tree.h"
struct NodePair{
int m_node1;
int m_alt1;
int m_node2;
int m_alt2;
};
struct TriangleCandidates {
int m_altParent;
int m_fragmentStatus;
// 0: not a fragment;
// 10: left child has been used in a path;
// 01: right child has been used in a path;
// 11: both left and right children have been used in a path;
// 2: fragment Node has been used in tree construction process;
std::list<NodePair> m_nodePairList;
};
class Analyzer
{
public:
Analyzer();
~Analyzer();
Tree m_tree;
void setRelatedClassPara(CSVFile *pCsvFile,Constraints* pConstraints);
void constructNodeMap();
void printTrianglesStatistics();
void printSameVAFGeneNameList();
void printTDS1();
void constructRandomTree();
protected:
private:
CSVFile* m_pCsvFile;
Constraints* m_pConstraints;
int m_ticker;
std::map<int, TriangleCandidates> m_nodeMap;
void eraseParentChildrenInMap(std::map<int, TriangleCandidates>* pNodeMap,
int const parentID,
int const leftChildID,
int const rightChildID);
void updateTDS1fromGeneFragment();
void updateTDS1fromGenePath();
//check whether Waiting Expand Nodes is Greater than unused gene fragment
bool areNecessaryFragmentsUsed(std::list<int>& heap, std::map<int, TriangleCandidates> & nodeMap);
double computeGeneTreeSpace();
double computeValueTreeSpace();
int getNumValuePair(std::list<NodePair>& nodePairList);
int findChildIDInPairList(const int childFreq, TriangleCandidates& triangleCandidates);
int findChildIDInUnspecificParentGroup(const int parentFreq, const int childFreq);
int matchChildIDinSpecificParentGroup(const int parentID, const int childFreq);
void deleteNochildIDinSelfParentGroup(const int childID, std::list<NodePair>& nodePairList);
void deleteTaggedChildIDinOtherParentGroup(const int parentID, const int childID);
void printPathVector(std::vector<int> const & pathVector);
};
#endif // ANALYZER_H