modified: src1/worker.c
[GalaxyCodeBases.git] / c_cpp / etc / KaKs_Calculator / src / KaKs.h
blob3474b047f81c1b4afa7b2080be02d52590c40fd4
1 /************************************************************
2 * Copyright (c) 2005, BGI of Chinese Academy of Sciences
3 * All rights reserved.
5 * Filename: KaKs.h
6 * Abstract: Declaration of KAKS class including several methods.
8 * Version: 1.0
9 * Author: Zhang Zhang (zhanghzhang@genomics.org.cn)
10 * Date: Feb.2, 2005
12 *************************************************************/
13 #if !defined(KAKS_H)
14 #define KAKS_H
16 #include "base.h"
17 #include "NG86.h"
18 #include "LWL85.h"
19 #include "LPB93.h"
20 #include "GY94.h"
21 #include "YN00.h"
22 #include "MYN.h"
23 #include "MSMA.h"
25 using namespace std;
27 /* KAKS class */
28 class KAKS: public Base {
30 public:
31 KAKS();
32 ~KAKS();
34 /* Main function to call kaks's methods */
35 bool Run(int argc, const char* argv[]);
36 /* Read and Calculate seq, called in "Run" main function */
37 bool ReadCalculateSeq(string filename);
39 /* Initialize class, ready for running */
40 int Initialize();
41 /* Unitialize class, for unloading */
42 int Uninitialize();
44 protected:
45 /* Use several methods to calculate ka/ks */
46 bool calculateKaKs();
47 /* Show help information */
48 void helpInfo();
50 /* NONE: an in-house algorithm in BGI, that is NG86 without correction */
51 void start_NONE();
52 /* NG86 */
53 void start_NG86();
54 /* LWL85 */
55 void start_LWL85();
56 /* Modified LWL85 */
57 void start_MLWL85();
58 /* LPB93 */
59 void start_LPB93();
60 /* Modified LPB93 */
61 void start_MLPB93();
62 /* GY94 */
63 void start_GY94();
64 /* YN00 */
65 void start_YN00();
66 /* MYN */
67 void start_MYN();
68 /* Model Selection and Model Averaging */
69 void start_MSMA();
72 /* Get GCC of entire sequences and of three codon positions */
73 void getGCContent(string str);
74 /* Check the sequence whether is valid or not */
75 bool checkValid(string name, string str1, string str2);
76 /* Parse the input parameters */
77 bool parseParameter(int argc, const char* argv[]);
78 /* Show input parameters' information on screen */
79 void showParaInfo();
80 /* Get title information for writing into file */
81 string getTitleInfo();
83 public:
84 /* Methods' name and reference */
85 vector<string> method_name;
86 vector<string> method_ref;
88 /* Parameters' title in outputing file */
89 vector<string> titleInfo;
91 /* Results for windows parser that shows results on ListCtrl */
92 string result4Win;
94 /* File name for output */
95 string output_filename;
96 /* Sequence file name */
97 string seq_filename;
99 /* Flag for whether to run NG86, MLWL85, MLPB93, GY94, YN00, MYN, MS/A=model selection/averaging */
100 bool none, ng86, lwl85, lpb93, yn00, mlwl85, mlpb93, gy94, myn, ms, ma;
101 /* Number of compared pairwise sequences */
102 unsigned long number; //Maybe too many
104 protected:
105 /* File name for detailed results for model selection */
106 string detail_filename;
107 /* Detailed results */
108 string details;
110 private:
111 /* The temporary results for write into file */
112 string result;
113 /* Output stream */
114 ofstream os;
115 /* A pair of sequence */
116 string seq1, seq2;
119 #endif