modified: SpatialOmicsCoord.py
[GalaxyCodeBases.git] / BGI / SOAPsnp / MatrixManager.h
blob9c4ea32831f45cce80a70df86f0121cec811260e
1 /*
2 ******************************************************************************
3 *Copyright 2010
4 * BGI-SHENZHEN
5 *All Rights Reserved
6 *ATHUOR : Bill Tang
7 *CREATE DATE : 2010-8-9
8 *CLASS NAME: FileListManager
9 *FUNCTION : a class that can control Prob_matrix vector. support add, change, get
10 * Matrix ect functions.
11 *FILE NAME : MatrixManager.h
12 *UPDATE DATE : 2010-8-25
13 *UPDATE BY : Bill Tang
14 *UPDATE: 2010-11-2 change the interface which is related to soap file.
15 *UPDATA BY :BIll Tang
16 *******************************************************************************
19 #pragma once
20 #include <fstream>
21 #include <vector>
22 #include "soap_snp.h"
24 #define INDEX_OVER_FLOW NULL
25 #define CREATE_MAT_FAILED -1
27 using namespace std;
28 class MatrixManager
30 public:
31 MatrixManager(void);
32 virtual ~MatrixManager(void);
33 private:
34 // a Prob_matrix vectior point
35 vector<Prob_matrix*> m_mat_vec;
36 public:
37 // add Matrix to the vector
38 virtual int addMatrix(SamCtrl &alignment, Parameter* para, Genome* genome, fstream *outFile, int index);
39 // add a matrix from the prior matrixfile.
40 virtual int addMatrix(igzstream &alignment, Parameter* para, Genome* genome, fstream *outFile, int index);
41 // change the Prob_matrix with new soap_vec
42 virtual int changeMatrix(vector<Soap_format>& soap_vec, Parameter* para, Genome* genome, int index);
43 // get a Prob_matrix point that point to the m_mat_vec[index]
44 virtual Prob_matrix* getMatrix(int index);
45 // add a matrix from the prior matrixfile.
46 virtual int addMatrix(std::fstream& matrix_file, Parameter *para);
47 // set the m_mat_vec's size
48 virtual void setMatrixNum(const int number);
52 void *_matrixManager_addMatrix(void * __args);
54 /**
55 * DATE: 2010-10-12
56 * FUNCTION: a parameter structure that about matrix.
57 * PARAMETER:
58 * RETURN:
60 typedef struct _matrix_args
62 MatrixManager * matrixManager;
63 //FileListManager * fileListManager;
64 Parameter * para;
65 Genome* genome;
66 igzstream *soap_alignment;
67 std::fstream *outFile;
68 SamCtrl *sam_alignment;
69 int index;
71 /**
72 * DATE: 2010-10-12
73 * FUNCTION: initialize the struct.
74 * PARAMETER:
75 * RETURN:
77 inline _matrix_args(MatrixManager * a, Parameter * b, Genome* c,
78 igzstream * d, std::fstream * e, SamCtrl * f, int g)
80 matrixManager = a;
81 para = b;
82 genome = c;
83 soap_alignment = d;
84 outFile = e;
85 sam_alignment = f;
86 index = g;
89 /**
90 * DATE: 2010-10-12
91 * FUNCTION: initialize the struct.
92 * PARAMETER:
93 * RETURN:
95 inline _matrix_args()
97 matrixManager = 0;
98 para = 0;
99 genome = 0;
100 soap_alignment = 0;
101 outFile = 0;
102 sam_alignment = 0;
106 }MATRIX_ARGS;