// $Id: njGammaMain.cpp 674 2006-04-09 17:06:42Z ninio $ #include "tree.h" #include "sequenceContainer.h" #include "mainSemphy.h" #include "njGamma.h" #include "logFile.h" #include "treeUtil.h" #include "likeDist.h" #include "someUtil.h" #include #include using namespace std; int main(int argc,char* argv[]) { bool doPairwiseGammaMLDis = false; // do posterior. // bool doPairwiseGammaMLDis = true; bool withoutBBL = false; if (argc < 2) errorMsg::reportError("The program must get some parameters in the command line, use -h for help"); semphy_args_info args_info; if (semphy_cmdline_parser(argc, argv, &args_info) != 0) { errorMsg::reportError("error reading command line",1); } // we need a starting tree to get starting posterior probs. doPairwiseGammaMLDis=args_info.ADVNoPost_flag; args_info.optimizeAlpha_flag = 1; // true args_info.alpha_given = 1; mainSemphy ms(args_info); assert(ms.getStochasticProcess().categories() >1); ms.computeNJtree(); if (withoutBBL == false) { ms.optimizeBranchLengths(); // this will do both bbl and alpha. } else { ms.optimizeAlphaOnly(); } // ms._args_info.optimizeGamma_flag = 0; // stop doing alpha optimization. VVdouble posteriorProbVV; // pos * rate // now we need a distance table: MDOUBLE newL = VERYSMALL; MDOUBLE oldL = VERYSMALL; tree oldT = ms.getTree(); tree newT = ms.getTree(); const int maxNumIter = 50; bool converged = false; int iterNum=0; distanceMethod * disMethod; while ( !converged && iterNum vNames; ms.getDistanceTableAndNames(disTab,vNames,disMethod); LOG(10,<<"Distance table"<