source: branches/stable/GDE/MUSCLE/src/profile.h

Last change on this file was 10390, checked in by aboeckma, 12 years ago

added muscle sourcles amd makefile

File size: 4.4 KB
Line 
1#ifndef FastProf2_h
2#define FastProf2_h
3
4#include "msa.h"
5#include "pwpath.h"
6#include <math.h>       // for log function
7
8class DiagList;
9class WeightList;
10
11struct ProfPos
12        {
13        bool m_bAllGaps;
14        unsigned m_uSortOrder[21];
15        FCOUNT m_fcCounts[20];
16        FCOUNT m_LL;
17        FCOUNT m_LG;
18        FCOUNT m_GL;
19        FCOUNT m_GG;
20        SCORE m_AAScores[20];
21        unsigned m_uResidueGroup;
22        FCOUNT m_fOcc;
23        FCOUNT m_fcStartOcc;
24        FCOUNT m_fcEndOcc;
25        SCORE m_scoreGapOpen;
26        SCORE m_scoreGapClose;
27#if     DOUBLE_AFFINE
28        SCORE m_scoreGapOpen2;
29        SCORE m_scoreGapClose2;
30#endif
31//      SCORE m_scoreGapExtend;
32        };
33
34struct ProgNode
35        {
36        ProgNode()
37                {
38                m_Prof = 0;
39                m_EstringL = 0;
40                m_EstringR = 0;
41                }
42        MSA m_MSA;
43        ProfPos *m_Prof;
44        PWPath m_Path;
45        short *m_EstringL;
46        short *m_EstringR;
47        unsigned m_uLength;
48        WEIGHT m_Weight;
49        };
50
51extern unsigned ResidueGroup[];
52const unsigned RESIDUE_GROUP_MULTIPLE = (unsigned) ~0;
53
54extern PTR_SCOREMATRIX g_ptrScoreMatrix;
55
56ProfPos *ProfileFromMSA(const MSA &a);
57
58SCORE TraceBack(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,
59  unsigned uLengthB, const SCORE *DPM_, const SCORE *DPD_, const SCORE *DPI_,
60  PWPath &Path);
61SCORE GlobalAlign(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,
62  unsigned uLengthB, PWPath &Path);
63void ProgressiveAlign(const SeqVect &v, const Tree &tree, MSA &a);
64SCORE MSAPairSP(const MSA &msa1, const MSA &msa2);
65
66void AlignTwoMSAsGivenPath(const PWPath &Path, const MSA &msaA, const MSA &msaB,
67  MSA &msaCombined);
68
69void ListProfile(const ProfPos *Prof, unsigned uLength, const MSA *ptrMSA = 0);
70SCORE ScoreProfPos2(const ProfPos &PPA, const ProfPos &PPB);
71SCORE FastScorePath2(const ProfPos *PA, unsigned uLengthA,
72  const ProfPos *PB, unsigned uLengthB, const PWPath &Path);
73bool IsHydrophilic(const FCOUNT fcCounts[]);
74int PAM200_Letter(unsigned uLetter1, unsigned uLetter2);
75SCORE AverageMatchScore(const PWPath &Path, unsigned uEdgeIndex,
76  unsigned uWindowLength);
77void WindowSmooth(const SCORE Score[], unsigned uCount, unsigned uWindowLength,
78  SCORE SmoothScore[], double dCeil = 9e29);
79SCORE FastScoreMSA_LA(const MSA &msa, SCORE MatchScore[] = 0);
80SCORE FastScoreMSA_NS(const MSA &msa, SCORE MatchScore[] = 0);
81SCORE FastScoreMSA_SP(const MSA &msa, SCORE MatchScore[] = 0);
82bool RefineMSA(MSA &msa, const Tree &tree);
83SCORE MSAQScore(const MSA &msa, SCORE MatchScore[] = 0);
84bool RefineBiParts(MSA &msa, const Tree &tree, bool R);
85void FindAnchorCols(const MSA &msa, unsigned AnchorCols[],
86  unsigned *ptruAnchorColCount);
87double PctIdToHeight(double dPctId);
88double PctIdToHeightKimura(double dPctId);
89double PctIdToHeightMAFFT(double dPctId);
90double PctIdToMAFFTDist(double dPctId);
91bool RefineBlocks(MSA &msa, const Tree &tree);
92bool RefineSubfams(MSA &msaIn, const Tree &tree, unsigned uIters);
93void SetMuscleTree(const Tree &tree);
94void CalcClustalWWeights(const Tree &tree, WEIGHT Weights[]);
95void RealignDiffs(const MSA &msaIn, const Tree &Diffs,
96  const unsigned IdToDiffsTreeNodeIndex[], MSA &msaOut);
97void RealignDiffsE(const MSA &msaIn, const SeqVect &v,
98  const Tree &NewTree, const Tree &OldTree,
99  const unsigned uNewNodeIndexToOldNodeIndex[],
100  MSA &msaOut, ProgNode *OldProgNodes);
101void RefineTree(MSA &msa, Tree &tree);
102void RefineTreeE(MSA &msa, const SeqVect &v, Tree &tree, ProgNode *ProgNodes);
103bool IsHydrophobic(const FCOUNT fcCounts[]);
104void Hydro(ProfPos *Prof, unsigned uLength);
105void SetTermGaps(const ProfPos *Prof, unsigned uLength);
106
107// Macros to simulate 2D matrices
108#define DPL(PLA, PLB)   DPL_[(PLB)*uPrefixCountA + (PLA)]
109#define DPM(PLA, PLB)   DPM_[(PLB)*uPrefixCountA + (PLA)]
110#define DPD(PLA, PLB)   DPD_[(PLB)*uPrefixCountA + (PLA)]
111#define DPE(PLA, PLB)   DPE_[(PLB)*uPrefixCountA + (PLA)]
112#define DPI(PLA, PLB)   DPI_[(PLB)*uPrefixCountA + (PLA)]
113#define DPJ(PLA, PLB)   DPJ_[(PLB)*uPrefixCountA + (PLA)]
114#define DPU(PLA, PLB)   DPU_[(PLB)*uPrefixCountA + (PLA)]
115#define TBM(PLA, PLB)   TBM_[(PLB)*uPrefixCountA + (PLA)]
116#define TBD(PLA, PLB)   TBD_[(PLB)*uPrefixCountA + (PLA)]
117#define TBE(PLA, PLB)   TBE_[(PLB)*uPrefixCountA + (PLA)]
118#define TBI(PLA, PLB)   TBI_[(PLB)*uPrefixCountA + (PLA)]
119#define TBJ(PLA, PLB)   TBJ_[(PLB)*uPrefixCountA + (PLA)]
120
121SCORE ScoreProfPos2LA(const ProfPos &PPA, const ProfPos &PPB);
122SCORE ScoreProfPos2NS(const ProfPos &PPA, const ProfPos &PPB);
123SCORE ScoreProfPos2SP(const ProfPos &PPA, const ProfPos &PPB);
124SCORE ScoreProfPos2SPN(const ProfPos &PPA, const ProfPos &PPB);
125
126#endif // FastProf_h
Note: See TracBrowser for help on using the repository browser.