source: branches/stable/GDE/MUSCLE/src/aligntwomsas.cpp

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

added muscle sourcles amd makefile

File size: 946 bytes
Line 
1#include "muscle.h"
2#include "msa.h"
3#include "profile.h"
4#include "pwpath.h"
5#include "textfile.h"
6#include "timing.h"
7
8SCORE AlignTwoMSAs(const MSA &msa1, const MSA &msa2, MSA &msaOut, PWPath &Path,
9  bool bLockLeft, bool bLockRight)
10        {
11        const unsigned uLengthA = msa1.GetColCount();
12        const unsigned uLengthB = msa2.GetColCount();
13
14        ProfPos *PA = ProfileFromMSA(msa1);
15        ProfPos *PB = ProfileFromMSA(msa2);
16
17        if (bLockLeft)
18                {
19                PA[0].m_scoreGapOpen = MINUS_INFINITY;
20                PB[0].m_scoreGapOpen = MINUS_INFINITY;
21                }
22
23        if (bLockRight)
24                {
25                PA[uLengthA-1].m_scoreGapClose = MINUS_INFINITY;
26                PB[uLengthB-1].m_scoreGapClose = MINUS_INFINITY;
27                }
28
29        float r = (float) uLengthA/ (float) (uLengthB + 1); // +1 to prevent div 0
30        if (r < 1)
31                r = 1/r;
32
33        SCORE Score = GlobalAlign(PA, uLengthA, PB, uLengthB, Path);
34
35        AlignTwoMSAsGivenPath(Path, msa1, msa2, msaOut);
36
37        delete[] PA;
38        delete[] PB;
39
40        return Score;
41        }
Note: See TracBrowser for help on using the repository browser.