From 92dde9a6d6c638fcbbd5dbaa5c79167564f90e49 Mon Sep 17 00:00:00 2001 From: westcott Date: Mon, 29 Jun 2009 14:52:33 +0000 Subject: [PATCH] fixed misspelling on consensus --- Mothur.xcodeproj/project.pbxproj | 12 ++--- bootstrapsharedcommand.cpp | 12 ++--- bootstrapsharedcommand.h | 4 +- commandfactory.cpp | 6 +-- concensuscommand.cpp => consensuscommand.cpp | 46 ++++++++++---------- concensuscommand.h => consensuscommand.h | 4 +- getgroupcommand.cpp | 2 +- 7 files changed, 43 insertions(+), 43 deletions(-) rename concensuscommand.cpp => consensuscommand.cpp (88%) rename concensuscommand.h => consensuscommand.h (97%) diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index b04bf2a..79629fc 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -55,7 +55,7 @@ 375AA1390F9E433D008EF9B8 /* readcolumn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375AA1330F9E433D008EF9B8 /* readcolumn.cpp */; }; 375AA13A0F9E433D008EF9B8 /* readotu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375AA1350F9E433D008EF9B8 /* readotu.cpp */; }; 375AA13B0F9E433D008EF9B8 /* readphylip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375AA1370F9E433D008EF9B8 /* readphylip.cpp */; }; - 377326650FAF16E0007ABB8B /* concensuscommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377326630FAF16E0007ABB8B /* concensuscommand.cpp */; }; + 377326650FAF16E0007ABB8B /* consensuscommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377326630FAF16E0007ABB8B /* consensuscommand.cpp */; }; 378598660FDD497000EF9D03 /* heatmapsimcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378598650FDD497000EF9D03 /* heatmapsimcommand.cpp */; }; 378598740FDD4C1500EF9D03 /* heatmapsim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378598730FDD4C1500EF9D03 /* heatmapsim.cpp */; }; 378599100FDD7E8E00EF9D03 /* optionparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3785990F0FDD7E8E00EF9D03 /* optionparser.cpp */; }; @@ -273,8 +273,8 @@ 375AA1360F9E433D008EF9B8 /* readotu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotu.h; sourceTree = SOURCE_ROOT; }; 375AA1370F9E433D008EF9B8 /* readphylip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readphylip.cpp; sourceTree = SOURCE_ROOT; }; 375AA1380F9E433D008EF9B8 /* readphylip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readphylip.h; sourceTree = SOURCE_ROOT; }; - 377326630FAF16E0007ABB8B /* concensuscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = concensuscommand.cpp; sourceTree = SOURCE_ROOT; }; - 377326640FAF16E0007ABB8B /* concensuscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = concensuscommand.h; sourceTree = SOURCE_ROOT; }; + 377326630FAF16E0007ABB8B /* consensuscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = consensuscommand.cpp; sourceTree = ""; }; + 377326640FAF16E0007ABB8B /* consensuscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = consensuscommand.h; sourceTree = ""; }; 378598640FDD497000EF9D03 /* heatmapsimcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = heatmapsimcommand.h; sourceTree = SOURCE_ROOT; }; 378598650FDD497000EF9D03 /* heatmapsimcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = heatmapsimcommand.cpp; sourceTree = SOURCE_ROOT; }; 378598720FDD4C1500EF9D03 /* heatmapsim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = heatmapsim.h; sourceTree = SOURCE_ROOT; }; @@ -753,8 +753,8 @@ 37D927C70F21331F001D4494 /* collectcommand.cpp */, 37D927CC0F21331F001D4494 /* collectsharedcommand.h */, 37D927CB0F21331F001D4494 /* collectsharedcommand.cpp */, - 377326640FAF16E0007ABB8B /* concensuscommand.h */, - 377326630FAF16E0007ABB8B /* concensuscommand.cpp */, + 377326640FAF16E0007ABB8B /* consensuscommand.h */, + 377326630FAF16E0007ABB8B /* consensuscommand.cpp */, 37B28F660F27590100808A62 /* deconvolutecommand.h */, 37B28F670F27590100808A62 /* deconvolutecommand.cpp */, 37C753CC0FB3415200DBD02E /* distancecommand.h */, @@ -1066,7 +1066,7 @@ 375AA13B0F9E433D008EF9B8 /* readphylip.cpp in Sources */, 7EC3D4550FA0FFF900338DA5 /* coverage.cpp in Sources */, 7EC3D4560FA0FFF900338DA5 /* whittaker.cpp in Sources */, - 377326650FAF16E0007ABB8B /* concensuscommand.cpp in Sources */, + 377326650FAF16E0007ABB8B /* consensuscommand.cpp in Sources */, 378C1B030FB0644E004D63F5 /* filterseqscommand.cpp in Sources */, 378C1B040FB0644E004D63F5 /* goodscoverage.cpp in Sources */, 378C1B0A0FB0644E004D63F5 /* sequencedb.cpp in Sources */, diff --git a/bootstrapsharedcommand.cpp b/bootstrapsharedcommand.cpp index 1fa968f..db1fa9e 100644 --- a/bootstrapsharedcommand.cpp +++ b/bootstrapsharedcommand.cpp @@ -440,7 +440,7 @@ void BootSharedCommand::process(SharedOrderVector* order) { //creates tree from similarity matrix and write out file createTree(out[i], tempTree); - //save trees for concensus command. + //save trees for consensus command. trees[i].push_back(tempTree); } } @@ -451,18 +451,18 @@ void BootSharedCommand::process(SharedOrderVector* order) { globaldata->clear(); - //create concensus trees for each bootstrapped tree set + //create consensus trees for each bootstrapped tree set for (int k = 0; k < trees.size(); k++) { - mothurOut("Generating concensus tree for " + treeCalculators[k]->getName()); mothurOutEndLine(); + mothurOut("Generating consensus tree for " + treeCalculators[k]->getName()); mothurOutEndLine(); //set global data to calc trees globaldata->gTree = trees[k]; string filename = getRootName(globaldata->inputFileName) + treeCalculators[k]->getName() + ".boot" + order->getLabel(); - concensus = new ConcensusCommand(filename); - concensus->execute(); - delete concensus; + consensus = new ConcensusCommand(filename); + consensus->execute(); + delete consensus; //delete globaldata's tree for (int m = 0; m < globaldata->gTree.size(); m++) { delete globaldata->gTree[m]; } diff --git a/bootstrapsharedcommand.h b/bootstrapsharedcommand.h index ee393f9..cf68e00 100644 --- a/bootstrapsharedcommand.h +++ b/bootstrapsharedcommand.h @@ -19,7 +19,7 @@ #include "tree.h" #include "treemap.h" #include "sharedutilities.h" -#include "concensuscommand.h" +#include "consensuscommand.h" class GlobalData; @@ -43,7 +43,7 @@ private: TreeMap* tmap; Tree* t; Tree* tempTree; - ConcensusCommand* concensus; + ConcensusCommand* consensus; vector< vector > trees; //a vector of trees for each calculator chosen vector treeCalculators; vector out; diff --git a/commandfactory.cpp b/commandfactory.cpp index 3ad7425..43f6769 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -38,7 +38,7 @@ #include "getoturepcommand.h" #include "treegroupscommand.h" #include "bootstrapsharedcommand.h" -//#include "concensuscommand.h" +//#include "consensuscommand.h" #include "distancecommand.h" #include "aligncommand.h" #include "matrixoutputcommand.h" @@ -88,7 +88,7 @@ CommandFactory::CommandFactory(){ commands["get.sabund"] = "get.sabund"; commands["get.rabund"] = "get.rabund"; commands["bootstrap.shared"] = "bootstrap.shared"; - //commands["concensus"] = "concensus"; + //commands["consensus"] = "consensus"; commands["help"] = "help"; commands["filter.seqs"] = "filter.seqs"; commands["align.seqs"] = "align.seqs"; @@ -145,7 +145,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ else if(commandName == "tree.shared") { command = new TreeGroupCommand(optionString); } else if(commandName == "dist.shared") { command = new MatrixOutputCommand(optionString); } else if(commandName == "bootstrap.shared") { command = new BootSharedCommand(optionString); } - //else if(commandName == "concensus") { command = new ConcensusCommand(optionString); } + //else if(commandName == "consensus") { command = new ConcensusCommand(optionString); } else if(commandName == "dist.seqs") { command = new DistanceCommand(optionString); } else if(commandName == "align.seqs") { command = new AlignCommand(optionString); } else if(commandName == "summary.seqs") { command = new SeqSummaryCommand(optionString); } diff --git a/concensuscommand.cpp b/consensuscommand.cpp similarity index 88% rename from concensuscommand.cpp rename to consensuscommand.cpp index 37609c3..9a90219 100644 --- a/concensuscommand.cpp +++ b/consensuscommand.cpp @@ -1,5 +1,5 @@ /* - * concensuscommand.cpp + * consensuscommand.cpp * Mothur * * Created by Sarah Westcott on 4/29/09. @@ -7,7 +7,7 @@ * */ -#include "concensuscommand.h" +#include "consensuscommand.h" //********************************************************************************************************************** @@ -21,10 +21,10 @@ ConcensusCommand::ConcensusCommand(string fileroot){ //if(option == "help") { help(); abort = true; } //else { - //if (option != "") { mothurOut("There are no valid parameters for the concensus command."); mothurOutEndLine(); abort = true; } + //if (option != "") { mothurOut("There are no valid parameters for the consensus command."); mothurOutEndLine(); abort = true; } // //no trees were read - // if (globaldata->gTree.size() == 0) { mothurOut("You must execute the read.tree command, before you may use the concensus command."); mothurOutEndLine(); abort = true; } + // if (globaldata->gTree.size() == 0) { mothurOut("You must execute the read.tree command, before you may use the consensus command."); mothurOutEndLine(); abort = true; } //else { t = globaldata->gTree; // } @@ -40,13 +40,13 @@ ConcensusCommand::ConcensusCommand(string fileroot){ void ConcensusCommand::help(){ try { - mothurOut("The concensus command can only be executed after a successful read.tree command.\n"); - mothurOut("The concensus command has no parameters.\n"); - mothurOut("The concensus command should be in the following format: concensus().\n"); - mothurOut("The concensus command output two files: .concensus.tre and .concensuspairs.\n"); - mothurOut("The .concensus.tre file contains the concensus tree of the trees in your input file.\n"); + mothurOut("The consensus command can only be executed after a successful read.tree command.\n"); + mothurOut("The consensus command has no parameters.\n"); + mothurOut("The consensus command should be in the following format: consensus().\n"); + mothurOut("The consensus command output two files: .consensus.tre and .consensuspairs.\n"); + mothurOut("The .consensus.tre file contains the consensus tree of the trees in your input file.\n"); mothurOut("The branch lengths are the percentage of trees in your input file that had the given pair.\n"); - mothurOut("The .concensuspairs file contains a list of the internal nodes in your tree. For each node, the pair that was used in the concensus tree \n"); + mothurOut("The .consensuspairs file contains a list of the internal nodes in your tree. For each node, the pair that was used in the consensus tree \n"); mothurOut("is reported with its percentage, as well as the other pairs that were seen for that node but not used and their percentages.\n\n"); } catch(exception& e) { @@ -74,10 +74,10 @@ int ConcensusCommand::execute(){ getSets(); //open file for pairing not included in the tree - notIncluded = filename + ".concensuspairs"; + notIncluded = filename + ".cons.pairs"; openOutputFile(notIncluded, out2); - concensusTree = new Tree(); + consensusTree = new Tree(); it2 = nodePairs.find(treeSet); @@ -91,7 +91,7 @@ int ConcensusCommand::execute(){ buildConcensusTree(treeSet); - concensusTree->assembleTree(); + consensusTree->assembleTree(); //output species in order out2 << "Species in Order: " << endl << endl; @@ -99,7 +99,7 @@ int ConcensusCommand::execute(){ vector temp; //output sets included - out2 << endl << "Sets included in the concensus tree:" << endl << endl; + out2 << endl << "Sets included in the consensus tree:" << endl << endl; for (it2 = nodePairsInTree.begin(); it2 != nodePairsInTree.end(); it2++) { //only output pairs not leaves if (it2->first.size() > 1) { @@ -123,7 +123,7 @@ int ConcensusCommand::execute(){ } //output sets not included - out2 << endl << "Sets NOT included in the concensus tree:" << endl << endl; + out2 << endl << "Sets NOT included in the consensus tree:" << endl << endl; for (it2 = nodePairs.begin(); it2 != nodePairs.end(); it2++) { temp.clear(); //initialize temp to all "." @@ -146,11 +146,11 @@ int ConcensusCommand::execute(){ outputFile = filename + ".cons.tre"; openOutputFile(outputFile, out); - concensusTree->printForBoot(out); + consensusTree->printForBoot(out); out.close(); out2.close(); - delete concensusTree; + delete consensusTree; return 0; } @@ -169,7 +169,7 @@ int ConcensusCommand::buildConcensusTree(vector nodeSet) { //if you are at a leaf if (nodeSet.size() == 1) { //return the vector index of the leaf you are at - return concensusTree->getIndex(nodeSet[0]); + return consensusTree->getIndex(nodeSet[0]); //terminate recursion }else if (count == numNodes) { return 0; } else { @@ -177,10 +177,10 @@ int ConcensusCommand::buildConcensusTree(vector nodeSet) { rightChildSet = getRestSet(nodeSet, leftChildSet); int left = buildConcensusTree(leftChildSet); int right = buildConcensusTree(rightChildSet); - concensusTree->tree[count].setChildren(left, right); - concensusTree->tree[count].setLabel(nodePairsInTree[nodeSet]); - concensusTree->tree[left].setParent(count); - concensusTree->tree[right].setParent(count); + consensusTree->tree[count].setChildren(left, right); + consensusTree->tree[count].setLabel(nodePairsInTree[nodeSet]); + consensusTree->tree[left].setParent(count); + consensusTree->tree[right].setParent(count); count++; return (count-1); } @@ -221,7 +221,7 @@ void ConcensusCommand::getSets() { } } - //add each leaf to terminate recursion in concensus + //add each leaf to terminate recursion in consensus //you want the leaves in there but with insignifigant sightings value so it is added last //for each leaf node get descendant info. for (int j = 0; j < numLeaves; j++) { diff --git a/concensuscommand.h b/consensuscommand.h similarity index 97% rename from concensuscommand.h rename to consensuscommand.h index 7b4aa27..53b8094 100644 --- a/concensuscommand.h +++ b/consensuscommand.h @@ -1,7 +1,7 @@ #ifndef CONCENSUSCOMMAND_H #define CONCENSUSCOMMAND_H /* - * concensuscommand.h + * consensuscommand.h * Mothur * * Created by Sarah Westcott on 4/29/09. @@ -28,7 +28,7 @@ private: GlobalData* globaldata; SharedUtil* util; vector t; - Tree* concensusTree; + Tree* consensusTree; bool abort; vector treeSet; //set containing all members of the tree to start recursion. filled in getSets(). map< vector, int > nodePairs; //