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