void SetMSAWeightsMuscle(MSA &msa) { SEQWEIGHT Method = GetSeqWeightMethod(); switch (Method) { case SEQWEIGHT_None: msa.SetUniformWeights(); return; case SEQWEIGHT_Henikoff: msa.SetHenikoffWeights(); return; case SEQWEIGHT_HenikoffPB: msa.SetHenikoffWeightsPB(); return; case SEQWEIGHT_GSC: msa.SetGSCWeights(); return; case SEQWEIGHT_ClustalW: SetClustalWWeightsMuscle(msa); return; case SEQWEIGHT_ThreeWay: SetThreeWayWeightsMuscle(msa); return; } Quit("SetMSAWeightsMuscle, Invalid method=%d", Method); }
void SetMuscleTree(const Tree &tree) { g_ptrMuscleTree = &tree; if (SEQWEIGHT_ClustalW != GetSeqWeightMethod()) return; delete[] g_MuscleWeights; const unsigned uLeafCount = tree.GetLeafCount(); g_uMuscleIdCount = uLeafCount; g_MuscleWeights = new WEIGHT[uLeafCount]; CalcClustalWWeights(tree, g_MuscleWeights); }
void SetMuscleTree(const Tree &tree) { MuscleContext *ctx =getMuscleContext(); WEIGHT* &g_MuscleWeights = ctx->msa2.g_MuscleWeights; unsigned &g_uMuscleIdCount = ctx->msa2.g_uMuscleIdCount; const Tree* &g_ptrMuscleTree = ctx->msa2.g_ptrMuscleTree; g_ptrMuscleTree = &tree; if (SEQWEIGHT_ClustalW != GetSeqWeightMethod()) return; if(g_MuscleWeights!=NULL) { delete[] g_MuscleWeights; g_MuscleWeights = NULL; } const unsigned uLeafCount = tree.GetLeafCount(); g_uMuscleIdCount = uLeafCount; g_MuscleWeights = new WEIGHT[uLeafCount]; CalcClustalWWeights(tree, g_MuscleWeights); }
void DistPWScoreDist(const SeqVect &v, DistFunc &DF) { SEQWEIGHT SeqWeightSave = GetSeqWeightMethod(); SetSeqWeightMethod(SEQWEIGHT_Henikoff); const unsigned uSeqCount = v.Length(); DF.SetCount(uSeqCount); const unsigned uPairCount = (uSeqCount*(uSeqCount + 1))/2; unsigned uCount = 0; SetProgressDesc("PW ScoreDist"); for (unsigned uSeqIndex1 = 0; uSeqIndex1 < uSeqCount; ++uSeqIndex1) { const Seq &s1 = v.GetSeq(uSeqIndex1); MSA msa1; msa1.FromSeq(s1); for (unsigned uSeqIndex2 = 0; uSeqIndex2 < uSeqIndex1; ++uSeqIndex2) { if (0 == uCount%20) Progress(uCount, uPairCount); ++uCount; const Seq &s2 = v.GetSeq(uSeqIndex2); MSA msa2; msa2.FromSeq(s2); PWPath Path; MSA msaOut; AlignTwoMSAs(msa1, msa2, msaOut, Path, false, false); float d = (float) GetScoreDist(msaOut, 0, 1); DF.SetDist(uSeqIndex1, uSeqIndex2, d); } } ProgressStepsDone(); SetSeqWeightMethod(SeqWeightSave); }