2 ******************************************************************************
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 *******************************************************************************
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.
27 // Call_win objects vector
28 vector
<Call_win
*> m_cw_vec
;
29 Call_winManager(void);
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
);
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
);
46 * FUNCTION: a parameter structure that about Call_win.
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
;
61 SfsMethod
* sfsMethod_p
;
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
;
77 inline _call_win_args()
79 call_winManager_p
= NULL
;
80 alignment_vec_p
= NULL
;
92 //void* _call_winManager_soap2cns_norm(void * __args);
94 class Call_win_Task
: public CTask
97 // overload the function Run().
100 _call_winManager_soap2cns_norm(this->m_ptrData);