本文整理汇总了C++中PWPath::LogMe方法的典型用法代码示例。如果您正苦于以下问题:C++ PWPath::LogMe方法的具体用法?C++ PWPath::LogMe怎么用?C++ PWPath::LogMe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PWPath
的用法示例。
在下文中一共展示了PWPath::LogMe方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GlobalAlign
SCORE GlobalAlign(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,
unsigned uLengthB, PWPath &Path)
{
#if TIMING
TICKS t1 = GetClockTicks();
#endif
g_bKeepSimpleDP = true;
PWPath SimplePath;
GlobalAlignSimple(PA, uLengthA, PB, uLengthB, SimplePath);
SCORE Score = NWSmall(PA, uLengthA, PB, uLengthB, Path);
if (!Path.Equal(SimplePath))
{
Log("Simple:\n");
SimplePath.LogMe();
Log("Small:\n");
Path.LogMe();
Quit("Paths differ");
}
#if TIMING
TICKS t2 = GetClockTicks();
g_ticksDP += (t2 - t1);
#endif
return Score;
}
示例2: NWDASimple
//.........这里部分代码省略.........
#if TRACE
Log("DA Simple: MAB=%.4g DAB=%.4g EAB=%.4g IAB=%.4g JAB=%.4g best=%c\n",
M, D, E, I, J, cEdgeType);
#endif
unsigned PLA = uLengthA;
unsigned PLB = uLengthB;
for (;;)
{
PWEdge Edge;
Edge.cType = XlatEdgeType(cEdgeType);
Edge.uPrefixLengthA = PLA;
Edge.uPrefixLengthB = PLB;
#if TRACE
Log("Prepend %c%d.%d\n", Edge.cType, PLA, PLB);
#endif
Path.PrependEdge(Edge);
switch (cEdgeType)
{
case 'M':
assert(PLA > 0);
assert(PLB > 0);
cEdgeType = TBM(PLA, PLB);
--PLA;
--PLB;
break;
case 'D':
assert(PLA > 0);
cEdgeType = TBD(PLA, PLB);
--PLA;
break;
case 'E':
assert(PLA > 0);
cEdgeType = TBE(PLA, PLB);
--PLA;
break;
case 'I':
assert(PLB > 0);
cEdgeType = TBI(PLA, PLB);
--PLB;
break;
case 'J':
assert(PLB > 0);
cEdgeType = TBJ(PLA, PLB);
--PLB;
break;
default:
Quit("Invalid edge %c", cEdgeType);
}
if (0 == PLA && 0 == PLB)
break;
}
Path.Validate();
// SCORE Score = TraceBack(PA, uLengthA, PB, uLengthB, DPM_, DPD_, DPI_, Path);
#if TRACE
SCORE scorePath = FastScorePath2(PA, uLengthA, PB, uLengthB, Path);
Path.LogMe();
Log("Score = %s Path = %s\n", LocalScoreToStr(BestScore), LocalScoreToStr(scorePath));
#endif
if (g_bKeepSimpleDP.get())
{
g_DPM.get() = DPM_;
g_DPD.get() = DPD_;
g_DPE.get() = DPE_;
g_DPI.get() = DPI_;
g_DPJ.get() = DPJ_;
g_TBM.get() = TBM_;
g_TBD.get() = TBD_;
g_TBE.get() = TBE_;
g_TBI.get() = TBI_;
g_TBJ.get() = TBJ_;
}
else
{
delete[] DPM_;
delete[] DPD_;
delete[] DPE_;
delete[] DPI_;
delete[] DPJ_;
delete[] TBM_;
delete[] TBD_;
delete[] TBE_;
delete[] TBI_;
delete[] TBJ_;
}
return BestScore;
}
示例3: SPTest
void SPTest()
{
SetPPScore(PPSCORE_SV);
SetListFileName("c:\\tmp\\muscle.log", false);
TextFile file1("c:\\tmp\\msa1.afa");
TextFile file2("c:\\tmp\\msa2.afa");
MSA msa1;
MSA msa2;
msa1.FromFile(file1);
msa2.FromFile(file2);
Log("msa1=\n");
msa1.LogMe();
Log("msa2=\n");
msa2.LogMe();
const unsigned uColCount = msa1.GetColCount();
if (msa2.GetColCount() != uColCount)
Quit("Different lengths");
const unsigned uSeqCount1 = msa1.GetSeqCount();
const unsigned uSeqCount2 = msa2.GetSeqCount();
const unsigned uSeqCount = uSeqCount1 + uSeqCount2;
MSA::SetIdCount(uSeqCount);
for (unsigned uSeqIndex1 = 0; uSeqIndex1 < uSeqCount1; ++uSeqIndex1)
{
msa1.SetSeqWeight(uSeqIndex1, 1.0);
msa1.SetSeqId(uSeqIndex1, uSeqIndex1);
}
for (unsigned uSeqIndex2 = 0; uSeqIndex2 < uSeqCount2; ++uSeqIndex2)
{
msa2.SetSeqWeight(uSeqIndex2, 1.0);
msa2.SetSeqId(uSeqIndex2, uSeqCount1 + uSeqIndex2);
}
MSA alnA;
MSA alnB;
char strPathA[1024];
char strPathB[1024];
MakePath(uColCount, INDELS, strPathA);
MakePath(uColCount, INDELS, strPathB);
PWPath PathA;
PWPath PathB;
PathA.FromStr(strPathA);
PathB.FromStr(strPathB);
Log("PathA=\n");
PathA.LogMe();
Log("PathB=\n");
PathB.LogMe();
AlignTwoMSAsGivenPath(PathA, msa1, msa2, alnA);
AlignTwoMSAsGivenPath(PathB, msa1, msa2, alnB);
for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)
{
alnA.SetSeqWeight(uSeqIndex, 1.0);
alnB.SetSeqWeight(uSeqIndex, 1.0);
}
unsigned Seqs1[1024];
unsigned Seqs2[1024];
for (unsigned uSeqIndex1 = 0; uSeqIndex1 < uSeqCount1; ++uSeqIndex1)
Seqs1[uSeqIndex1] = uSeqIndex1;
for (unsigned uSeqIndex2 = 0; uSeqIndex2 < uSeqCount2; ++uSeqIndex2)
Seqs2[uSeqIndex2] = uSeqCount1 + uSeqIndex2;
MSA msaA1;
MSA msaA2;
MSA msaB1;
MSA msaB2;
MSAFromSeqSubset(alnA, Seqs1, uSeqCount1, msaA1);
MSAFromSeqSubset(alnB, Seqs1, uSeqCount1, msaB1);
MSAFromSeqSubset(alnA, Seqs2, uSeqCount2, msaA2);
MSAFromSeqSubset(alnB, Seqs2, uSeqCount2, msaB2);
for (unsigned uSeqIndex1 = 0; uSeqIndex1 < uSeqCount1; ++uSeqIndex1)
{
msaA1.SetSeqWeight(uSeqIndex1, 1.0);
msaB1.SetSeqWeight(uSeqIndex1, 1.0);
}
for (unsigned uSeqIndex2 = 0; uSeqIndex2 < uSeqCount2; ++uSeqIndex2)
{
msaA2.SetSeqWeight(uSeqIndex2, 1.0);
msaB2.SetSeqWeight(uSeqIndex2, 1.0);
}
Log("msaA1=\n");
//.........这里部分代码省略.........
示例4: SW
//.........这里部分代码省略.........
SCORE scoreGapCloseA = MINUS_INFINITY;
for (unsigned uPrefixLengthA = 1; uPrefixLengthA < uPrefixCountA; ++uPrefixLengthA)
{
const ProfPos &PPA = PA[uPrefixLengthA - 1];
{
// Match M=LetterA+LetterB
SCORE scoreLL = ScoreProfPos2(PPA, PPB);
SCORE scoreMM = DPM(uPrefixLengthA-1, uPrefixLengthB-1);
SCORE scoreDM = DPD(uPrefixLengthA-1, uPrefixLengthB-1) + scoreGapCloseA;
SCORE scoreIM = DPI(uPrefixLengthA-1, uPrefixLengthB-1) + scoreGapCloseB;
SCORE scoreBest;
if (scoreMM >= scoreDM && scoreMM >= scoreIM)
scoreBest = scoreMM;
else if (scoreDM >= scoreMM && scoreDM >= scoreIM)
scoreBest = scoreDM;
else
{
assert(scoreIM >= scoreMM && scoreIM >= scoreDM);
scoreBest = scoreIM;
}
if (scoreBest < 0)
scoreBest = 0;
scoreBest += scoreLL;
if (scoreBest > scoreMax)
{
scoreMax = scoreBest;
uPrefixLengthAMax = uPrefixLengthA;
uPrefixLengthBMax = uPrefixLengthB;
}
DPM(uPrefixLengthA, uPrefixLengthB) = scoreBest;
}
{
// Delete D=LetterA+GapB
SCORE scoreMD = DPM(uPrefixLengthA-1, uPrefixLengthB) +
PA[uPrefixLengthA-1].m_scoreGapOpen;
SCORE scoreDD = DPD(uPrefixLengthA-1, uPrefixLengthB);
SCORE scoreBest;
if (scoreMD >= scoreDD)
scoreBest = scoreMD;
else
{
assert(scoreDD >= scoreMD);
scoreBest = scoreDD;
}
DPD(uPrefixLengthA, uPrefixLengthB) = scoreBest;
}
// Insert I=GapA+LetterB
{
SCORE scoreMI = DPM(uPrefixLengthA, uPrefixLengthB-1) +
PB[uPrefixLengthB - 1].m_scoreGapOpen;
SCORE scoreII = DPI(uPrefixLengthA, uPrefixLengthB-1);
SCORE scoreBest;
if (scoreMI >= scoreII)
scoreBest = scoreMI;
else
{
assert(scoreII > scoreMI);
scoreBest = scoreII;
}
DPI(uPrefixLengthA, uPrefixLengthB) = scoreBest;
}
scoreGapCloseA = PPA.m_scoreGapClose;
}
scoreGapCloseB = PPB.m_scoreGapClose;
}
#if TRACE
Log("DPM:\n");
ListDP(DPM_, PA, PB, uPrefixLengthA, uPrefixLengthB);
Log("DPD:\n");
ListDP(DPD_, PA, PB, uPrefixLengthA, uPrefixLengthB);
Log("DPI:\n");
ListDP(DPI_, PA, PB, uPrefixLengthA, uPrefixLengthB);
#endif
assert(scoreMax == DPM(uPrefixLengthAMax, uPrefixLengthBMax));
TraceBackSW(PA, uLengthA, PB, uLengthB, DPM_, DPD_, DPI_,
uPrefixLengthAMax, uPrefixLengthBMax, Path);
#if TRACE
SCORE scorePath = FastScorePath2(PA, uLengthA, PB, uLengthB, Path);
Path.LogMe();
Log("Score = %s Path = %s\n", LocalScoreToStr(scoreMax), LocalScoreToStr(scorePath));
#endif
delete[] DPM_;
delete[] DPD_;
delete[] DPI_;
return scoreMax;
}
示例5: TraceBackDimer
static SCORE TraceBackDimer( const SCORE *DPM_, const SCORE *DPD_, const SCORE *DPI_,
const char *TBM_, const char *TBD_, const char *TBI_,
unsigned uLengthA, unsigned uLengthB, PWPath &Path)
{
const unsigned uPrefixCountA = uLengthA + 1;
unsigned uPrefixLengthA = uLengthA;
unsigned uPrefixLengthB = uLengthB;
char cEdge = 'M';
SCORE scoreMax = DPM(uLengthA, uLengthB);
if (DPD(uLengthA, uLengthB) > scoreMax)
{
scoreMax = DPD(uLengthA, uLengthB);
cEdge = 'D';
}
if (DPI(uLengthA, uLengthB) > scoreMax)
{
scoreMax = DPI(uLengthA, uLengthB);
cEdge = 'I';
}
for (;;)
{
if (0 == uPrefixLengthA && 0 == uPrefixLengthB)
break;
PWEdge Edge;
Edge.cType = cEdge;
Edge.uPrefixLengthA = uPrefixLengthA;
Edge.uPrefixLengthB = uPrefixLengthB;
Path.PrependEdge(Edge);
#if TRACE
Log("PLA=%u PLB=%u Edge=%c\n", uPrefixLengthA, uPrefixLengthB, cEdge);
#endif
switch (cEdge)
{
case 'M':
assert(uPrefixLengthA > 0 && uPrefixLengthB > 0);
cEdge = TBM(uPrefixLengthA, uPrefixLengthB);
--uPrefixLengthA;
--uPrefixLengthB;
break;
case 'D':
assert(uPrefixLengthA > 0);
cEdge = TBD(uPrefixLengthA, uPrefixLengthB);
--uPrefixLengthA;
break;
case 'I':
assert(uPrefixLengthB > 0);
cEdge = TBI(uPrefixLengthA, uPrefixLengthB);
--uPrefixLengthB;
break;
default:
Quit("Invalid edge PLA=%u PLB=%u %c", uPrefixLengthA, uPrefixLengthB, cEdge);
}
}
#if TRACE
Path.LogMe();
#endif
return scoreMax;
}
示例6: GlobalAlignDiags
SCORE GlobalAlignDiags(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,
unsigned uLengthB, PWPath &Path)
{
#if LIST_DIAGS
TICKS t1 = GetClockTicks();
#endif
DiagList DL;
if (ALPHA_Amino == g_Alpha)
FindDiags(PA, uLengthA, PB, uLengthB, DL);
else if (ALPHA_DNA == g_Alpha || ALPHA_RNA == g_Alpha)
FindDiagsNuc(PA, uLengthA, PB, uLengthB, DL);
else
Quit("GlobalAlignDiags: bad alpha");
#if TRACE
Log("GlobalAlignDiags, diag list:\n");
DL.LogMe();
#endif
DL.Sort();
DL.DeleteIncompatible();
#if TRACE
Log("After DeleteIncompatible:\n");
DL.LogMe();
#endif
MergeDiags(DL);
#if TRACE
Log("After MergeDiags:\n");
DL.LogMe();
#endif
DPRegionList RL;
DiagListToDPRegionList(DL, RL, uLengthA, uLengthB);
#if TRACE
Log("RegionList:\n");
RL.LogMe();
#endif
#if LIST_DIAGS
{
TICKS t2 = GetClockTicks();
unsigned uArea = RL.GetDPArea();
Log("ticks=%ld\n", (long) (t2 - t1));
Log("area=%u\n", uArea);
}
#endif
g_dDPAreaWithoutDiags += uLengthA*uLengthB;
double dDPAreaWithDiags = 0.0;
const unsigned uRegionCount = RL.GetCount();
for (unsigned uRegionIndex = 0; uRegionIndex < uRegionCount; ++uRegionIndex)
{
const DPRegion &r = RL.Get(uRegionIndex);
PWPath RegPath;
if (DPREGIONTYPE_Diag == r.m_Type)
{
DiagToPath(r.m_Diag, RegPath);
#if TRACE_PATH
Log("DiagToPath, path=\n");
RegPath.LogMe();
#endif
}
else if (DPREGIONTYPE_Rect == r.m_Type)
{
const unsigned uRegStartPosA = r.m_Rect.m_uStartPosA;
const unsigned uRegStartPosB = r.m_Rect.m_uStartPosB;
const unsigned uRegLengthA = r.m_Rect.m_uLengthA;
const unsigned uRegLengthB = r.m_Rect.m_uLengthB;
const ProfPos *RegPA = PA + uRegStartPosA;
const ProfPos *RegPB = PB + uRegStartPosB;
dDPAreaWithDiags += uRegLengthA*uRegLengthB;
GlobalAlignNoDiags(RegPA, uRegLengthA, RegPB, uRegLengthB, RegPath);
#if TRACE_PATH
Log("GlobalAlignNoDiags RegPath=\n");
RegPath.LogMe();
#endif
OffsetPath(RegPath, uRegStartPosA, uRegStartPosB);
#if TRACE_PATH
Log("After offset path, RegPath=\n");
RegPath.LogMe();
#endif
}
else
Quit("GlobalAlignDiags, Invalid region type %u", r.m_Type);
AppendRegPath(Path, RegPath);
#if TRACE_PATH
Log("After AppendPath, path=");
Path.LogMe();
#endif
}
//.........这里部分代码省略.........