modified: myjupyterlab.sh
[GalaxyCodeBases.git] / BGI / SOAPsnp / Call_winManager.h
blobc4c10d24a7159e404891b80f3f02028dd0244b21
1 /*
2 ******************************************************************************
3 *Copyright 2010
4 * BGI-SHENZHEN
5 *All Rights Reserved
6 *ATHUOR : Bill Tang
7 *CREATE DATE : 2010-8-10
8 *CLASS NAME: Call_winManager, Call_win_Task
9 *FUNCTION : a class that can control Call_win vector.
10 *FILE NAME : Call_winManager.h
11 *UPDATE DATE : 2010-9-15
12 *UPDATE BY : Bill Tang
13 *UPDATE: 2010-10-13 add struct CALL_WIN_ARGS and Class Call_win_Task.
14 *******************************************************************************
17 #pragma once
18 #include "soap_snp.h"
19 #include "CThreadPool.h"
21 #define CRE_WIN_FAILED -1 // create Call_win object failed.
22 #define INDEX_EXCEED -2 // m_cw_vec index exceed
23 #define SOAP2CNS_SUCCESS 1 // soap2cns successful.
25 class Call_winManager
27 // Call_win objects vector
28 vector<Call_win*> m_cw_vec;
29 Call_winManager(void);
31 public:
32 Call_winManager(ubit64_t read_len, int file_num, Genome* genome);
33 virtual ~Call_winManager(void);
34 // add a Call_win object to the Call_win vector
35 virtual int addCallwin(ubit64_t read_len);
36 // soap to consensus
37 virtual int soap2cns(vector<Soap_format>& alignment_vec, gzoutstream * consensus, my_ofstream& baseinfo, Genome* genome, Prob_matrix* mat, Parameter* para, int index, int ali_index, SfsMethod &sfsMethod);
38 // deal the tail of sample
39 virtual int dealTail(gzoutstream * consensus, my_ofstream& baseinfo, Genome* genome, Prob_matrix* mat, Parameter* para, int index, SfsMethod &sfsMethod);
40 // set call win's last_start
41 void setLast_start(int start_pos);
44 /**
45 * DATE: 2010-10-13
46 * FUNCTION: a parameter structure that about Call_win.
47 * PARAMETER:
48 * RETURN:
50 typedef struct _call_win_args
52 Call_winManager * call_winManager_p;
53 vector<Soap_format> * alignment_vec_p;
54 gzoutstream * consensus_p;
55 my_ofstream * baseinfo_p;
56 Genome * genome;
57 Prob_matrix * mat;
58 Parameter *para;
59 int index;
60 int ali_index;
61 SfsMethod * sfsMethod_p;
63 // initialize
64 inline _call_win_args(Call_winManager* a, vector<Soap_format> * b,gzoutstream * c,my_ofstream* d,Genome* e,Prob_matrix* f,Parameter* g,int h, int i, SfsMethod *j)
66 call_winManager_p = a;
67 alignment_vec_p = b;
68 consensus_p = c;
69 baseinfo_p = d;
70 genome = e;
71 mat = f;
72 para = g;
73 index = h;
74 ali_index = i;
75 sfsMethod_p = j;
77 inline _call_win_args()
79 call_winManager_p = NULL;
80 alignment_vec_p = NULL;
81 consensus_p = NULL;
82 baseinfo_p = NULL;
83 genome = NULL;
84 mat = NULL;
85 para = NULL;
86 index = 0;
87 ali_index = 0;
88 sfsMethod_p = NULL;
90 }CALL_WIN_ARGS;
92 //void* _call_winManager_soap2cns_norm(void * __args);
94 class Call_win_Task : public CTask
96 public:
97 // overload the function Run().
98 int Run();
99 /*{
100 _call_winManager_soap2cns_norm(this->m_ptrData);
101 return 1;