Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / general / UserParameters.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /**
7  * Mark Larkin 9 Dec 2005. 
8  * Note that most of the variables in this class are from param.h.
9  *
10  * Change log:
11  * Jan 18th 2006: Changed all of the c style strings into c++ string objects!
12  * Mark 30-1-2007: Added useLEScoringFunction and access functions.
13  * 31-01-07,Nigel Brown(EMBL): Revision string now obtained from clustalw
14  * specific versionw.h and updated from 1.83 to 2.1.
15  */
16  
17 #ifndef USERPARAMETERS_H
18 #define USERPARAMETERS_H
19
20 #include <string>
21 #include <iostream>
22 #include "utils.h"
23 #include "general.h"
24 #include "clustalw.h"
25
26 namespace clustalw
27 {
28
29 class UserParameters
30 {
31     public:
32         /* Functions */
33         UserParameters(bool log = false);
34         void setParamsToDefault();
35         void createParameterOutput();
36         int resIndex(string t,char c);
37         void setDNAMultiGap();
38         void setProtMultiGap();
39         void setDNAParams();
40         void setProtParams();
41         void setPWProteinParam();
42         void setPWDNAParam();
43         void setPWParamToProtein();
44         void setPWParamToDNA();
45         string getRevisionLevel();
46         void setRevisionLevel(string value);
47         bool getInteractive(){return interactive;};
48         void setInteractive(bool value);
49         float getGapOpen(){return gapOpen;};
50         void setGapOpen(float value);
51         float getGapExtend(){return gapExtend;};
52         void setGapExtend(float value);
53         float getPWGapOpen(){return PWGapOpen;};
54         void setPWGapOpen(float value);
55         float getPWGapExtend(){return PWGapExtend;};
56         void setPWGapExtend(float value);
57         float getAAGapOpen(){return AAGapOpen;}
58         void setAAGapOpen(float gap){AAGapOpen = gap;}
59         float getAAGapExtend(){return AAGapExtend;}
60         void setAAGapExtend(float gap){AAGapExtend = gap;}
61         float getAAPWGapOpen(){return AAPWGapOpen;}
62         void setAAPWGapOpen(float gap){AAPWGapOpen = gap;}
63         float getAAPWGapExtend(){return AAPWGapExtend;}
64         void setAAPWGapExtend(float gap){AAPWGapExtend = gap;}
65         int getMaxAA(){return maxAA;};
66         void setMaxAA(int value);
67         int getGapPos1(){return gapPos1;};
68         void setGapPos1(int value);
69         int getGapPos2(){return gapPos2;};
70         void setGapPos2(int value);
71         int getProfileNum(){return profileNum;};
72         void setProfileNum(int value);
73         bool getMenuFlag(){return menuFlag;};
74         void setMenuFlag(bool value);
75         bool getDNAFlag(){return DNAFlag;};
76         void setDNAFlag(bool value);
77         bool getDistanceTree(){return distanceTree;};
78         void setDistanceTree(bool value);
79         string getSeqName(){return seqName;};
80         void setSeqName(string value);
81         float getDNAGapOpen(){return DNAGapOpen;};
82         void setDNAGapOpen(float value);
83         float getDNAGapExtend(){return DNAGapExtend;};
84         void setDNAGapExtend(float value);
85         float getProteinGapOpen(){return AAGapOpen;};
86         void setProteinGapOpen(float value);
87         float getProteinGapExtend(){return AAGapExtend;};
88         void setProteinGapExtend(float value);
89         int getGapDist(){return gapDist;};
90         void setGapDist(int value);
91         int getOutputOrder(){return outputOrder;};
92         void setOutputOrder(int value);
93         void toggleOutputOrder();
94         int getDivergenceCutoff(){return divergenceCutoff;};
95         void setDivergenceCutoff(int value);
96
97
98         string getHydResidues(){return hydResidues;};
99         void setHydResidues(string value);
100         bool getNoWeights(){return noWeights;};
101         void setNoWeights(bool value);
102         bool getUseNegMatrix(){return negMatrix;};
103         void setUseNegMatrix(bool value);
104         void toggleUseNegMatrix();
105         bool getNoHydPenalties(){return noHydPenalties;};
106         void setNoHydPenalties(bool value);
107         void toggleNoHydPenalties();
108         bool getNoVarPenalties(){return noVarPenalties;};
109         void setNoVarPenalties(bool value);
110         bool getNoPrefPenalties(){return noPrefPenalties;};
111         void setNoPrefPenalties(bool value);
112         void toggleNoPrefPenalties();
113         bool getUseEndGaps(){return useEndGaps;};
114         void setUseEndGaps(bool value);
115         void toggleUseEndGaps();
116         bool getEndGapPenalties(){return endGapPenalties;};
117         void setEndGapPenalties(bool value);
118         bool getResetAlignmentsNew(){return resetAlignmentsNew;};
119         void setResetAlignmentsNew(bool value);
120         bool getResetAlignmentsAll(){return resetAlignmentsAll;};
121         void toggleResetAlignmentsNew();
122         void setResetAlignmentsAll(bool value);
123         int getOutputStructPenalties(){return outputStructPenalties;};
124         void setOutputStructPenalties(int value);
125         int getStructPenalties1(){return structPenalties1;};
126         void setStructPenalties1(int value);
127         int getStructPenalties2(){return structPenalties2;};
128         void setStructPenalties2(int value);
129         bool getUseSS1(){return useSS1;};
130         void setUseSS1(bool value);
131         void toggleUseSS1();
132         bool getUseSS2(){return useSS2;};
133         void setUseSS2(bool value);
134         void toggleUseSS2();
135         int getHelixPenalty(){return helixPenalty;};
136         void setHelixPenalty(int value);
137         int getStrandPenalty(){return strandPenalty;};
138         void setStrandPenalty(int value);
139         int getLoopPenalty(){return loopPenalty;};
140         void setLoopPenalty(int value);
141         int getHelixEndMinus(){return helixEndMinus;};
142         void setHelixEndMinus(int value);
143         int getHelixEndPlus(){return helixEndPlus;};
144         void setHelixEndPlus(int value);
145         int getStrandEndMinus(){return strandEndMinus;};
146         void setStrandEndMinus(int value);
147         int getStrandEndPlus(){return strandEndPlus;};
148         void setStrandEndPlus(int value);
149         int getHelixEndPenalty(){return helixEndPenalty;};
150         void setHelixEndPenalty(int value);
151         int getStrandEndPenalty(){return strandEndPenalty;};
152         void setStrandEndPenalty(int value);
153         bool getUseAmbiguities(){return useAmbiguities;};
154         void setUseAmbiguities(bool value);
155         float getDNAPWGapOpenPenalty(){return DNAPWGapOpen;};
156         void setDNAPWGapOpenPenalty(float value);
157         float getDNAPWGapExtendPenalty(){return DNAPWGapExtend;};
158         void setDNAPWGapExtendPenalty(float value);
159         float getProteinPWGapOpenPenalty(){return AAPWGapOpen;};
160         void setProteinPWGapOpenPenalty(float value);
161         float getProteinPWGapExtendPenalty(){return AAPWGapExtend;};
162         void setProteinPWGapExtendPenalty(float value);
163
164         bool getQuickPairAlign(){return quickPairAlign;};
165         void setQuickPairAlign(bool value);
166         void toggleQuickPairAlign(); // Mark new!!!
167         float getTransitionWeight(){return transitionWeight;};
168         void setTransitionWeight(float value);
169         int getDNAKtup(){return DNAKtup;};
170         void setDNAKtup(int value);
171         int getDNAWindowGap(){return DNAWindowGap;};
172         void setDNAWindowGap(int value);
173         int getDNASignif(){return DNASignif;};
174         void setDNASignif(int value);
175         int getDNAWindow(){return DNAWindow;};
176         void setDNAWindow(int value);
177         int getAAKtup(){return AAKtup;};
178         void setAAKtup(int value);
179         int getAAWindowGap(){return AAWindowGap;};
180         void setAAWindowGap(int value);
181         int getAASignif(){return AASignif;};
182         void setAASignif(int value);
183         int getAAWindow(){return AAWindow;};
184         void setAAWindow(int value);
185         bool getPercent(){return percent;};
186         void setPercent(bool value);
187         bool getTossGaps(){return tossgaps;};
188         void setTossGaps(bool value);
189         void toggleTossGaps();
190         bool getKimura(){return kimura;};
191         void setKimura(bool value);
192         void toggleKimura();
193         int getBootNumTrials(){return bootNumTrials;};
194         void setBootNumTrials(int value);
195         unsigned int getBootRanSeed(){return bootRanSeed;};
196         void setBootRanSeed(unsigned int value);
197         int getDebug(){return debug;};
198         void setDebug(int value);
199         bool getExplicitDNAFlag(){return explicitDNAFlag;};
200         void setExplicitDNAFlag(bool value);
201         bool getLowercase(){return lowercase;};
202         void setLowercase(bool value);
203         void toggleLowercase();
204         bool getClSeqNumbers(){return clSeqNumbers;};
205         void setClSeqNumbers(bool value);
206         void toggleClSeqNumbers();
207         bool getSeqRange(){return seqRange;};
208         void setSeqRange(bool value);
209         void toggleSeqRange();
210         bool getOutputClustal(){return outputClustal;};
211         void setOutputClustal(bool value);
212         void toggleOutputClustal(); 
213         bool getOutputGCG(){return outputGcg;};
214         void setOutputGCG(bool value);
215         void toggleOutputGCG(); 
216         bool getOutputPhylip(){return outputPhylip;};
217         void setOutputPhylip(bool value);
218         void toggleOutputPhylip(); 
219         bool getOutputNbrf(){return outputNbrf;};
220         void setOutputNbrf(bool value);
221         void toggleOutputNbrf(); 
222         bool getOutputGde(){return outputGde;};
223         void setOutputGde(bool value);
224         void toggleOutputGde(); 
225         bool getOutputNexus(){return outputNexus;};
226         void setOutputNexus(bool value);
227         void toggleOutputNexus(); 
228         bool getOutputFasta(){return outputFasta;};
229         void setOutputFasta(bool value);
230         void toggleOutputFasta(); 
231         bool getShowAlign(){return showAlign;};
232         void setShowAlign(bool value);
233         void toggleShowAlign();
234         bool getSaveParameters(){return saveParameters;};
235         void setSaveParameters(bool value);
236         void toggleSaveParameters();
237         bool getOutputTreeClustal(){return outputTreeClustal;};
238         void setOutputTreeClustal(bool value);
239         void toggleOutputTreeClustal();
240         bool getOutputTreePhylip(){return outputTreePhylip;};
241         void setOutputTreePhylip(bool value);
242         void toggleOutputTreePhylip();
243         bool getOutputTreeDistances(){return outputTreeDistances;};
244         void setOutputTreeDistances(bool value);
245         void toggleOutputTreeDistances();
246         bool getOutputTreeNexus(){return outputTreeNexus;};
247         void setOutputTreeNexus(bool value);
248         void toggleOutputTreeNexus();
249         bool getOutputPim(){return outputPim;};
250         void setOutputPim(bool value);
251         int getBootstrapFormat(){return bootstrapFormat;};
252         void setBootstrapFormat(int value);
253         void toggleBootstrapFormat();
254         string getProfile1Name(){return profile1Name;};
255         void setProfile1Name(string value);
256         string getProfile2Name(){return profile2Name;};
257         void setProfile2Name(string value);
258         bool getEmpty(){return empty;};
259         void setEmpty(bool value);
260         bool getProfile1Empty(){return profile1Empty;};
261         void setProfile1Empty(bool value);
262         bool getProfile2Empty(){return profile2Empty;};
263         void setProfile2Empty(bool value);
264         string getOutfileName(){return outfileName;};
265         void setOutfileName(string value);
266         bool getUseTreeFile(){return useTreeFile;};
267         void setUseTreeFile(bool value);
268         bool getNewTreeFile(){return newTreeFile;};
269         void setNewTreeFile(bool value);
270         bool getUseTree1File(){return useTree1File;};
271         void setUseTree1File(bool value);
272         bool getUseTree2File(){return useTree2File;};
273         void setUseTree2File(bool value);
274         bool getNewTree1File(){return newTree1File;};
275         void setNewTree1File(bool value);
276         bool getNewTree2File(){return newTree2File;};
277         void setNewTree2File(bool value);
278         string getAminoAcidCodes(){return aminoAcidCodes;};
279         char getAminoAcidCode(int i){return aminoAcidCodes[i];};
280         void setAminoAcidCodes(string value);
281         int getKtup(){return ktup;};
282         void setKtup(int value);
283         int getWindow(){return window;};
284         void setWindow(int value);
285         int getWindowGap(){return windowGap;};
286         void setWindowGap(int value);
287         int getSignif(){return signif;};
288         void setSignif(int value);
289         int getRangeFrom(){return rangeFrom;};
290         int getRangeTo(){return rangeTo;};
291         void setRangeFrom(int from);
292         void setRangeTo(int to);
293         bool getRangeFromToSet(){return rangeFromToSet;};
294         void setRangeFromToSet(bool set){rangeFromToSet = set;};
295         int getQTScorePlotScale();
296         void setQTScorePlotScale(int score);
297         int getQTResExceptionCutOff();
298         void setQTResExceptionCutOff(int cutOff);
299         bool getQTseqWeightCalculated();
300         void setQTseqWeightCalculated(bool calculated);
301         int getQTminLenLowScoreSegment();
302         void setQTminLenLowScoreSegment(int minLen);
303         int getQTlowScoreDNAMarkingScale();
304         void setQTlowScoreDNAMarkingScale(int dnaScale);
305
306         
307         // Access functions for the iteration variables.
308         void setNumIterations(int num){numIterations = num;}
309         int getNumIterations(){return numIterations;}
310         void setDoRemoveFirstIteration(int doIter){doRemoveFirstIteration = doIter;}
311         int getDoRemoveFirstIteration(){return doRemoveFirstIteration;}
312         bool IterationIsEnabled();
313             
314         void setClusterAlgorithm(int clust){clusterAlgorithm = clust;}
315         int getClusterAlgorithm(){return clusterAlgorithm;}
316         
317         void setDisplayInfo(bool display){displayInfo = display;}
318         bool getDisplayInfo(){return displayInfo;}
319         bool getHelpFlag() {return helpFlag;}
320         void setHelpFlag(bool b) {helpFlag = b;}
321         bool getFullHelpFlag() {return fullHelpFlag;}
322         void setFullHelpFlag(bool b) {fullHelpFlag = b;}
323         void setMaxAllowedSeqLength(int num){maxAllowedSeqLength = num;}
324         int getMaxAllowedSeqLength(){return maxAllowedSeqLength;}
325
326         bool ResetGapsIsEnabled() {return (resetAlignmentsNew || resetAlignmentsAll);};
327
328         /* Attributes */
329
330     private:
331         /* Functions */
332
333
334         /* Attributes */
335         
336         string revisionLevel;
337         bool interactive;
338         float gapOpen;
339         float gapExtend;
340         float PWGapOpen;
341         float PWGapExtend;
342         int maxAA;
343         int gapPos1;
344         int gapPos2;
345         int profileNum;
346         bool menuFlag;
347         bool DNAFlag;
348         bool distanceTree;
349         string seqName;
350         float DNAGapOpen;
351         float DNAGapExtend;
352         float AAGapOpen;
353         float AAGapExtend;
354         int gapDist;
355         int outputOrder;
356         int divergenceCutoff;
357         string hydResidues;
358         bool noWeights;
359         bool negMatrix;
360         bool noHydPenalties;
361         bool noVarPenalties;
362         bool noPrefPenalties;
363         bool useEndGaps;
364         bool endGapPenalties;
365         bool resetAlignmentsNew;
366         bool resetAlignmentsAll;
367         int outputStructPenalties;
368         int structPenalties1;
369         int structPenalties2;
370         bool useSS1;
371         bool useSS2;
372         int helixPenalty;
373         int strandPenalty;
374         int loopPenalty;
375         int helixEndMinus;
376         int helixEndPlus;
377         int strandEndMinus;
378         int strandEndPlus;
379         int helixEndPenalty;
380         int strandEndPenalty;
381         bool useAmbiguities;
382         float DNAPWGapOpen;
383         float DNAPWGapExtend;
384         float AAPWGapOpen;
385         float AAPWGapExtend;
386
387         bool quickPairAlign;
388         float transitionWeight;
389         int DNAKtup;
390         int DNAWindowGap;
391         int DNASignif;
392         int DNAWindow;
393         int AAKtup;
394         int AAWindowGap;
395         int AASignif;
396         int AAWindow;
397         bool percent;
398         bool tossgaps;
399         bool kimura;
400         int bootNumTrials;
401         unsigned int bootRanSeed;
402         int debug;
403         bool explicitDNAFlag;
404         bool lowercase; /* Flag for GDE output - set on comm. line*/
405         bool clSeqNumbers;
406         bool seqRange;
407         bool outputClustal;
408         bool outputGcg;
409         bool outputPhylip;
410         bool outputNbrf;
411         bool outputGde;
412         bool outputNexus;
413         bool outputFasta;
414         bool showAlign;
415         bool saveParameters;
416         bool outputTreeClustal;
417         bool outputTreePhylip;
418         bool outputTreeDistances;
419         bool outputTreeNexus;
420         bool outputPim;
421         int bootstrapFormat;
422         string profile1Name;
423         string profile2Name;
424         bool empty;
425         bool profile1Empty;
426         bool profile2Empty;
427         string outfileName;
428         //int profile1NumSeqs; MARK CHANGE Jan 10
429         bool useTreeFile;
430         bool newTreeFile;
431         bool useTree1File;
432         bool useTree2File;
433         bool newTree1File;
434         bool newTree2File;
435         string aminoAcidCodes;
436         int ktup;
437         int window;
438         int windowGap;
439         int signif;
440         
441         int rangeFrom;
442         int rangeTo;
443         bool rangeFromToSet;
444         
445         int QTscorePlotScale;
446         int QTresExceptionCutOff;
447         bool QTseqWeightCalculated;
448         int QTminLenLowScoreSegment;
449         int QTlowScoreDNAMarkingScale;
450
451         
452         // New variables for iteration
453         int numIterations;
454         int doRemoveFirstIteration;
455         
456         int clusterAlgorithm;
457         bool displayInfo;
458         bool helpFlag;
459         bool fullHelpFlag;
460         bool quiet;
461         
462         int maxAllowedSeqLength;
463 };
464 }
465 #endif
466