1 /**
2  * Author: Mark Larkin
3  *
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
5  */
6 /**
7  * This file contains the implementation of the UserParameter functions
8  * Mark Larkin Dec 8 2005
9  *
10  * Modified: 17 January 2008 Paul McGettigan added in the O aminoacid residue to handle Pyrrolysine
11  */
12 #ifdef HAVE_CONFIG_H
13     #include "config.h"
14 #endif
15 #include <stdio.h>
16 #include <string>
17 #include <cstdlib>
18 #include <exception>
19 #include <iostream>
20 #include <limits>
21 #include <climits>
22 #include <iomanip>
23 #include <fstream>
24 #include "UserParameters.h"
25 #include "clustalw_version.h"
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29 namespace clustalw
30 {
31 using namespace std;
32 
UserParameters(bool log)33 UserParameters::UserParameters(bool log)
34 {
35    // FIXME: huge parts should be merged/replaced with
36    // setParamsToDefault (which is not used at all)
37 
38     gapPos1 = NUMRES - 2; /* code for gaps inserted by clustalw */
39     gapPos2 = NUMRES - 1; /* code for gaps already in alignment */
40 
41     //revisionLevel = CLU_SHORT_VERSION_STRING;
42     revisionLevel = CLUSTALW_VERSION;
43     interactive = false;
44     gui = false;
45 
46     seqName = "";
47     DNAGapOpen = 15.0;
48     DNAGapExtend = 6.66;
49     AAGapOpen = 10.0;
50     AAGapExtend = 0.2;
51     gapDist = 4;
52     outputOrder = ALIGNED; // Note: All macros should be replaced by const
53     divergenceCutoff = 30;
54 
55     hydResidues = "GPSNDQEKR";
56     noWeights = false;
57     negMatrix = false;
58     noHydPenalties = false;
59     noVarPenalties = true;
60     noPrefPenalties = false;
61     useEndGaps = false;
62     endGapPenalties = false;
63     resetAlignmentsNew = false;
64     resetAlignmentsAll = false;
65     outputStructPenalties = OUTSECST;
66     structPenalties1 = NONE;
67     structPenalties2 = NONE;
68     useSS1 = true;
69     useSS2 = true;
70     helixPenalty = 4;
71     strandPenalty = 4;
72     loopPenalty = 1;
73     helixEndMinus = 3;
74     helixEndPlus = 0;
75     strandEndMinus = 1;
76     strandEndPlus = 1;
77     helixEndPenalty = 2;
78     strandEndPenalty = 2;
79     useAmbiguities = false;
80     DNAPWGapOpen = 15.0;
81     DNAPWGapExtend = 6.66;
82     AAPWGapOpen = 10.0;
83     AAPWGapExtend = 0.1;
84 
85     quickPairAlign = false;
86     transitionWeight = 0.5;
87     DNAKtup = 2;
88     DNAWindowGap = 5;
89     DNASignif = 4;
90     DNAWindow = 4;
91     AAKtup = 1;
92     AAWindowGap = 3;
93     AASignif = 5;
94     AAWindow = 5;
95     percent = true;
96     tossgaps = false;
97     kimura = false;
98     bootNumTrials = 1000;
99     bootRanSeed = 111;
100     debug = 0;
101     explicitDNAFlag = false;
102     lowercase = true;
103     clSeqNumbers = false;
104     seqRange = false;
105     outputClustal = true;
106     outputGcg = false;
107     outputPhylip = false;
108     outputNbrf = false;
109     outputGde = false;
110     outputNexus = false;
111     outputFasta = false;
112     showAlign = true;
113     saveParameters = false;
114     outputTreeClustal = false;
115     outputTreePhylip = true;
116     outputTreeDistances = false;
117     outputTreeNexus = false;
118     outputPim = false;
119     bootstrapFormat = BS_BRANCH_LABELS;
120     profile1Name = ""; // Initialise to blank strings
121     profile2Name = "";
122     empty = true;
123     profile1Empty = true;
124     profile2Empty = true;
125     outfileName = "";
126     //profile1NumSeqs = 0; // MARK: Set to default before used.
127     useTreeFile = false;
128     newTreeFile = false;
129     useTree1File = false;
130     useTree2File = false;
131     newTree1File = false;
132     newTree2File = false;
133     aminoAcidCodes = "ABCDEFGHIKLMNOPQRSTUVWXYZ-";
134     maxAA = aminoAcidCodes.length() - 2;
135 
136     // Some variables need the alignment to be read in before they can be set.
137     // I am putting the default as protein. Note: this should not make a difference
138     // as they are not used before they have been set a value again!!
139 
140     gapOpen = AAGapOpen;
141     gapExtend = AAGapExtend;
142     PWGapOpen = AAPWGapOpen;
143     PWGapExtend = AAPWGapExtend;
144 
145     gapPos1 = NUMRES - 2;
146     gapPos2 = NUMRES - 1;
147     profileNum = 0;
148     menuFlag = false; // MARK: I set to default value.
149     DNAFlag = false; // MARK: I set to default value.
150     distanceTree = true; // MARK: I set to default value.
151     ktup = AAKtup;
152     window = AAWindow;
153     windowGap = AAWindowGap;
154     signif = AASignif;
155     rangeFrom = -1;
156     rangeTo = -1;
157     rangeFromToSet = false;
158     QTscorePlotScale = 5;
159     QTresExceptionCutOff = 5;
160 
161     QTseqWeightCalculated = false;
162     QTminLenLowScoreSegment = 1;
163     QTlowScoreDNAMarkingScale = 5;
164 
165     // Set defaults for iteration variables.
166     numIterations = 3;
167     doRemoveFirstIteration = NONE;
168     maxAllowedSeqLength = INT_MAX;
169 
170     clusterAlgorithm = NJ;
171     displayInfo = true;
172     helpFlag = false;
173     fullHelpFlag = false;
174     quiet = false;
175 
176 }
177 
178 // FIXME:never used
setParamsToDefault()179 void UserParameters::setParamsToDefault()
180 {
181     DNAGapOpen = 15.0;
182     DNAGapExtend = 6.66;
183     AAGapOpen = 10.0;
184     AAGapExtend = 0.2;
185     gapDist = 4;
186     outputOrder = ALIGNED;
187     divergenceCutoff = 30;
188 
189     hydResidues = "GPSNDQEKR";
190     noWeights = false;
191     negMatrix = false;
192     noHydPenalties = false;
193     noVarPenalties = true;
194     noPrefPenalties = false;
195     useEndGaps = false;
196     endGapPenalties = false;
197     resetAlignmentsNew = false;
198     resetAlignmentsAll = false;
199     outputStructPenalties = OUTSECST;
200     structPenalties1 = NONE;
201     structPenalties2 = NONE;
202     useSS1 = true;
203     useSS2 = true;
204     helixPenalty = 4;
205     strandPenalty = 4;
206     loopPenalty = 1;
207     helixEndMinus = 3;
208     helixEndPlus = 0;
209     strandEndMinus = 1;
210     strandEndPlus = 1;
211     helixEndPenalty = 2;
212     strandEndPenalty = 2;
213     useAmbiguities = false;
214     DNAPWGapOpen = 15.0;
215     DNAPWGapExtend = 6.66;
216     AAPWGapOpen = 10.0;
217     AAPWGapExtend = 0.1;
218     quickPairAlign = false;
219     transitionWeight = 0.5;
220     DNAKtup = 2;
221     DNAWindowGap = 5;
222     DNASignif = 4;
223     DNAWindow = 4;
224     AAKtup = 1;
225     AAWindowGap = 3;
226     AASignif = 5;
227     AAWindow = 5;
228     percent = true;
229     tossgaps = false;
230     kimura = false;
231     bootNumTrials = 1000;
232     bootRanSeed = 111;
233     debug = 0;
234     lowercase = true;
235     clSeqNumbers = false;
236     seqRange = false;
237     outputClustal = true;
238     outputGcg = false;
239     outputPhylip = false;
240     outputNbrf = false;
241     outputGde = false;
242     outputNexus = false;
243     outputFasta = false;
244     outputTreeClustal = false;
245     outputTreePhylip = true;
246     outputTreeDistances = false;
247     outputTreeNexus = false;
248     outputPim = false;
249     bootstrapFormat = BS_BRANCH_LABELS;
250     useTreeFile = false;
251     newTreeFile = false;
252     useTree1File = false;
253     useTree2File = false;
254     newTree1File = false;
255     newTree2File = false;
256     rangeFrom = -1;
257     rangeTo = -1;
258     rangeFromToSet = false;
259     QTscorePlotScale = 5;
260     QTresExceptionCutOff = 5;
261 
262     QTminLenLowScoreSegment = 1;
263     QTlowScoreDNAMarkingScale = 5;
264     distanceTree = true; // MARK: I set to default value.
265 
266     numIterations = 3;
267 
268     if(getDNAFlag())
269     {
270         setDNAParams();
271     }
272     else
273     {
274         setProtParams();
275     }
276 
277     clusterAlgorithm = NJ;
278     displayInfo = true;
279     helpFlag = false;
280     fullHelpFlag = false;
281     quiet = false;
282     doRemoveFirstIteration = NONE;
283     maxAllowedSeqLength = INT_MAX;
284 }
285 
286 /*
287  * The function createParameterOutput is used to put all the user parameters in
288  * a file. It is used for testing and for saving parameters.
289  *
290  *
291  * FIXME: AW: Some parameters are missing here (e.g. the new ones like
292  * clustering, etc)
293  *
294  */
createParameterOutput(void)295 void UserParameters::createParameterOutput(void)
296 {
297     string parname, temp;
298     string path;
299     string message;
300 
301     utilityObject->getPath(seqName, &path);
302     parname = path + "par";
303     if(menuFlag)
304     {
305         message = "\nEnter a name for the parameter output file [" + parname + "]";
306         utilityObject->getStr(message, temp);
307         if(temp != "")
308         {
309             parname = temp;
310         }
311     }
312 
313     ofstream outfile;
314     outfile.open(parname.c_str(), ofstream::out);
315 
316     if(!outfile)
317     {
318         return; // Failed to open
319     }
320 
321     outfile << "clustalw \\\n";
322     if (!empty && profile1Empty)
323     {
324         outfile << "-infile=" << seqName << " \\\n";
325     }
326     if (!profile1Empty)
327     {
328         outfile << "-profile1=" << profile1Name << "\\\n";
329     }
330     if (!profile2Empty)
331     {
332         outfile << "-profile2=" << profile2Name << " \\\n";
333     }
334     if (DNAFlag == true)
335     {
336         outfile << "-type=dna \\\n";
337     }
338     else
339     {
340         outfile << "-type=protein \\\n";
341     }
342     if (quickPairAlign)
343     {
344         outfile << "-quicktree \\\n";
345         outfile << "-ktuple=" << ktup << " \\\n";
346         outfile << "-window=" << window << " \\\n";
347         outfile << "-pairgap=" << windowGap << " \\\n";
348         outfile << "-topdiags=" << signif << " \\\n";
349         if (percent)
350         {
351             outfile << "-score=percent \\\n";
352         }
353         else
354         {
355             outfile << "-score=absolute \\\n";
356         }
357     }
358     else
359     {
360         if (!DNAFlag)
361         {
362             //outfile << "-pwmatrix=" << pwMatrixName << " \\\n";
363             outfile << "-pwgapopen=" << fixed << setprecision(2) << AAPWGapOpen
364                     << " \\\n";
365             outfile << "-pwgapext=" << AAPWGapExtend << " \\\n";
366         }
367         else
368         {
369             outfile << "-pwgapopen=" << fixed << setprecision(2) << PWGapOpen << " \\\n";
370             outfile << "-pwgapext=" << PWGapExtend << " \\\n";
371         }
372     }
373 
374     if (!DNAFlag)
375     {
376         //outfile << "-matrix=" << matrixName << " \\\n";
377         outfile << "-gapopen=" << fixed << setprecision(2) << AAGapOpen << " \\\n";
378         outfile << "-gapext=" << AAGapExtend << " \\\n";
379     }
380     else
381     {
382         outfile << "-gapopen=" << fixed << setprecision(2) << DNAGapOpen << " \\\n";
383         outfile << "-gapext=" << DNAGapExtend << " \\\n";
384     }
385 
386     outfile << "-maxdiv=" << divergenceCutoff << " \\\n";
387     if (!useEndGaps)
388     {
389         outfile << "-endgaps \\\n";
390     }
391 
392     if (!DNAFlag)
393     {
394         if (negMatrix)
395         {
396             outfile << "-negative \\\n";
397         }
398         if (noPrefPenalties)
399         {
400             outfile << "-nopgap \\\n";
401         }
402         if (noHydPenalties)
403         {
404             outfile << "-nohgap \\\n";
405         }
406         if (noVarPenalties)
407         {
408             outfile << "-novgap \\\n";
409         }
410         outfile << "-hgapresidues=" << hydResidues << " \\\n";
411         outfile << "-gapdist=" << gapDist << " \\\n";
412     }
413     else
414     {
415         outfile << "-transweight=" << transitionWeight << " \\\n";
416     }
417 
418     if (outputGcg)
419     {
420         outfile << "-output=gcg \\\n";
421     }
422     else if (outputGde)
423     {
424         outfile << "-output=gde \\\n";
425     }
426     else if (outputNbrf)
427     {
428         outfile << "-output=pir \\\n";
429     }
430     else if (outputPhylip)
431     {
432         outfile << "-output=phylip \\\n";
433     }
434     else if (outputNexus)
435     {
436         outfile << "-output=nexus \\\n";
437     }
438     if (outfileName[0]!=EOS)
439     {
440         outfile << "-outfile=" << outfileName << " \\\n";
441     }
442     if (outputOrder==ALIGNED)
443     {
444         outfile << "-outorder=aligned \\\n";
445     }
446     else
447     {
448         outfile << "-outorder=input \\\n";
449     }
450     if (outputGde)
451     {
452         if (lowercase)
453         {
454             outfile << "-case=lower \\\n";
455         }
456         else
457         {
458             outfile << "-case=upper \\\n";
459         }
460     }
461 
462 
463     outfile << "-interactive\n";
464 
465     outfile.close();
466 
467 }
468 
469 /*
470  * The function resIndex returns the index of the character c in the string t.
471  *
472  */
resIndex(string t,char c)473 int UserParameters::resIndex(string t, char c)
474 {
475     register int i;
476 
477     for (i = 0; t[i] && t[i] != c; i++)
478         ;
479     if (t[i])
480     {
481         return (i);
482     }
483     else
484     {
485         return  -1;
486     }
487 }
488 
setDNAMultiGap()489 void UserParameters::setDNAMultiGap()
490 {
491     gapOpen = DNAGapOpen;
492     gapExtend = DNAGapExtend;
493 }
494 
setProtMultiGap()495 void UserParameters::setProtMultiGap()
496 {
497     gapOpen = AAGapOpen;
498     gapExtend = AAGapExtend;
499 }
500 
setDNAParams()501 void UserParameters::setDNAParams()
502 {
503     gapOpen       = DNAGapOpen;
504     gapExtend     = DNAGapExtend;
505     PWGapOpen  = DNAPWGapOpen;
506     PWGapExtend  = DNAPWGapExtend;
507     ktup           = DNAKtup;
508     window         = DNAWindow;
509     signif         = DNASignif;
510     windowGap       = DNAWindowGap;
511 }
512 
setProtParams()513 void UserParameters::setProtParams()
514 {
515     gapOpen       = AAGapOpen;
516     gapExtend     = AAGapExtend;
517     PWGapOpen  = AAPWGapOpen;
518     PWGapExtend  = AAPWGapExtend;
519     ktup           = AAKtup;
520     window         = AAWindow;
521     signif         = AASignif;
522     windowGap       = AAWindowGap;
523 }
524 
setPWParamToProtein()525 void UserParameters::setPWParamToProtein()
526 {
527     PWGapOpen = AAPWGapOpen;
528     PWGapExtend = AAPWGapExtend;
529     ktup = AAKtup;
530     window = AAWindow;
531     signif = AASignif;
532     windowGap = AAWindowGap;
533 }
534 
setPWParamToDNA()535 void UserParameters::setPWParamToDNA()
536 {
537     PWGapOpen = DNAPWGapOpen;
538     PWGapExtend = DNAPWGapExtend;
539     ktup = DNAKtup;
540     window = DNAWindow;
541     signif = DNASignif;
542     windowGap = DNAWindowGap;
543 }
544 
setPWProteinParam()545 void UserParameters::setPWProteinParam()
546 {
547     AAPWGapOpen = PWGapOpen;
548     AAPWGapExtend = PWGapExtend;
549     AAKtup = ktup;
550     AAWindow = window;
551     AASignif = signif;
552     AAWindowGap = windowGap;
553 }
554 
setPWDNAParam()555 void UserParameters::setPWDNAParam()
556 {
557     DNAPWGapOpen = PWGapOpen;
558     DNAPWGapExtend = PWGapExtend;
559     DNAKtup = ktup;
560     DNAWindow = window;
561     DNASignif = signif;
562     DNAWindowGap = windowGap;
563 }
564 /*
565  * The rest of the functions are get, set and toggle functions for the variables.
566  */
567 
getRevisionLevel()568 string UserParameters::getRevisionLevel()
569 {
570     return revisionLevel;
571 }
572 
setRevisionLevel(string value)573 void UserParameters::setRevisionLevel(string value)
574 {
575     revisionLevel = value;
576 }
577 
setInteractive(bool value)578 void UserParameters::setInteractive(bool value)
579 {
580     interactive = value;
581 }
582 
setGui(bool value)583 void UserParameters::setGui(bool value)
584 {
585     gui = value;
586 }
587 
setGapOpen(float value)588 void UserParameters::setGapOpen(float value)
589 {
590     gapOpen = value;
591 }
592 
setGapExtend(float value)593 void UserParameters::setGapExtend(float value)
594 {
595     gapExtend = value;
596 }
597 
setPWGapOpen(float value)598 void UserParameters::setPWGapOpen(float value)
599 {
600     PWGapOpen = value;
601 }
602 
setPWGapExtend(float value)603 void UserParameters::setPWGapExtend(float value)
604 {
605     PWGapExtend = value;
606 }
607 
setMaxAA(int value)608 void UserParameters::setMaxAA(int value)
609 {
610     maxAA = value;
611 }
612 
setGapPos1(int value)613 void UserParameters::setGapPos1(int value)
614 {
615     gapPos1 = value;
616 }
617 
setGapPos2(int value)618 void UserParameters::setGapPos2(int value)
619 {
620     gapPos2 = value;
621 }
622 
setProfileNum(int value)623 void UserParameters::setProfileNum(int value)
624 {
625     profileNum = value;
626 }
627 
setMenuFlag(bool value)628 void UserParameters::setMenuFlag(bool value)
629 {
630     menuFlag = value;
631 }
632 
setDNAFlag(bool value)633 void UserParameters::setDNAFlag(bool value)
634 {
635     if(value == true)
636     {
637         setDNAParams();
638     }
639     else
640     {
641         setProtParams();
642     }
643     DNAFlag = value;
644 }
645 
setDistanceTree(bool value)646 void UserParameters::setDistanceTree(bool value)
647 {
648     distanceTree = value;
649 }
650 
setSeqName(string value)651 void UserParameters::setSeqName(string value)
652 {
653     seqName = value;
654 }
655 
setDNAGapOpen(float value)656 void UserParameters::setDNAGapOpen(float value)
657 {
658     DNAGapOpen = value;
659 }
660 
setDNAGapExtend(float value)661 void UserParameters::setDNAGapExtend(float value)
662 {
663     DNAGapExtend = value;
664 }
665 
setProteinGapOpen(float value)666 void UserParameters::setProteinGapOpen(float value)
667 {
668     AAGapOpen = value;
669 }
670 
setProteinGapExtend(float value)671 void UserParameters::setProteinGapExtend(float value)
672 {
673     AAGapExtend = value;
674 }
675 
setGapDist(int value)676 void UserParameters::setGapDist(int value)
677 {
678     gapDist = value;
679 }
680 
setOutputOrder(int value)681 void UserParameters::setOutputOrder(int value)
682 {
683     outputOrder = value;
684 }
685 
toggleOutputOrder()686 void UserParameters::toggleOutputOrder()
687 {
688     if (outputOrder == INPUT)
689     {
690         outputOrder = ALIGNED;
691     }
692     else
693     {
694         outputOrder = INPUT;
695     }
696 }
697 
setDivergenceCutoff(int value)698 void UserParameters::setDivergenceCutoff(int value)
699 {
700     divergenceCutoff = value;
701 }
702 
setHydResidues(string value)703 void UserParameters::setHydResidues(string value)
704 {
705     //hydResidues = value;
706     char hydResidue;
707     string tempHydRes = "";
708     int inputStringLength = value.length();
709     if(inputStringLength > 0)
710     {
711     // NOTE this was causing an error, but I fixed it. Was giving an
712     // out of range error.
713         for (int i = 0; i < MAXHYDRESIDUES && i < inputStringLength; i++)
714         {
715             hydResidue = toupper(value.at(i));
716 
717             if (isalpha(hydResidue))
718             {
719                 tempHydRes += hydResidue;
720             }
721             else // Not Alphabetic character!
722             {
723                 break;
724             }
725         }
726         if(tempHydRes.size() > 0)
727         {
728             hydResidues = tempHydRes;
729         }
730     }
731 }
732 
setNoWeights(bool value)733 void UserParameters::setNoWeights(bool value)
734 {
735     noWeights = value;
736 }
737 
setUseNegMatrix(bool value)738 void UserParameters::setUseNegMatrix(bool value)
739 {
740     negMatrix = value;
741 }
742 
toggleUseNegMatrix()743 void UserParameters::toggleUseNegMatrix()
744 {
745     negMatrix ^= true;
746 }
747 
setNoHydPenalties(bool value)748 void UserParameters::setNoHydPenalties(bool value)
749 {
750     noHydPenalties = value;
751 }
752 
toggleNoHydPenalties()753 void UserParameters::toggleNoHydPenalties()
754 {
755     noHydPenalties ^= true;
756 }
757 
setNoVarPenalties(bool value)758 void UserParameters::setNoVarPenalties(bool value)
759 {
760     noVarPenalties = value;
761 }
762 
setNoPrefPenalties(bool value)763 void UserParameters::setNoPrefPenalties(bool value)
764 {
765     noPrefPenalties = value;
766 }
767 
toggleNoPrefPenalties()768 void UserParameters::toggleNoPrefPenalties()
769 {
770     noPrefPenalties ^= true;
771 }
772 
setUseEndGaps(bool value)773 void UserParameters::setUseEndGaps(bool value)
774 {
775     useEndGaps = value;
776 }
777 
toggleUseEndGaps()778 void UserParameters::toggleUseEndGaps()
779 {
780     useEndGaps ^= true;
781 }
782 
setEndGapPenalties(bool value)783 void UserParameters::setEndGapPenalties(bool value)
784 {
785     endGapPenalties = value;
786 }
787 
toggleResetAlignmentsNew()788 void UserParameters::toggleResetAlignmentsNew()
789 {
790     resetAlignmentsNew ^= true;
791 }
792 
setResetAlignmentsNew(bool value)793 void UserParameters::setResetAlignmentsNew(bool value)
794 {
795     resetAlignmentsNew = value;
796 }
797 
setResetAlignmentsAll(bool value)798 void UserParameters::setResetAlignmentsAll(bool value)
799 {
800     resetAlignmentsAll = value;
801 }
802 
setOutputStructPenalties(int value)803 void UserParameters::setOutputStructPenalties(int value)
804 {
805     outputStructPenalties = value;
806 }
807 
setStructPenalties1(int value)808 void UserParameters::setStructPenalties1(int value)
809 {
810     structPenalties1 = value;
811 }
812 
setStructPenalties2(int value)813 void UserParameters::setStructPenalties2(int value)
814 {
815     structPenalties2 = value;
816 }
817 
setUseSS1(bool value)818 void UserParameters::setUseSS1(bool value)
819 {
820     useSS1 = value;
821 }
822 
toggleUseSS1()823 void UserParameters::toggleUseSS1()
824 {
825     useSS1 ^= true;
826 }
827 
setUseSS2(bool value)828 void UserParameters::setUseSS2(bool value)
829 {
830     useSS2 = value;
831 }
832 
toggleUseSS2()833 void UserParameters::toggleUseSS2()
834 {
835     useSS2 ^= true;
836 }
837 
setHelixPenalty(int value)838 void UserParameters::setHelixPenalty(int value)
839 {
840     helixPenalty = value;
841 }
842 
setStrandPenalty(int value)843 void UserParameters::setStrandPenalty(int value)
844 {
845     strandPenalty = value;
846 }
847 
setLoopPenalty(int value)848 void UserParameters::setLoopPenalty(int value)
849 {
850     loopPenalty = value;
851 }
852 
setHelixEndMinus(int value)853 void UserParameters::setHelixEndMinus(int value)
854 {
855     helixEndMinus = value;
856 }
857 
setHelixEndPlus(int value)858 void UserParameters::setHelixEndPlus(int value)
859 {
860     helixEndPlus = value;
861 }
862 
setStrandEndMinus(int value)863 void UserParameters::setStrandEndMinus(int value)
864 {
865     strandEndMinus = value;
866 }
867 
setStrandEndPlus(int value)868 void UserParameters::setStrandEndPlus(int value)
869 {
870     strandEndPlus = value;
871 }
872 
setHelixEndPenalty(int value)873 void UserParameters::setHelixEndPenalty(int value)
874 {
875     helixEndPenalty = value;
876 }
877 
setStrandEndPenalty(int value)878 void UserParameters::setStrandEndPenalty(int value)
879 {
880     strandEndPenalty = value;
881 }
882 
setUseAmbiguities(bool value)883 void UserParameters::setUseAmbiguities(bool value)
884 {
885     useAmbiguities = value;
886 }
887 
setDNAPWGapOpenPenalty(float value)888 void UserParameters::setDNAPWGapOpenPenalty(float value)
889 {
890     DNAPWGapOpen = value;
891 }
892 
setDNAPWGapExtendPenalty(float value)893 void UserParameters::setDNAPWGapExtendPenalty(float value)
894 {
895     DNAPWGapExtend = value;
896 }
897 
setProteinPWGapOpenPenalty(float value)898 void UserParameters::setProteinPWGapOpenPenalty(float value)
899 {
900     AAPWGapOpen = value;
901 }
902 
setProteinPWGapExtendPenalty(float value)903 void UserParameters::setProteinPWGapExtendPenalty(float value)
904 {
905     AAPWGapExtend = value;
906 }
907 
toggleQuickPairAlign()908 void UserParameters::toggleQuickPairAlign()
909 {
910     quickPairAlign ^= true;
911 }
912 
setQuickPairAlign(bool value)913 void UserParameters::setQuickPairAlign(bool value)
914 {
915     quickPairAlign = value;
916 }
917 
setTransitionWeight(float value)918 void UserParameters::setTransitionWeight(float value)
919 {
920     transitionWeight = value;
921 }
922 
setDNAKtup(int value)923 void UserParameters::setDNAKtup(int value)
924 {
925     DNAKtup = value;
926 }
927 
setDNAWindowGap(int value)928 void UserParameters::setDNAWindowGap(int value)
929 {
930     DNAWindowGap = value;
931 }
932 
setDNASignif(int value)933 void UserParameters::setDNASignif(int value)
934 {
935     DNASignif = value;
936 }
937 
setDNAWindow(int value)938 void UserParameters::setDNAWindow(int value)
939 {
940     DNAWindow = value;
941 }
942 
setAAKtup(int value)943 void UserParameters::setAAKtup(int value)
944 {
945     AAKtup = value;
946 }
947 
setAAWindowGap(int value)948 void UserParameters::setAAWindowGap(int value)
949 {
950     AAWindowGap = value;
951 }
952 
setAASignif(int value)953 void UserParameters::setAASignif(int value)
954 {
955     AASignif = value;
956 }
957 
setAAWindow(int value)958 void UserParameters::setAAWindow(int value)
959 {
960     AAWindow = value;
961 }
962 
setPercent(bool value)963 void UserParameters::setPercent(bool value)
964 {
965     percent = value;
966 }
967 
toggleTossGaps()968 void UserParameters::toggleTossGaps()
969 {
970     tossgaps ^= true;
971 }
972 
setTossGaps(bool value)973 void UserParameters::setTossGaps(bool value)
974 {
975     tossgaps = value;
976 }
977 
setKimura(bool value)978 void UserParameters::setKimura(bool value)
979 {
980     kimura = value;
981 }
982 
toggleKimura()983 void UserParameters::toggleKimura()
984 {
985     kimura ^= true;
986 }
987 
setBootNumTrials(int value)988 void UserParameters::setBootNumTrials(int value)
989 {
990     bootNumTrials = value;
991 }
992 
setBootRanSeed(unsigned int value)993 void UserParameters::setBootRanSeed(unsigned int value)
994 {
995     bootRanSeed = value;
996 }
997 
setDebug(int value)998 void UserParameters::setDebug(int value)
999 {
1000     debug = value;
1001 }
1002 
setExplicitDNAFlag(bool value)1003 void UserParameters::setExplicitDNAFlag(bool value)
1004 {
1005     explicitDNAFlag = value;
1006 }
1007 
setLowercase(bool value)1008 void UserParameters::setLowercase(bool value)
1009 {
1010     lowercase = value;
1011 }
1012 
toggleLowercase()1013 void UserParameters::toggleLowercase()
1014 {
1015     lowercase ^= true;
1016 }
1017 
setClSeqNumbers(bool value)1018 void UserParameters::setClSeqNumbers(bool value)
1019 {
1020     clSeqNumbers = value;
1021 }
1022 
toggleClSeqNumbers()1023 void UserParameters::toggleClSeqNumbers()
1024 {
1025     clSeqNumbers ^= true;
1026 }
1027 
setSeqRange(bool value)1028 void UserParameters::setSeqRange(bool value)
1029 {
1030     seqRange = value;
1031 }
1032 
toggleSeqRange()1033 void UserParameters::toggleSeqRange()
1034 {
1035     seqRange ^= true;
1036 }
1037 
setOutputClustal(bool value)1038 void UserParameters::setOutputClustal(bool value)
1039 {
1040     outputClustal = value;
1041 }
1042 
toggleOutputClustal()1043 void UserParameters::toggleOutputClustal()
1044 {
1045     outputClustal ^= true;
1046 }
1047 
setOutputGCG(bool value)1048 void UserParameters::setOutputGCG(bool value)
1049 {
1050     outputGcg = value;
1051 }
1052 
toggleOutputGCG()1053 void UserParameters::toggleOutputGCG()
1054 {
1055     outputGcg ^= true;
1056 }
1057 
setOutputPhylip(bool value)1058 void UserParameters::setOutputPhylip(bool value)
1059 {
1060     outputPhylip = value;
1061 }
1062 
toggleOutputPhylip()1063 void UserParameters::toggleOutputPhylip()
1064 {
1065     outputPhylip ^= true;
1066 }
1067 
setOutputNbrf(bool value)1068 void UserParameters::setOutputNbrf(bool value)
1069 {
1070     outputNbrf = value;
1071 }
1072 
toggleOutputNbrf()1073 void UserParameters::toggleOutputNbrf()
1074 {
1075     outputNbrf ^= true;
1076 }
1077 
setOutputGde(bool value)1078 void UserParameters::setOutputGde(bool value)
1079 {
1080     outputGde = value;
1081 }
1082 
toggleOutputGde()1083 void UserParameters::toggleOutputGde()
1084 {
1085     outputGde ^= true;
1086 }
1087 
setOutputNexus(bool value)1088 void UserParameters::setOutputNexus(bool value)
1089 {
1090     outputNexus = value;
1091 }
1092 
toggleOutputNexus()1093 void UserParameters::toggleOutputNexus()
1094 {
1095     outputNexus ^= true;
1096 }
1097 
setOutputFasta(bool value)1098 void UserParameters::setOutputFasta(bool value)
1099 {
1100     outputFasta = value;
1101 }
1102 
toggleOutputFasta()1103 void UserParameters::toggleOutputFasta()
1104 {
1105     outputFasta ^= true;
1106 }
1107 
setShowAlign(bool value)1108 void UserParameters::setShowAlign(bool value)
1109 {
1110     showAlign = value;
1111 }
1112 
toggleShowAlign()1113 void UserParameters::toggleShowAlign()
1114 {
1115     showAlign ^= true;
1116 }
1117 
setSaveParameters(bool value)1118 void UserParameters::setSaveParameters(bool value)
1119 {
1120     saveParameters = value;
1121 }
1122 
toggleSaveParameters()1123 void UserParameters::toggleSaveParameters()
1124 {
1125     saveParameters ^= true;
1126 }
1127 
setOutputTreeClustal(bool value)1128 void UserParameters::setOutputTreeClustal(bool value)
1129 {
1130     outputTreeClustal = value;
1131 }
1132 
toggleOutputTreeClustal()1133 void UserParameters::toggleOutputTreeClustal()
1134 {
1135     outputTreeClustal ^= true;
1136 }
1137 
setOutputTreePhylip(bool value)1138 void UserParameters::setOutputTreePhylip(bool value)
1139 {
1140     outputTreePhylip = value;
1141 }
1142 
toggleOutputTreePhylip()1143 void UserParameters::toggleOutputTreePhylip()
1144 {
1145     outputTreePhylip ^= true;
1146 }
1147 
setOutputTreeDistances(bool value)1148 void UserParameters::setOutputTreeDistances(bool value)
1149 {
1150     outputTreeDistances = value;
1151 }
1152 
toggleOutputTreeDistances()1153 void UserParameters::toggleOutputTreeDistances()
1154 {
1155     outputTreeDistances ^= true;
1156 }
1157 
setOutputTreeNexus(bool value)1158 void UserParameters::setOutputTreeNexus(bool value)
1159 {
1160     outputTreeNexus = value;
1161 }
1162 
toggleOutputTreeNexus()1163 void UserParameters::toggleOutputTreeNexus()
1164 {
1165     outputTreeNexus ^= true;
1166 }
1167 
setOutputPim(bool value)1168 void UserParameters::setOutputPim(bool value)
1169 {
1170     outputPim = value;
1171 }
1172 
setBootstrapFormat(int value)1173 void UserParameters::setBootstrapFormat(int value)
1174 {
1175     bootstrapFormat = value;
1176 }
1177 
toggleBootstrapFormat()1178 void UserParameters::toggleBootstrapFormat()
1179 {
1180     if (bootstrapFormat == BS_NODE_LABELS)
1181     {
1182         bootstrapFormat = BS_BRANCH_LABELS;
1183     }
1184     else
1185     {
1186         bootstrapFormat = BS_NODE_LABELS;
1187     }
1188 }
1189 
setProfile1Name(string value)1190 void UserParameters::setProfile1Name(string value)
1191 {
1192     profile1Name = value;
1193 }
1194 
setProfile2Name(string value)1195 void UserParameters::setProfile2Name(string value)
1196 {
1197     profile2Name = value;
1198 }
1199 
setEmpty(bool value)1200 void UserParameters::setEmpty(bool value)
1201 {
1202     empty = value;
1203 }
1204 
setProfile1Empty(bool value)1205 void UserParameters::setProfile1Empty(bool value)
1206 {
1207     profile1Empty = value;
1208 }
1209 
setProfile2Empty(bool value)1210 void UserParameters::setProfile2Empty(bool value)
1211 {
1212     profile2Empty = value;
1213 }
1214 
setOutfileName(string value)1215 void UserParameters::setOutfileName(string value)
1216 {
1217     outfileName = value;
1218 }
1219 
1220 /*void UserParameters::setProfile1NumSeqs(int value)
1221 {
1222     profile1NumSeqs = value;
1223 }*/ // MARK CHANGE Jan 10
1224 
setUseTreeFile(bool value)1225 void UserParameters::setUseTreeFile(bool value)
1226 {
1227     useTreeFile = value;
1228 }
1229 
setNewTreeFile(bool value)1230 void UserParameters::setNewTreeFile(bool value)
1231 {
1232     newTreeFile = value;
1233 }
1234 
setUseTree1File(bool value)1235 void UserParameters::setUseTree1File(bool value)
1236 {
1237     useTree1File = value;
1238 }
1239 
setUseTree2File(bool value)1240 void UserParameters::setUseTree2File(bool value)
1241 {
1242     useTree2File = value;
1243 }
1244 
setNewTree1File(bool value)1245 void UserParameters::setNewTree1File(bool value)
1246 {
1247     newTree1File = value;
1248 }
1249 
setNewTree2File(bool value)1250 void UserParameters::setNewTree2File(bool value)
1251 {
1252     newTree2File = value;
1253 }
1254 
setAminoAcidCodes(string value)1255 void UserParameters::setAminoAcidCodes(string value)
1256 {
1257     aminoAcidCodes = value;
1258 }
1259 
setKtup(int value)1260 void UserParameters::setKtup(int value)
1261 {
1262     ktup = value;
1263 }
1264 
setWindow(int value)1265 void UserParameters::setWindow(int value)
1266 {
1267     window = value;
1268 }
1269 
setWindowGap(int value)1270 void UserParameters::setWindowGap(int value)
1271 {
1272     windowGap = value;
1273 }
1274 
setSignif(int value)1275 void UserParameters::setSignif(int value)
1276 {
1277     signif = value;
1278 }
1279 
setRangeFrom(int from)1280 void UserParameters::setRangeFrom(int from)
1281 {
1282     rangeFrom = from;
1283     rangeFromToSet = true;
1284 }
1285 
setRangeTo(int to)1286 void UserParameters::setRangeTo(int to)
1287 {
1288     rangeTo = to;
1289     rangeFromToSet = true;
1290 }
1291 
getQTScorePlotScale()1292 int UserParameters::getQTScorePlotScale()
1293 {
1294     return QTscorePlotScale;
1295 }
1296 
setQTScorePlotScale(int score)1297 void UserParameters::setQTScorePlotScale(int score)
1298 {
1299     QTscorePlotScale = score;
1300 }
1301 
getQTResExceptionCutOff()1302 int UserParameters::getQTResExceptionCutOff()
1303 {
1304     return QTresExceptionCutOff;
1305 }
1306 
setQTResExceptionCutOff(int cutOff)1307 void UserParameters::setQTResExceptionCutOff(int cutOff)
1308 {
1309     QTresExceptionCutOff = cutOff;
1310 }
1311 
getQTseqWeightCalculated()1312 bool UserParameters::getQTseqWeightCalculated()
1313 {
1314     return QTseqWeightCalculated;
1315 }
1316 
setQTseqWeightCalculated(bool calculated)1317 void UserParameters::setQTseqWeightCalculated(bool calculated)
1318 {
1319     QTseqWeightCalculated = calculated;
1320 }
1321 
getQTminLenLowScoreSegment()1322 int UserParameters::getQTminLenLowScoreSegment()
1323 {
1324     return QTminLenLowScoreSegment;
1325 }
1326 
setQTminLenLowScoreSegment(int minLen)1327 void UserParameters::setQTminLenLowScoreSegment(int minLen)
1328 {
1329     QTminLenLowScoreSegment = minLen;
1330 }
1331 
getQTlowScoreDNAMarkingScale()1332 int UserParameters::getQTlowScoreDNAMarkingScale()
1333 {
1334     return QTlowScoreDNAMarkingScale;
1335 }
1336 
setQTlowScoreDNAMarkingScale(int dnaScale)1337 void UserParameters::setQTlowScoreDNAMarkingScale(int dnaScale)
1338 {
1339     QTlowScoreDNAMarkingScale = dnaScale;
1340 }
1341 
IterationIsEnabled()1342 bool UserParameters::IterationIsEnabled()
1343 {
1344     if (doRemoveFirstIteration == clustalw::NONE)
1345         return false;
1346     else
1347         return true;
1348 }
1349 }
1350 
1351 
1352 
1353 
1354