X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treegroupscommand.cpp;h=4a77211d2bd5e8d90585a9f19e6383db6e5f16fc;hb=03dca3b32a903c3f29fbcf5b410b19d6ab6dae63;hp=0150a7a4cd49eb490ba7a208ce4f74fb691b3e92;hpb=82723a54e6109e2d46d84c10e87727cebd5a18ea;p=mothur.git diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 0150a7a..4a77211 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -482,9 +482,9 @@ int TreeGroupCommand::execute(){ Tree* TreeGroupCommand::createTree(vector< vector >& simMatrix){ try { //create tree - t = new Tree(tmap); + t = new Tree(tmap, simMatrix); - //initialize index + /* //initialize index map index; //maps row in simMatrix to vector index in the tree for (int g = 0; g < numGroups; g++) { index[g] = g; } @@ -544,7 +544,7 @@ Tree* TreeGroupCommand::createTree(vector< vector >& simMatrix){ //adjust tree to make sure root to tip length is .5 int root = t->findRoot(); t->tree[root].setBranchLength((0.5 - t->tree[root].getLengthToLeaves())); - + */ //assemble tree t->assembleTree(); @@ -1004,11 +1004,13 @@ int TreeGroupCommand::process(vector thisLookup) { if (m->control_pressed) { for (int k = 0; k < trees.size(); k++) { delete trees[k]; } } Consensus consensus; + //clear old tree names if any + m->Treenames.clear(); m->Treenames = m->getGroups(); //may have changed if subsample eliminated groups Tree* conTree = consensus.getTree(trees, tmap); //create a new filename string conFile = outputDir + m->getRootName(m->getSimpleName(inputfile)) + treeCalculators[i]->getName() + "." + thisLookup[0]->getLabel() + ".cons.tre"; - outputNames.push_back(conFile); outputTypes["tree"].push_back(outputFile); + outputNames.push_back(conFile); outputTypes["tree"].push_back(conFile); ofstream outTree; m->openOutputFile(conFile, outTree);