Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / alignment / ObjectiveScore.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /**
7  * This ObjectiveScore class is used to provide an objective function to score 
8  * an alignment.
9  * It is used with iteration to improve an alignment.
10  */
11  
12 #ifndef OBJECTIVESCORE_H
13 #define OBJECTIVESCORE_H
14 #include "../general/clustalw.h"
15 #include "../substitutionMatrix/globalmatrix.h" 
16 namespace clustalw
17 {
18
19 class Alignment;
20 typedef struct
21 {
22     int first;
23     int second; 
24 } Pair;  
25
26 class ObjectiveScore
27 {   
28     public:
29         ObjectiveScore();
30         long getScore(const Alignment* alnToScore);    
31     private:
32         
33         float scoreLetters(int seq1, int seq2);
34         float scoreGaps(int seq1, int seq2);
35         void calcNormalisedSeqWeights(const vector<int>* seqWeight, 
36                                       vector<float>* normSeqWeight);
37         long score;
38         int matrix[NUMRES][NUMRES];
39         const Alignment* alignToScore;
40         long scale;
41         int weightScale;
42         int sagaGapEx, sagaGapOp;
43         int gapPos1, gapPos2;
44         static const int BOTHGAPS = 0;
45         static const int NOGAPS = -1;
46         static const int GAPINSEQB = 1;
47         static const int GAPINSEQA = 2;
48 };
49
50 }
51 #endif