]> git.donarmstrong.com Git - mothur.git/commitdiff
added classify.otu command
authorwestcott <westcott>
Wed, 2 Jun 2010 14:03:39 +0000 (14:03 +0000)
committerwestcott <westcott>
Wed, 2 Jun 2010 14:03:39 +0000 (14:03 +0000)
Mothur.xcodeproj/project.pbxproj
classifyotucommand.cpp
classifyotucommand.h
classifyseqscommand.cpp
commandfactory.cpp
makefile

index 9a61c6caf688ba4dace1673e9d4a26e4be656e16..1736df4d155f138f0fa532e212ba758b0a6d0c3d 100644 (file)
@@ -36,6 +36,8 @@
                A7825503116519F70002E2DD /* chimerabellerophoncommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimerabellerophoncommand.cpp; sourceTree = "<group>"; };
                A78434881162224F00100BE0 /* chimeraccodecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimeraccodecommand.h; sourceTree = "<group>"; };
                A78434891162224F00100BE0 /* chimeraccodecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimeraccodecommand.cpp; sourceTree = "<group>"; };
+               A7BBDA7B11B5694E006E6551 /* classifyotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = classifyotucommand.h; sourceTree = "<group>"; };
+               A7BBDA7C11B5694E006E6551 /* classifyotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = classifyotucommand.cpp; sourceTree = "<group>"; };
                A7D215C811996C6E00F13F13 /* clearcutcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clearcutcommand.h; sourceTree = "<group>"; };
                A7D215C911996C6E00F13F13 /* clearcutcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clearcutcommand.cpp; sourceTree = "<group>"; };
                A7D216061199C47F00F13F13 /* catchallcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catchallcommand.h; sourceTree = "<group>"; };
                                A73953DB11987ED100B0B160 /* chopseqscommand.cpp */,
                                A7DA201E113FECD400BF472F /* classifyseqscommand.h */,
                                A7DA201D113FECD400BF472F /* classifyseqscommand.cpp */,
+                               A7BBDA7B11B5694E006E6551 /* classifyotucommand.h */,
+                               A7BBDA7C11B5694E006E6551 /* classifyotucommand.cpp */,
                                A7D215C811996C6E00F13F13 /* clearcutcommand.h */,
                                A7D215C911996C6E00F13F13 /* clearcutcommand.cpp */,
                                A7DA2021113FECD400BF472F /* clustercommand.cpp */,
                                A7DA205D113FECD400BF472F /* getlabelcommand.h */,
                                A7DA205E113FECD400BF472F /* getlistcountcommand.cpp */,
                                A7DA205F113FECD400BF472F /* getlistcountcommand.h */,
-                               A7DA2060113FECD400BF472F /* getoturepcommand.cpp */,
                                A7DA2061113FECD400BF472F /* getoturepcommand.h */,
+                               A7DA2060113FECD400BF472F /* getoturepcommand.cpp */,
                                A7DA2062113FECD400BF472F /* getrabundcommand.cpp */,
                                A7DA2063113FECD400BF472F /* getrabundcommand.h */,
                                A7DA2064113FECD400BF472F /* getsabundcommand.cpp */,
index 5e7e78744e766d778bb9d6ce04fe244735fc81a3..94a60d4db9ff198423a401b74cbb7e78e9c010a5 100644 (file)
@@ -118,8 +118,8 @@ void ClassifyOtuCommand::help(){
                m->mothurOut("The name parameter allows you add a names file with your taxonomy file.\n");
                m->mothurOut("The label parameter allows you to select what distance levels you would like a output files created for, and is separated by dashes.\n");
                m->mothurOut("The default value for label is all labels in your inputfile.\n");
-               m->mothurOut("The cutoff parameter allows you to specify a concensus confidence threshold for your taxonomy.  The default is 51, meaning 51%. Cutoff cannot be below 51.\n");
-               m->mothurOut("The probs parameter shuts off the outputting of the concensus confidence results. The default is true, meaning you want the confidence to be shown.\n");
+               m->mothurOut("The cutoff parameter allows you to specify a consensus confidence threshold for your taxonomy.  The default is 51, meaning 51%. Cutoff cannot be below 51.\n");
+               m->mothurOut("The probs parameter shuts off the outputting of the consensus confidence results. The default is true, meaning you want the confidence to be shown.\n");
                m->mothurOut("The classify.otu command should be in the following format: classify.otu(taxonomy=yourTaxonomyFile, list=yourListFile, name=yourNamesFile, label=yourLabels).\n");
                m->mothurOut("Example classify.otu(taxonomy=abrecovery.silva.full.taxonomy, list=abrecovery.fn.list, label=0.10).\n");
                m->mothurOut("Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n\n");
@@ -293,7 +293,7 @@ int ClassifyOtuCommand::readTaxonomyFile() {
        }
 }
 //**********************************************************************************************************************
