-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMSA.h
executable file
·81 lines (74 loc) · 3.06 KB
/
MSA.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
79
80
81
#ifndef _MSA_H
#define _MSA_H
#include "MSAGuideTree.h"
#include "SafeVector.h"
#include "MultiSequence.h"
#include "ScoreType.h"
#include "ProbabilisticModel.h"
#include "SparseMatrix.h"
#include <string>
using namespace std;
class MSAGuideTree;
struct TreeNode;
class MSA
{
public:
MSA(int argc, char* argv[]);
~MSA();
MSAGuideTree* getGuideTree()
{
return tree;
}
int * getSeqsWeights()
{
return seqsWeights;
}
private:
//print usage
void printUsage();
//do multiple sequence alignment
void doAlign();
//for sequence weights
void createSeqsWeights(int seqsNum);
void releaseSeqsWeights();
//weights of sequences
int * seqsWeights;
//guide tree
MSAGuideTree* tree;
//output file
string alignOutFileName;
std::ostream* alignOutFile;
private:
SafeVector<string> ParseParams(int argc, char *argv[]);
SafeVector<string> PostProbsParseParams(int argc, char **argv);
MultiSequence *doAlign(MultiSequence *sequence,
const ProbabilisticModel &model, int first_step, int second_step, int third_step);
void ReadParameters();
MultiSequence* ProcessTree(TreeNode *tree, MultiSequence *sequences,
const SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices,
const ProbabilisticModel &model);
MultiSequence *ComputeFinalAlignment(MSAGuideTree *tree,
MultiSequence *sequences,
const SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices,
const ProbabilisticModel &model,int first_step);
MultiSequence *AlignAlignments(MultiSequence *align1, MultiSequence *align2,
const SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices,
const ProbabilisticModel &model);
SafeVector<SafeVector<SparseMatrix *> > DoRelaxation(float* seqsWeights,
MultiSequence *sequences,
SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices);
SafeVector<SafeVector<SparseMatrix *> > DoRelaxation(MultiSequence *sequences,
SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices);
void Relax(float weight, SparseMatrix *matXZ, SparseMatrix *matZY,VF &posterior);//weight
void Relax1(float weight, SparseMatrix *matXZ, SparseMatrix *matZY,VF &posterior);//weight
void Relax(SparseMatrix *matXZ, SparseMatrix *matZY,VF &posterior);//unweight
void Relax1(SparseMatrix *matXZ, SparseMatrix *matZY,VF &posterior);//unweight
int DoIterativeRefinement(
const SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices,
const ProbabilisticModel &model, MultiSequence* &alignment);
void DoIterativeRefinementTreeNode(
const SafeVector<SafeVector<SparseMatrix *> > &sparseMatrices,
const ProbabilisticModel &model, MultiSequence* &alignment,
int nodeIndex);
};
#endif