Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / multipleAlign / ProfileBase.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /**
7  * The reason why we have 2 different types of profiles is because one of them 
8  * (ProfileWithSub) has the substitution matrix information already in it. This
9  * increases the performance when aligning 2 profile columns.
10  */
11 #ifndef PROFILEBASE_H
12 #define PROFILEBASE_H
13
14 #include "../alignment/Alignment.h"
15
16 namespace clustalw
17 {
18
19 class ProfileBase
20 {
21     public:
22         /* Functions */
23         ProfileBase(int prfLen, int firstS, int lastS);
24         void calcGapCoeff(SeqArray* seqArray, vector<int>* gaps,  bool useStructPenalties,
25                           vector<char>* gapPenaltyMask, int gapCoef, int lenCoef);
26         const SeqArray* getProfilePtr(){return &profile;};
27         void resetProfile(){for(int i = 0; i < (int)profile.size();i++)
28                             {
29                                 profile[i].clear();
30                             }
31                             profile.clear();
32                             };
33         /* Attributes */
34
35     protected:
36         /* Functions */
37         void calcVPenalties(SeqArray* aln, vector<int>* weight); 
38         void calcResidueSpecificPen(SeqArray* aln, vector<int>* weight); 
39         void calcHydrophilicPen(SeqArray* aln, vector<int>* weight); 
40         int localPenalty(int penalty, int n, vector<int>* resWeight, vector<int>* hydWeight,
41                          vector<int>* vWeight);  
42         float percentId(vector<int>* s1, vector<int>* s2);
43
44         /* Attributes */
45         vector<vector<int> > profile;
46
47         /* number of residues used for a window for the variable zone
48            penalties */
49         int vwindow;
50         /* vll is the lower limit for the variable zone penalties
51            (vll < pen < 1.0) */
52         int vll;
53
54         /* "Pascarella and Argos" residue specific gap modification
55            factors. See Table 1 in the ClustalW 1994 NAR paper
56            http://www.ncbi.nlm.nih.gov/pubmed/7984417
57         */
58         string pascarellaRes;
59         vector<int> pascarellaProb;
60
61         vector<vector<int> > vlut;
62         static const int numLetters = 26;
63         float reducedGap;
64         bool nVarPen;
65         bool nHydPen;
66         bool nPrefPen;
67         int gdist;
68         int prfLength;
69         int firstSeq, lastSeq;
70     private:
71         /* Functions */
72
73         /* Attributes */
74
75 };
76
77 }
78 #endif