-string ClassifyOtuCommand::findConcensusTaxonomy(int bin, ListVector* thisList, int& size) {
+string ClassifyOtuCommand::findConsensusTaxonomy(int bin, ListVector* thisList, int& size) {
        try{
                string conTax = "";
                vector<string> names;
@@ -316,7 +316,7 @@ string ClassifyOtuCommand::findConcensusTaxonomy(int bin, ListVector* thisList,
                        it = taxMap.find(names[i]);
                        
                        if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
-                               m->mothurOut(names[i] + " is not in your taxonomy file.  I will not include it in the concensus."); m->mothurOutEndLine();
+                               m->mothurOut(names[i] + " is not in your taxonomy file.  I will not include it in the consensus."); m->mothurOutEndLine();
                        }else{
                                
                                //if namesfile include the names
@@ -325,7 +325,7 @@ string ClassifyOtuCommand::findConcensusTaxonomy(int bin, ListVector* thisList,
                                        it2 = nameMap.find(names[i]);
                                        
                                        if (it2 == nameMap.end()) { //this name is not in name file, skip it
-                                               m->mothurOut(names[i] + " is not in your name file.  I will not include it in the concensus."); m->mothurOutEndLine();
+                                               m->mothurOut(names[i] + " is not in your name file.  I will not include it in the consensus."); m->mothurOutEndLine();
                                        }else{
                                                
                                                vector<string> nameFileNames;
@@ -371,11 +371,11 @@ string ClassifyOtuCommand::findConcensusTaxonomy(int bin, ListVector* thisList,
                        }
                                
                        //is this taxonomy above cutoff
-                       int concensusConfidence = ceil((bestChildSize / (float) size) * 100);
+                       int consensusConfidence = ceil((bestChildSize / (float) size) * 100);
                        
-                       if (concensusConfidence >= cutoff) { //if yes, add it
+                       if (consensusConfidence >= cutoff) { //if yes, add it
                                if (probs) {
-                                       conTax += bestChild.name + "(" + toString(concensusConfidence) + ");";
+                                       conTax += bestChild.name + "(" + toString(consensusConfidence) + ");";
                                }else{
                                        conTax += bestChild.name + ";";
                                }
@@ -396,7 +396,7 @@ string ClassifyOtuCommand::findConcensusTaxonomy(int bin, ListVector* thisList,
                        
        }
        catch(exception& e) {
-               m->errorOut(e, "ClassifyOtuCommand", "findConcensusTaxonomy");
+               m->errorOut(e, "ClassifyOtuCommand", "findConsensusTaxonomy");
                exit(1);
        }
 }
@@ -417,7 +417,7 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                
                //for each bin in the list vector
                for (int i = 0; i < processList->getNumBins(); i++) {
-                       conTax  = findConcensusTaxonomy(i, processList, size);
+                       conTax  = findConsensusTaxonomy(i, processList, size);
                        
                        if (m->control_pressed) { out.close();  return 0; }
                        
index 0ac0288e5bcf1d8879105295e41ad632fce1bdf1..1077781e59b998892d699bf09b34c897a0a15375 100644 (file)
@@ -39,7 +39,7 @@ private:
        int readTaxonomyFile();
        void removeConfidences(string&);
        int process(ListVector*);
-       string findConcensusTaxonomy(int, ListVector*, int&);   // returns the name of the "representative" taxonomy of given bin
+       string findConsensusTaxonomy(int, ListVector*, int&);   // returns the name of the "representative" taxonomy of given bin
        
                                                                                                
 };
index 7d015a85aed7e084926a918888f6e5ee761228cc..e5c04949905d7edd6ba5ec45f4fd5a8214053471 100644 (file)
@@ -320,7 +320,7 @@ void ClassifySeqsCommand::help(){
                m->mothurOut("The gapextend parameter allows you to specify the penalty for extending a gap in an alignment.  The default is -1.0.\n");
                m->mothurOut("The numwanted parameter allows you to specify the number of sequence matches you want with the knn method.  The default is 10.\n");
                m->mothurOut("The cutoff parameter allows you to specify a bootstrap confidence threshold for your taxonomy.  The default is 0.\n");
-               m->mothurOut("The probs parameter shut off the bootstrapping results for the bayesian method. The default is true, meaning you want the bootstrapping to be run.\n");
+               m->mothurOut("The probs parameter shuts off the bootstrapping results for the bayesian method. The default is true, meaning you want the bootstrapping to be shown.\n");
                m->mothurOut("The iters parameter allows you to specify how many iterations to do when calculating the bootstrap confidence score for your taxonomy with the bayesian method.  The default is 100.\n");
                m->mothurOut("The classify.seqs command should be in the following format: \n");
                m->mothurOut("classify.seqs(template=yourTemplateFile, fasta=yourFastaFile, method=yourClassificationMethod, search=yourSearchmethod, ksize=yourKmerSize, taxonomy=yourTaxonomyFile, processors=yourProcessors) \n");
index a40c432f54d18c19e549e9370253fb52dd9ddfa3..bd519eebfd6eaa24134dad9ac08f2193004e6386 100644 (file)
@@ -79,6 +79,7 @@
 #include "catchallcommand.h"
 #include "splitabundcommand.h"
 #include "clustersplitcommand.h"
+#include "classifyotucommand.h"
 
 /*******************************************************/
 
@@ -165,6 +166,7 @@ CommandFactory::CommandFactory(){
        commands["catchall"]                    = "catchall";
        commands["split.abund"]                 = "split.abund";
        commands["cluster.split"]               = "cluster.split";
+       commands["classify.otu"]                = "classify.otu";
        commands["classify.seqs"]               = "MPIEnabled"; 
        commands["dist.seqs"]                   = "MPIEnabled";
        commands["filter.seqs"]                 = "MPIEnabled";
@@ -288,6 +290,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString){
                else if(commandName == "catchall")                              {       command = new CatchAllCommand(optionString);                            }
                else if(commandName == "split.abund")                   {       command = new SplitAbundCommand(optionString);                          }
                else if(commandName == "cluster.split")                 {       command = new ClusterSplitCommand(optionString);                        }
+               else if(commandName == "classify.otu")                  {       command = new ClassifyOtuCommand(optionString);                         }
                else                                                                                    {       command = new NoCommand(optionString);                                          }
 
                return command;
@@ -339,9 +342,9 @@ bool CommandFactory::isValidCommand(string command) {
 /***********************************************************************/
 void CommandFactory::printCommands(ostream& out) {
        try {   
-               out << "Valid commands are ";
+               out << "Valid commands are: ";
                for (it = commands.begin(); it != commands.end(); it++) {
-                       out << it->first << ", ";
+                       out << it->first << ",";
                }
                out << endl;
        }
index 0c5adac54141a6864ab5cf2a1565f58e92aeab38..a9732412c6168e2c5c9e2a8f0dabdd1a1fdcdbc9 100644 (file)
--- a/makefile
+++ b/makefile
@@ -26,7 +26,7 @@ ifeq  ($(strip $(USEREADLINE)),yes)
       -L../readline-6.0\r
 endif\r
 \r
-USEMPI ?= yes\r
+USEMPI ?= no\r
 \r
 ifeq  ($(strip $(USEMPI)),yes)\r
        CC = mpic++\r
@@ -224,6 +224,7 @@ mothur : \
                ./taxonomyequalizer.o\\r
                ./phylotypecommand.o\\r
                ./classifyseqscommand.o\\r
+               ./classifyotucommand.o\\r
                ./parsesffcommand.o\\r
                ./classify.o\\r
                ./phylotree.o\\r
@@ -432,6 +433,7 @@ mothur : \
                ./taxonomyequalizer.o\\r
                ./phylotypecommand.o\\r
                ./classifyseqscommand.o\\r
+               ./classifyotucommand.o\\r
                ./parsesffcommand.o\\r
                ./classify.o\\r
                ./phylotree.o\\r
@@ -643,6 +645,7 @@ clean :
                ./taxonomyequalizer.o\\r
                ./phylotypecommand.o\\r
                ./classifyseqscommand.o\\r
+               ./classifyotucommand.o\\r
                ./parsesffcommand.o\\r
                ./classify.o\\r
                ./phylotree.o\\r
@@ -1697,5 +1700,10 @@ install : mothur
 # Item # 207 -- splitmatrix --\r
 ./clustersplitcommand.o : clustersplitcommand.cpp\r
        $(CC) $(CC_OPTIONS) clustersplitcommand.cpp -c $(INCLUDE) -o ./clustersplitcommand.o\r
+       \r
+# Item # 207 -- splitmatrix --\r
+./classifyotucommand.o : classifyotucommand.cpp\r
+       $(CC) $(CC_OPTIONS) classifyotucommand.cpp -c $(INCLUDE) -o ./classifyotucommand.o\r
+\r
 \r
 ##### END RUN ####\r