X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treegroupscommand.cpp;h=637eccedfc77e74556de6bf3f201270b28874d96;hb=c6e5f84783b39a558119835963dec3c4facb0154;hp=eb3c33481d4ef68199f2b42e452ea93c1679bbf4;hpb=260ae19c36cb11a53ddc5a75b5e507f8dd8b31d6;p=mothur.git diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index eb3c334..637ecce 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -50,6 +50,8 @@ TreeGroupCommand::TreeGroupCommand(string option) { if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } } + globaldata->newRead(); + //if the user changes the input directory command factory will send this info to us in the output parameter string inputDir = validParameter.validFile(parameters, "inputdir", false); if (inputDir == "not found"){ inputDir = ""; } @@ -244,7 +246,8 @@ int TreeGroupCommand::execute(){ if (format == "sharedfile") { //if the users entered no valid calculators don't execute command if (treeCalculators.size() == 0) { m->mothurOut("You have given no valid calculators."); m->mothurOutEndLine(); return 0; } - + + if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap; globaldata->gGroupmap = NULL; } //you have groups read = new ReadOTUFile(globaldata->inputFileName); read->read(&*globaldata); @@ -258,17 +261,17 @@ int TreeGroupCommand::execute(){ //used in tree constructor globaldata->runParse = false; - //clear globaldatas old tree names if any - globaldata->Treenames.clear(); - - //fills globaldatas tree names - globaldata->Treenames = globaldata->Groups; - //create treemap class from groupmap for tree class to use tmap = new TreeMap(); tmap->makeSim(globaldata->gGroupmap); globaldata->gTreemap = tmap; + //clear globaldatas old tree names if any + globaldata->Treenames.clear(); + + //fills globaldatas tree names + globaldata->Treenames = globaldata->Groups; + if (m->control_pressed) { return 0; } //create tree file @@ -606,7 +609,7 @@ int TreeGroupCommand::process(vector thisLookup) { subset.push_back(thisLookup[k]); subset.push_back(thisLookup[l]); data = treeCalculators[i]->getValues(subset); //saves the calculator outputs - + //cout << thisLookup[k]->getGroup() << '\t' << thisLookup[l]->getGroup() << '\t' << (1.0 - data[0]) << endl; if (m->control_pressed) { return 1; } //save values in similarity matrix