]> git.donarmstrong.com Git - mothur.git/commitdiff
changed added group output to indicator command. a few changes to work with the guy
authorSarah Westcott <mothur.westcott@gmail.com>
Tue, 6 Nov 2012 15:23:48 +0000 (10:23 -0500)
committerSarah Westcott <mothur.westcott@gmail.com>
Tue, 6 Nov 2012 15:23:48 +0000 (10:23 -0500)
28 files changed:
Mothur.xcodeproj/project.pbxproj
chopseqscommand.cpp
classifyotucommand.cpp
classifyotucommand.h
clustersplitcommand.cpp
clustersplitcommand.h
consensusseqscommand.cpp
countseqscommand.cpp
degapseqscommand.cpp
distancecommand.cpp
getgroupcommand.cpp
getrabundcommand.cpp
getsabundcommand.cpp
indicatorcommand.cpp
indicatorcommand.h
listseqscommand.cpp
makegroupcommand.cpp
mergefilecommand.cpp
otuhierarchycommand.cpp
pairwiseseqscommand.cpp
parsefastaqcommand.cpp
reversecommand.cpp
secondarystructurecommand.cpp
sensspeccommand.cpp
seqsummarycommand.cpp
subsamplecommand.h
summaryqualcommand.cpp
summarytaxcommand.cpp

index d360d2f49414c2b60fc79c32de09c7e7345ac265..064019cb0e6b56f19eb6a3d1f2280f8505c8c33b 100644 (file)
                A76CDD7F1510F09A004C8458 /* pcrseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pcrseqscommand.h; sourceTree = "<group>"; };
                A76CDD811510F143004C8458 /* prcseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prcseqscommand.cpp; sourceTree = "<group>"; };
                A7730EFD13967241007433A3 /* countseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = countseqscommand.h; sourceTree = "<group>"; };
-               A7730EFE13967241007433A3 /* countseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = countseqscommand.cpp; sourceTree = "<group>"; };
+               A7730EFE13967241007433A3 /* countseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = countseqscommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A774101214695AF60098E6AC /* shhhseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shhhseqscommand.h; sourceTree = "<group>"; };
                A774101314695AF60098E6AC /* shhhseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shhhseqscommand.cpp; sourceTree = "<group>"; };
                A774104614696F320098E6AC /* myseqdist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = myseqdist.cpp; sourceTree = "<group>"; };
                A7E9B68912D37EC400DA6239 /* chimeraslayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimeraslayer.h; sourceTree = "<group>"; };
                A7E9B68A12D37EC400DA6239 /* chimeraslayercommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimeraslayercommand.cpp; sourceTree = "<group>"; };
                A7E9B68B12D37EC400DA6239 /* chimeraslayercommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimeraslayercommand.h; sourceTree = "<group>"; };
-               A7E9B68C12D37EC400DA6239 /* chopseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chopseqscommand.cpp; sourceTree = "<group>"; };
+               A7E9B68C12D37EC400DA6239 /* chopseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = chopseqscommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B68D12D37EC400DA6239 /* chopseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chopseqscommand.h; sourceTree = "<group>"; };
                A7E9B68E12D37EC400DA6239 /* classify.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = classify.cpp; sourceTree = "<group>"; };
                A7E9B68F12D37EC400DA6239 /* classify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = classify.h; sourceTree = "<group>"; };
                A7E9B6B412D37EC400DA6239 /* completelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = completelinkage.cpp; sourceTree = SOURCE_ROOT; };
                A7E9B6B512D37EC400DA6239 /* consensus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = consensus.cpp; sourceTree = "<group>"; };
                A7E9B6B612D37EC400DA6239 /* consensus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = consensus.h; sourceTree = "<group>"; };
-               A7E9B6B712D37EC400DA6239 /* consensusseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = consensusseqscommand.cpp; sourceTree = "<group>"; };
+               A7E9B6B712D37EC400DA6239 /* consensusseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = consensusseqscommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B6B812D37EC400DA6239 /* consensusseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = consensusseqscommand.h; sourceTree = "<group>"; };
                A7E9B6B912D37EC400DA6239 /* corraxescommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = corraxescommand.cpp; sourceTree = "<group>"; };
                A7E9B6BA12D37EC400DA6239 /* corraxescommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = corraxescommand.h; sourceTree = "<group>"; };
                A7E9B6C212D37EC400DA6239 /* decalc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decalc.h; sourceTree = "<group>"; };
                A7E9B6C312D37EC400DA6239 /* deconvolutecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deconvolutecommand.cpp; sourceTree = "<group>"; };
                A7E9B6C412D37EC400DA6239 /* deconvolutecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deconvolutecommand.h; sourceTree = "<group>"; };
-               A7E9B6C512D37EC400DA6239 /* degapseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = degapseqscommand.cpp; sourceTree = "<group>"; };
+               A7E9B6C512D37EC400DA6239 /* degapseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = degapseqscommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B6C612D37EC400DA6239 /* degapseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = degapseqscommand.h; sourceTree = "<group>"; };
                A7E9B6C712D37EC400DA6239 /* deuniqueseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deuniqueseqscommand.cpp; sourceTree = "<group>"; };
                A7E9B6C812D37EC400DA6239 /* deuniqueseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deuniqueseqscommand.h; sourceTree = "<group>"; };
                A7E9B6C912D37EC400DA6239 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = display.h; sourceTree = SOURCE_ROOT; };
                A7E9B6CA12D37EC400DA6239 /* dist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dist.h; sourceTree = "<group>"; };
-               A7E9B6CB12D37EC400DA6239 /* distancecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = distancecommand.cpp; sourceTree = "<group>"; };
+               A7E9B6CB12D37EC400DA6239 /* distancecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = distancecommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B6CC12D37EC400DA6239 /* distancecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = distancecommand.h; sourceTree = "<group>"; };
                A7E9B6CD12D37EC400DA6239 /* distancedb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = distancedb.cpp; sourceTree = "<group>"; };
                A7E9B6CE12D37EC400DA6239 /* distancedb.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = distancedb.hpp; sourceTree = "<group>"; };
                A7E9B6EF12D37EC400DA6239 /* fullmatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fullmatrix.h; sourceTree = "<group>"; };
                A7E9B6F012D37EC400DA6239 /* geom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geom.cpp; sourceTree = "<group>"; };
                A7E9B6F112D37EC400DA6239 /* geom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = geom.h; sourceTree = "<group>"; };
-               A7E9B6F212D37EC400DA6239 /* getgroupcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getgroupcommand.cpp; sourceTree = "<group>"; };
+               A7E9B6F212D37EC400DA6239 /* getgroupcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = getgroupcommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B6F312D37EC400DA6239 /* getgroupcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgroupcommand.h; sourceTree = "<group>"; };
                A7E9B6F412D37EC400DA6239 /* getgroupscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getgroupscommand.cpp; sourceTree = "<group>"; };
                A7E9B6F512D37EC400DA6239 /* getgroupscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgroupscommand.h; sourceTree = "<group>"; };
                A7E9B6FF12D37EC400DA6239 /* getoturepcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getoturepcommand.h; sourceTree = "<group>"; };
                A7E9B70012D37EC400DA6239 /* getotuscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getotuscommand.cpp; sourceTree = "<group>"; };
                A7E9B70112D37EC400DA6239 /* getotuscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getotuscommand.h; sourceTree = "<group>"; };
-               A7E9B70212D37EC400DA6239 /* getrabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getrabundcommand.cpp; sourceTree = "<group>"; };
+               A7E9B70212D37EC400DA6239 /* getrabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = getrabundcommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B70312D37EC400DA6239 /* getrabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getrabundcommand.h; sourceTree = "<group>"; };
                A7E9B70412D37EC400DA6239 /* getrelabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getrelabundcommand.cpp; sourceTree = "<group>"; };
                A7E9B70512D37EC400DA6239 /* getrelabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getrelabundcommand.h; sourceTree = "<group>"; };
-               A7E9B70612D37EC400DA6239 /* getsabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsabundcommand.cpp; sourceTree = "<group>"; };
+               A7E9B70612D37EC400DA6239 /* getsabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = getsabundcommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B70712D37EC400DA6239 /* getsabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsabundcommand.h; sourceTree = "<group>"; };
                A7E9B70812D37EC400DA6239 /* getseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getseqscommand.cpp; sourceTree = "<group>"; };
                A7E9B70912D37EC400DA6239 /* getseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getseqscommand.h; sourceTree = "<group>"; };
                A7E9B73A12D37EC400DA6239 /* libshuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libshuff.h; sourceTree = SOURCE_ROOT; };
                A7E9B73B12D37EC400DA6239 /* libshuffcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = libshuffcommand.cpp; sourceTree = "<group>"; };
                A7E9B73C12D37EC400DA6239 /* libshuffcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libshuffcommand.h; sourceTree = "<group>"; };
-               A7E9B73D12D37EC400DA6239 /* listseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listseqscommand.cpp; sourceTree = "<group>"; };
+               A7E9B73D12D37EC400DA6239 /* listseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = listseqscommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B73E12D37EC400DA6239 /* listseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = listseqscommand.h; sourceTree = "<group>"; };
                A7E9B73F12D37EC400DA6239 /* listvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listvector.cpp; sourceTree = "<group>"; };
                A7E9B74012D37EC400DA6239 /* listvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = listvector.hpp; sourceTree = "<group>"; };
                A7E9B74112D37EC400DA6239 /* logsd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logsd.cpp; sourceTree = "<group>"; };
                A7E9B74212D37EC400DA6239 /* logsd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logsd.h; sourceTree = "<group>"; };
-               A7E9B74312D37EC400DA6239 /* makegroupcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = makegroupcommand.cpp; sourceTree = "<group>"; };
+               A7E9B74312D37EC400DA6239 /* makegroupcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = makegroupcommand.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                A7E9B74412D37EC400DA6239 /* makegroupcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = makegroupcommand.h; sourceTree = "<group>"; };
                A7E9B74512D37EC400DA6239 /* maligner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maligner.cpp; sourceTree = "<group>"; };
                A7E9B74612D37EC400DA6239 /* maligner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maligner.h; sourceTree = "<group>"; };
index 4bcd707bcbe2d90ab9ab0dd3162efdb5faa1b4e1..1761efcbfffe273d52fa67480f390aec38b08b0a 100644 (file)
@@ -203,7 +203,7 @@ int ChopSeqsCommand::execute(){
         if (m->control_pressed) {  return 0; }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();    outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName);
                
                if (wroteAccnos) { m->mothurOut(outputFileNameAccnos); m->mothurOutEndLine(); outputNames.push_back(outputFileNameAccnos); outputTypes["accnos"].push_back(outputFileNameAccnos); }
index 660d53c4bdf05c3249b74d84b7a2ba1eb7e5e50e..0ada1c8f77da53a27f02658184fa8fc6a0713e4b 100644 (file)
@@ -10,6 +10,7 @@
 #include "classifyotucommand.h"
 #include "phylotree.h"
 #include "phylosummary.h"
+#include "sharedutilities.h"
 
 //**********************************************************************************************************************
 vector<string> ClassifyOtuCommand::setParameters(){    
@@ -20,7 +21,8 @@ vector<string> ClassifyOtuCommand::setParameters(){
         CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none",false,false); parameters.push_back(pname);
         CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "none", "none",false,false); parameters.push_back(pcount);
                CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "none", "none",false,false); parameters.push_back(pgroup);
-               CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
+        CommandParameter ppersample("persample", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(ppersample);
+        CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
                CommandParameter pbasis("basis", "Multiple", "otu-sequence", "otu", "", "", "",false,false); parameters.push_back(pbasis);
                CommandParameter pcutoff("cutoff", "Number", "", "51", "", "", "",false,true); parameters.push_back(pcutoff);
                CommandParameter pprobs("probs", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pprobs);
@@ -244,7 +246,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option)  {
                                if(label != "all") {  m->splitAtDash(label, labels);  allLines = 0;  }
                                else { allLines = 1;  }
                        }
-                       
+            
                        basis = validParameter.validFile(parameters, "basis", false);
                        if (basis == "not found") { basis = "otu"; }    
                        
@@ -255,7 +257,18 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option)  {
                        
                        temp = validParameter.validFile(parameters, "probs", false);                                    if (temp == "not found"){       temp = "true";                  }
                        probs = m->isTrue(temp);
+            
+            temp = validParameter.validFile(parameters, "persample", false);           if (temp == "not found"){       temp = "f";             }
+                       persample = m->isTrue(temp);
                        
+            if ((groupfile == "") && (countfile == "")) { if (persample) { m->mothurOut("persample is only valid with a group file, or count file with group information. Setting persample=f.\n"); persample = false; } 
+            }
+            if (countfile != "") {
+                CountTable cts;
+                if (!cts.testGroups(countfile)) { 
+                    if (persample) { m->mothurOut("persample is only valid with a group file, or count file with group information. Setting persample=f.\n"); persample = false; }
+                }
+            }
                        
                        if ((cutoff < 51) || (cutoff > 100)) { m->mothurOut("cutoff must be above 50, and no greater than 100."); m->mothurOutEndLine(); abort = true;  }
                        
@@ -282,11 +295,11 @@ int ClassifyOtuCommand::execute(){
                
                //if user gave a namesfile then use it
                if (namefile != "")     {       m->readNames(namefile, nameMap, true);  }
-        if (groupfile != "")    {   groupMap = new GroupMap(groupfile);  groupMap->readMap(); }
+        if (groupfile != "")    {   groupMap = new GroupMap(groupfile);  groupMap->readMap();  groups = groupMap->getNamesOfGroups(); }
         else { groupMap = NULL;  }
-        if (countfile != "") {  ct = new CountTable(); ct->readTable(countfile);    }
+        if (countfile != "") {  ct = new CountTable(); ct->readTable(countfile);  if (ct->hasGroupInfo()) { groups = ct->getNamesOfGroups(); } }
         else {  ct = NULL;    }
-               
+        
                //read taxonomy file and save in map for easy access in building bin trees
                m->readTax(taxfile, taxMap);
                
@@ -381,18 +394,13 @@ int ClassifyOtuCommand::execute(){
        }
 }
 //**********************************************************************************************************************
-vector<string> ClassifyOtuCommand::findConsensusTaxonomy(int bin, ListVector* thisList, int& size, string& conTax) {
+vector<string> ClassifyOtuCommand::findConsensusTaxonomy(vector<string> names, int& size, string& conTax) {
        try{
                conTax = "";
-               vector<string> names;
                vector<string> allNames;
                map<string, string>::iterator it;
                map<string, string>::iterator it2;
 
-               //parse names into vector
-               string binnames = thisList->get(bin);
-               m->splitAtComma(binnames, names);
-
                //create a tree containing sequences from this bin
                PhyloTree* phylo = new PhyloTree();
                
@@ -543,7 +551,39 @@ int ClassifyOtuCommand::process(ListVector* processList) {
             if (refTaxonomy != "") { taxaSum = new PhyloSummary(refTaxonomy, groupMap);  }
             else {  taxaSum = new PhyloSummary(groupMap); }
         }
-
+        
+        vector<ofstream*> outSums;
+        vector<ofstream*> outs;
+        vector<PhyloSummary*> taxaSums;
+        map<string, int> groupIndex;
+        if (persample) {
+            for (int i = 0; i < groups.size(); i++) {
+                groupIndex[groups[i]] = i;
+                ofstream* temp = new ofstream();
+                string outputFile = outputDir + m->getRootName(m->getSimpleName(listfile)) + processList->getLabel() + "." + groups[i] + "." +getOutputFileNameTag("constaxonomy");
+                m->openOutputFile(outputFile, *temp);
+                (*temp) << "OTU\tSize\tTaxonomy" << endl;
+                outs.push_back(temp);
+                outputNames.push_back(outputFile); outputTypes["constaxonomy"].push_back(outputFile);
+                
+                ofstream* tempSum = new ofstream();
+                string outputSumFile = outputDir + m->getRootName(m->getSimpleName(listfile)) + processList->getLabel() + "." + groups[i] + "." +getOutputFileNameTag("taxsummary");
+                m->openOutputFile(outputSumFile, *tempSum);
+                outSums.push_back(tempSum);
+                outputNames.push_back(outputSumFile); outputTypes["taxsummary"].push_back(outputSumFile);
+                
+                PhyloSummary* taxaSumt;
+                if (countfile != "") {
+                    if (refTaxonomy != "") { taxaSumt = new PhyloSummary(refTaxonomy, ct);  }
+                    else {  taxaSumt = new PhyloSummary(ct); }
+                }else {
+                    if (refTaxonomy != "") { taxaSumt = new PhyloSummary(refTaxonomy, groupMap);  }
+                    else {  taxaSumt = new PhyloSummary(groupMap); }
+                }
+                taxaSums.push_back(taxaSumt);
+            }
+        }
+        
                //for each bin in the list vector
         string snumBins = toString(processList->getNumBins());
                for (int i = 0; i < processList->getNumBins(); i++) {
@@ -551,9 +591,13 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                        if (m->control_pressed) { break; }
                        
                        vector<string> names;
-                       names = findConsensusTaxonomy(i, processList, size, conTax);
+            string binnames = processList->get(i);
+            vector<string> thisNames;
+            m->splitAtComma(binnames, thisNames);
+            
+                       names = findConsensusTaxonomy(thisNames, size, conTax);
                
-                       if (m->control_pressed) { out.close();  return 0; }
+                       if (m->control_pressed) { break; }
                        
                        //output to new names file
             string binLabel = "Otu";
@@ -571,7 +615,11 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                        
                        //add this bins taxonomy to summary
                        if (basis == "sequence") {
-                               for(int j = 0; j < names.size(); j++) {  taxaSum->addSeqToTree(names[j], noConfidenceConTax);  }
+                               for(int j = 0; j < names.size(); j++) {  
+                    int numReps = 1;
+                    if (countfile != "") {  numReps = ct->getNumSeqs(names[j]); }
+                    for(int k = 0; k < numReps; k++) {  taxaSum->addSeqToTree(names[j], noConfidenceConTax);  }
+                }
                        }else { //otu
                 map<string, bool> containsGroup; 
                 if (countfile != "") {
@@ -602,6 +650,66 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                 }
                                taxaSum->addSeqToTree(noConfidenceConTax, containsGroup);
                        }
+            
+            
+            if (persample) {
+                //divide names by group
+                map<string, vector<string> > parsedNames;
+                map<string, vector<string> >::iterator itParsed;
+                
+                //parse names by group
+                for (int j = 0; j < names.size(); j++) {
+                    if (groupfile != "") { 
+                        string group = groupMap->getGroup(names[j]); 
+                        itParsed = parsedNames.find(group);
+                        
+                        if (itParsed != parsedNames.end()) { itParsed->second.push_back(names[j]); }
+                        else { vector<string> tempNames; tempNames.push_back(names[j]); parsedNames[group] = tempNames; }
+                    }else { //count file was used
+                        vector<string> thisSeqsGroups = ct->getGroups(names[j]);
+                        for (int k = 0; k < thisSeqsGroups.size(); k++) {
+                            string group = thisSeqsGroups[k]; 
+                            itParsed = parsedNames.find(group);
+                            
+                            if (itParsed != parsedNames.end()) { itParsed->second.push_back(names[j]); }
+                            else { vector<string> tempNames; tempNames.push_back(names[j]); parsedNames[group] = tempNames; }
+                        }
+                    }
+                }
+                
+                for (itParsed = parsedNames.begin(); itParsed != parsedNames.end(); itParsed++) {
+                    vector<string> theseNames = findConsensusTaxonomy(itParsed->second, size, conTax);
+                    
+                    if (m->control_pressed) { break; }
+                    
+                    //output to new names file
+                    string binLabel = "Otu";
+                    string sbinNumber = toString(i+1);
+                    if (sbinNumber.length() < snumBins.length()) { 
+                        int diff = snumBins.length() - sbinNumber.length();
+                        for (int h = 0; h < diff; h++) { binLabel += "0"; }
+                    }
+                    binLabel += sbinNumber;
+                    
+                    (*outs[groupIndex[itParsed->first]]) << binLabel << '\t' << size << '\t' << conTax << endl;
+                    
+                    string noConfidenceConTax = conTax;
+                    m->removeConfidences(noConfidenceConTax);
+                    
+                    //add this bins taxonomy to summary
+                    if (basis == "sequence") {
+                        for(int j = 0; j < theseNames.size(); j++) {  
+                            int numReps = 1;
+                            if (countfile != "") {  numReps = ct->getGroupCount(theseNames[j], itParsed->first); } //get num seqs for this seq from this group
+                            for(int k = 0; k < numReps; k++) {  (taxaSums[groupIndex[itParsed->first]])->addSeqToTree(theseNames[j], noConfidenceConTax);  }
+                        }
+                    }else { //otu
+                        map<string, bool> containsGroup; 
+                        containsGroup[itParsed->first] = true;
+                        (taxaSums[groupIndex[itParsed->first]])->addSeqToTree(noConfidenceConTax, containsGroup);
+                    }
+                }
+            }
                }
 
                out.close();
@@ -609,6 +717,17 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                //print summary file
                taxaSum->print(outSum);
                outSum.close();
+        
+        if (persample) {
+            for (int i = 0; i < groups.size(); i++) {
+                (*outs[i]).close();
+                taxaSums[i]->print(*outSums[i]);
+                (*outSums[i]).close();
+                delete outs[i];
+                delete outSums[i];
+                delete taxaSums[i];
+            }
+        }
                
                delete taxaSum;
                
index 2e76057f1219b8c44785a5be9b6962043bbb68af..c08a29b8c71552be73d7bd1d3e28c3b0a1ee2159 100644 (file)
@@ -40,16 +40,16 @@ private:
        ListVector* list;
        InputData* input;
        string listfile, namefile, taxfile, label, outputDir, refTaxonomy, groupfile, basis, countfile;
-       bool abort, allLines, probs;
+       bool abort, allLines, probs, persample;
        int cutoff;
        set<string> labels; //holds labels to be used
-       vector<string> outputNames;
+       vector<string> outputNames, groups;
        map<string, string> nameMap;
        map<string, string> taxMap;
 
        int process(ListVector*);
        string addUnclassifieds(string, int);
-       vector<string> findConsensusTaxonomy(int, ListVector*, int&, string&);  // returns the name of the "representative" taxonomy of given bin
+       vector<string> findConsensusTaxonomy(vector<string>, int&, string&);    // returns the name of the "representative" taxonomy of given bin
        
                                                                                                
 };
index 09c2da84c64b2d0558ede1bf5bde35b1ddfc43cd..277e4a248374e596f61fa2f976c1b25696495a9d 100644 (file)
@@ -23,6 +23,7 @@ vector<string> ClusterSplitCommand::setParameters(){
                CommandParameter psplitmethod("splitmethod", "Multiple", "classify-fasta-distance", "distance", "", "", "",false,false); parameters.push_back(psplitmethod);
                CommandParameter plarge("large", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(plarge);
                CommandParameter pshowabund("showabund", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pshowabund);
+        CommandParameter pcluster("cluster", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pcluster);
                CommandParameter ptiming("timing", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(ptiming);
                CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
                CommandParameter pcutoff("cutoff", "Number", "", "0.25", "", "", "",false,false); parameters.push_back(pcutoff);
@@ -46,7 +47,7 @@ vector<string> ClusterSplitCommand::setParameters(){
 string ClusterSplitCommand::getHelpString(){   
        try {
                string helpString = "";
-               helpString += "The cluster.split command parameter options are fasta, phylip, column, name, count, cutoff, precision, method, splitmethod, taxonomy, taxlevel, showabund, timing, hard, large, processors. Fasta or Phylip or column and name are required.\n";
+               helpString += "The cluster.split command parameter options are fasta, phylip, column, name, count, cutoff, precision, method, splitmethod, taxonomy, taxlevel, showabund, timing, hard, large, cluster, processors. Fasta or Phylip or column and name are required.\n";
                helpString += "The cluster.split command can split your files in 3 ways. Splitting by distance file, by classification, or by classification also using a fasta file. \n";
                helpString += "For the distance file method, you need only provide your distance file and mothur will split the file into distinct groups. \n";
                helpString += "For the classification method, you need to provide your distance file and taxonomy file, and set the splitmethod to classify.  \n";
@@ -57,6 +58,7 @@ string ClusterSplitCommand::getHelpString(){
                helpString += "The fasta parameter allows you to enter your aligned fasta file. \n";
                helpString += "The name parameter allows you to enter your name file. \n";
         helpString += "The count parameter allows you to enter your count file. \n A count or name file is required if your distance file is in column format";
+        helpString += "The cluster parameter allows you to indicate whether you want to run the clustering or just split the distance matrix, default=t";
                helpString += "The cutoff parameter allow you to set the distance you want to cluster to, default is 0.25. \n";
                helpString += "The precision parameter allows you specify the precision of the precision of the distances outputted, default=100, meaning 2 decimal places. \n";
                helpString += "The method allows you to specify what clustering algorythm you want to use, default=average, option furthest, nearest, or average. \n";
@@ -350,6 +352,9 @@ ClusterSplitCommand::ClusterSplitCommand(string option)  {
 
                        showabund = validParameter.validFile(parameters, "showabund", false);
                        if (showabund == "not found") { showabund = "T"; }
+            
+            temp = validParameter.validFile(parameters, "cluster", false);  if (temp == "not found") { temp = "T"; }
+            runCluster = m->isTrue(temp);
 
                        timing = validParameter.validFile(parameters, "timing", false);
                        if (timing == "not found") { timing = "F"; }
@@ -447,7 +452,19 @@ int ClusterSplitCommand::execute(){
                
                m->mothurOut("It took " + toString(time(NULL) - estart) + " seconds to split the distance file."); m->mothurOutEndLine();
                estart = time(NULL);
-               
+                
+        if (!runCluster) { 
+#ifdef USE_MPI
+    }
+#endif 
+                m->mothurOutEndLine();
+                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
+                for (int i = 0; i < distName.size(); i++) {    m->mothurOut(distName[i].begin()->first); m->mothurOutEndLine(); m->mothurOut(distName[i].begin()->second); m->mothurOutEndLine();      }
+                m->mothurOutEndLine();
+                return 0;
+                
+        }
+                
                //****************** break up files between processes and cluster each file set ******************************//
        #ifdef USE_MPI
                        ////you are process 0 from above////
index 936ae6f69ce94877b60b9f99219423db8b526d73..d88a934f3ef94649eb94f05c256822597dc96f73 100644 (file)
@@ -50,7 +50,7 @@ private:
        string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, countfile, distfile, format, showabund, timing, splitmethod, taxFile, fastafile;
        double cutoff, splitcutoff;
        int precision, length, processors, taxLevelCutoff;
-       bool print_start, abort, hard, large, classic;
+       bool print_start, abort, hard, large, classic, runCluster;
        time_t start;
        ofstream outList, outRabund, outSabund;
        
index 36df8c043086552dee3c85d120f5dc1d70a71159..4134a52a3ce1e680a8a440672d48be192be5f04c 100644 (file)
@@ -396,7 +396,7 @@ int ConsensusSeqsCommand::execute(){
                }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }       
                m->mothurOutEndLine();
                
index fa6fd4f09a2c0c1703a4f12b65943d6df1ac06a2..e4aa253b8d150db93a0b57f97f11d2df678b3d2a 100644 (file)
@@ -188,7 +188,7 @@ int CountSeqsCommand::execute(){
         m->mothurOutEndLine();
                m->mothurOut("Total number of sequences: " + toString(total)); m->mothurOutEndLine();
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();    
                m->mothurOutEndLine();
                
index 318a05ec0bee7765f835cce4301d2b7a97d16978..095eef30e6691a6eeaca8bd77fdda26bb4febb31 100644 (file)
@@ -241,7 +241,7 @@ int DegapSeqsCommand::execute(){
                }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }       
                m->mothurOutEndLine();
 
index 16407d59b9819183edb70748d0b3a0ca1ff9acda..2a4398baf2773c491d91a2ff8be7fb35ebc12986 100644 (file)
@@ -505,7 +505,7 @@ int DistanceCommand::execute(){
                }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFile); m->mothurOutEndLine();
                m->mothurOutEndLine();
                m->mothurOut("It took " + toString(time(NULL) - startTime) + " to calculate the distances for " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
index faef2accee559eb7816f8e305c3ee8e5bd2f9c33..b92924c7a7f9608329e08968401ac7d1af91712e 100644 (file)
@@ -126,7 +126,7 @@ int GetgroupCommand::execute(){
                }
                        
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOutEndLine();
                
                return 0;       
index 5f33f3a1fbab70aad5764b20f4e1d8633c8a865b..35342933c5f898a97b2c925baa09520defd47179 100644 (file)
@@ -274,7 +274,7 @@ int GetRAbundCommand::execute(){
                }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(filename); m->mothurOutEndLine();  outputNames.push_back(filename); outputTypes["rabund"].push_back(filename);
                m->mothurOutEndLine();
                
index 5425c41a917f4b02d67c5b4dfcb63e1b2fc6159b..50692495b9c87f83cfde870168c5214a41b9a7ac 100644 (file)
@@ -268,7 +268,7 @@ int GetSAbundCommand::execute(){
                delete input;
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(filename); m->mothurOutEndLine();  outputNames.push_back(filename); outputTypes["sabund"].push_back(filename);
                m->mothurOutEndLine();
                
index dc9f121a0e83758d4ecf4977294e8221b3da0712..3c461d7188ea5096de8031200913a1a43bc1101c 100644 (file)
@@ -416,7 +416,7 @@ int IndicatorCommand::GetIndicatorSpecies(){
                ofstream out;
                m->openOutputFile(outputFileName, out);
                out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);
-               m->mothurOutEndLine(); m->mothurOut("Species\tIndicatorValue\tpValue\n");
+               m->mothurOutEndLine(); m->mothurOut("Species\tIndicator_Groups\tIndicatorValue\tpValue\n");
                
                int numBins = 0;
                if (sharedfile != "") { numBins = lookup[0]->getNumBins(); }
@@ -430,6 +430,7 @@ int IndicatorCommand::GetIndicatorSpecies(){
                        
                vector<float> indicatorValues; //size of numBins
                vector<float> pValues;
+        vector<string> indicatorGroups;
                map< vector<int>, vector<int> > randomGroupingsMap; //maps location in groupings to location in groupings, ie, [0][0] -> [1][2]. This is so we don't have to actually move the sharedRabundVectors.
                        
                if (sharedfile != "") {
@@ -453,7 +454,7 @@ int IndicatorCommand::GetIndicatorSpecies(){
                                
                        if (groupsAlreadyAdded.size() != lookup.size()) {  m->mothurOut("[ERROR]: could not make proper groupings."); m->mothurOutEndLine(); }
                                
-                       indicatorValues = getValues(groupings, randomGroupingsMap);
+                       indicatorValues = getValues(groupings, indicatorGroups, randomGroupingsMap);
                        
                        pValues = getPValues(groupings, randomGroupingsMap, lookup.size(), indicatorValues);                            
                }else {
@@ -476,7 +477,7 @@ int IndicatorCommand::GetIndicatorSpecies(){
                        
                        if (groupsAlreadyAdded.size() != lookupFloat.size()) {  m->mothurOut("[ERROR]: could not make proper groupings."); m->mothurOutEndLine(); }
                        
-                       indicatorValues = getValues(groupings, randomGroupingsMap);
+                       indicatorValues = getValues(groupings, indicatorGroups, randomGroupingsMap);
                        
                        pValues = getPValues(groupings, randomGroupingsMap, lookupFloat.size(), indicatorValues);
                }
@@ -487,22 +488,22 @@ int IndicatorCommand::GetIndicatorSpecies(){
                /******************************************************/
                //output indicator values to table form               //
                /*****************************************************/
-               out << "OTU\tIndicator_Value\tpValue" << endl;
+               out << "OTU\tIndicator_Groups\tIndicator_Value\tpValue" << endl;
                for (int j = 0; j < indicatorValues.size(); j++) {
                                
                        if (m->control_pressed) { out.close(); return 0; }
                        
-                       out << m->currentBinLabels[j] << '\t' << indicatorValues[j] << '\t'; 
+                       out << m->currentBinLabels[j] << '\t' << indicatorGroups[j] << '\t' << indicatorValues[j] << '\t'; 
                        
                        if (pValues[j] > (1/(float)iters)) { out << pValues[j] << endl; } 
                        else { out << "<" << (1/(float)iters) << endl; }
                        
                        if (pValues[j] <= 0.05) {
-                               cout << m->currentBinLabels[j] << '\t' << indicatorValues[j]  << '\t';
+                               cout << m->currentBinLabels[j] << '\t' << indicatorGroups[j] << '\t' << indicatorValues[j]  << '\t';
                                string pValueString = "<" + toString((1/(float)iters)); 
                                if (pValues[j] > (1/(float)iters)) { pValueString = toString(pValues[j]); cout << pValues[j];} 
                                else { cout << "<" << (1/(float)iters); }
-                               m->mothurOutJustToLog(m->currentBinLabels[j] + "\t" + toString(indicatorValues[j]) + "\t" + pValueString); 
+                               m->mothurOutJustToLog(m->currentBinLabels[j] + "\t" + indicatorGroups[j] + "\t" + toString(indicatorValues[j]) + "\t" + pValueString); 
                                m->mothurOutEndLine(); 
                        }
                }
@@ -538,10 +539,10 @@ int IndicatorCommand::GetIndicatorSpecies(Tree*& T){
                
                //print headings
                out << "TreeNode\t";
-               for (int i = 0; i < numBins; i++) { out << m->currentBinLabels[i] << "_IndValue" << '\t' << "pValue" << '\t'; }
+               for (int i = 0; i < numBins; i++) { out << m->currentBinLabels[i] << "_IndGroups" << '\t' << m->currentBinLabels[i] << "_IndValue" << '\t' << "pValue" << '\t'; }
                out << endl;
                
-               m->mothurOutEndLine(); m->mothurOut("Node\tSpecies\tIndicatorValue\tpValue\n");
+               m->mothurOutEndLine(); m->mothurOut("Node\tSpecies\tIndicator_Groups\tIndicatorValue\tpValue\n");
                
                string treeOutputDir = outputDir;
                if (outputDir == "") {  treeOutputDir += m->hasPath(treefile);  }
@@ -572,6 +573,7 @@ int IndicatorCommand::GetIndicatorSpecies(Tree*& T){
                        
                        vector<float> indicatorValues; //size of numBins
                        vector<float> pValues;
+            vector<string> indicatorGroups;
                        map< vector<int>, vector<int> > randomGroupingsMap; //maps location in groupings to location in groupings, ie, [0][0] -> [1][2]. This is so we don't have to actually move the sharedRabundVectors.
                        
                        if (sharedfile != "") {
@@ -623,7 +625,7 @@ int IndicatorCommand::GetIndicatorSpecies(Tree*& T){
                                
                                if (groupsAlreadyAdded.size() != lookup.size()) {  m->mothurOut("[ERROR]: could not make proper groupings."); m->mothurOutEndLine(); }
                                                                
-                               indicatorValues = getValues(groupings, randomGroupingsMap);
+                               indicatorValues = getValues(groupings, indicatorGroups, randomGroupingsMap);
                                
                                pValues = getPValues(groupings, randomGroupingsMap, lookup.size(), indicatorValues);                            
                        }else {
@@ -672,7 +674,7 @@ int IndicatorCommand::GetIndicatorSpecies(Tree*& T){
                                
                                if (groupsAlreadyAdded.size() != lookupFloat.size()) { m->mothurOut("[ERROR]: could not make proper groupings."); m->mothurOutEndLine(); }
                                
-                               indicatorValues = getValues(groupings, randomGroupingsMap);
+                               indicatorValues = getValues(groupings, indicatorGroups, randomGroupingsMap);
                                
                                pValues = getPValues(groupings, randomGroupingsMap, lookupFloat.size(), indicatorValues);
                        }
@@ -689,17 +691,17 @@ int IndicatorCommand::GetIndicatorSpecies(Tree*& T){
                                if (m->control_pressed) { out.close(); return 0; }
                                
                                if (pValues[j] < (1/(float)iters)) {
-                                       out << indicatorValues[j] << '\t' << '<' << (1/(float)iters) << '\t';
+                                       out << indicatorGroups[j] << '\t' << indicatorValues[j] << '\t' << '<' << (1/(float)iters) << '\t';
                                }else {
-                                       out << indicatorValues[j] << '\t' << pValues[j] << '\t';
+                                       out << indicatorGroups[j] << '\t' << indicatorValues[j] << '\t' << pValues[j] << '\t';
                                }
                                
                                if (pValues[j] <= 0.05) {
-                                       cout << i+1 << '\t' << m->currentBinLabels[j] << '\t' << indicatorValues[j]  << '\t';
+                                       cout << i+1 << '\t' << m->currentBinLabels[j] << '\t' << indicatorGroups[j] << '\t' << indicatorValues[j]  << '\t';
                                        string pValueString = "<" + toString((1/(float)iters)); 
                                        if (pValues[j] > (1/(float)iters)) { pValueString = toString(pValues[j]); cout << pValues[j];} 
                                        else { cout << "<" << (1/(float)iters); }
-                                       m->mothurOutJustToLog(toString(i) + "\t" + m->currentBinLabels[j] + "\t" + toString(indicatorValues[j]) + "\t" + pValueString); 
+                                       m->mothurOutJustToLog(toString(i) + "\t" + m->currentBinLabels[j] + "\t" + indicatorGroups[j] + "\t" + toString(indicatorValues[j]) + "\t" + pValueString); 
                                        m->mothurOutEndLine(); 
                                }
                        }
@@ -724,11 +726,25 @@ int IndicatorCommand::GetIndicatorSpecies(Tree*& T){
        }
 }
 //**********************************************************************************************************************
-vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundFloatVector*> >& groupings, map< vector<int>, vector<int> > groupingsMap){
+vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundFloatVector*> >& groupings, vector<string>& indicatorGroupings, map< vector<int>, vector<int> > groupingsMap){
        try {
                vector<float> values;
                map< vector<int>, vector<int> >::iterator it;
-               
+        
+        indicatorGroupings.clear();
+        
+        //create grouping strings
+        vector<string> groupingsGroups;
+        for (int j = 0; j < groupings.size(); j++) {
+            string tempGrouping = "";
+            for (int k = 0; k < groupings[j].size()-1; k++) { 
+                tempGrouping += groupings[j][k]->getGroup() + "-";
+            }
+            tempGrouping += groupings[j][groupings[j].size()-1]->getGroup();
+            groupingsGroups.push_back(tempGrouping);
+        }
+        
+        
                //for each otu
                for (int i = 0; i < groupings[0][0]->getNumBins(); i++) {
                        
@@ -768,15 +784,17 @@ vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundFloatVector
                        }
                        
                        float maxIndVal = 0.0;
+            string maxGrouping = "";
                        for (int j = 0; j < terms.size(); j++) { 
                                float thisAij = (terms[j] / AijDenominator); //relative abundance
                                float thisValue = thisAij * Bij[j] * 100.0;
                                
                                //save largest
-                               if (thisValue > maxIndVal) { maxIndVal = thisValue; }
+                               if (thisValue > maxIndVal) { maxIndVal = thisValue;  maxGrouping = groupingsGroups[j]; }
                        }
                        
                        values.push_back(maxIndVal);
+            indicatorGroupings.push_back(maxGrouping);
                }
                
                return values;
@@ -788,17 +806,24 @@ vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundFloatVector
 }
 //**********************************************************************************************************************
 //same as above, just data type difference
-vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundVector*> >& groupings, map< vector<int>, vector<int> > groupingsMap){
+vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundVector*> >& groupings, vector<string>& indicatorGroupings, map< vector<int>, vector<int> > groupingsMap){
        try {
                vector<float> values;
-               
-       /*for (int j = 0; j < groupings.size(); j++) {          
-               cout << "grouping " << j << endl;
-               for (int k = 0; k < groupings[j].size(); k++) { 
-                       cout << groupings[j][k]->getGroup() << endl;
-               }
-       }*/
                map< vector<int>, vector<int> >::iterator it;
+        
+        indicatorGroupings.clear();
+        
+        //create grouping strings
+        vector<string> groupingsGroups;
+        for (int j = 0; j < groupings.size(); j++) {
+            string tempGrouping = "";
+            for (int k = 0; k < groupings[j].size()-1; k++) { 
+                tempGrouping += groupings[j][k]->getGroup() + "-";
+            }
+            tempGrouping += groupings[j][groupings[j].size()-1]->getGroup();
+            groupingsGroups.push_back(tempGrouping);
+        }
+
                
                //for each otu
                for (int i = 0; i < groupings[0][0]->getNumBins(); i++) {
@@ -835,15 +860,17 @@ vector<float> IndicatorCommand::getValues(vector< vector<SharedRAbundVector*> >&
                        }
                        
                        float maxIndVal = 0.0;
+            string maxGrouping = "";
                        for (int j = 0; j < terms.size(); j++) { 
                                float thisAij = (terms[j] / AijDenominator); //relative abundance
                                float thisValue = thisAij * Bij[j] * 100.0;
                                        
                                //save largest
-                               if (thisValue > maxIndVal) { maxIndVal = thisValue; }
+                               if (thisValue > maxIndVal) { maxIndVal = thisValue;  maxGrouping = groupingsGroups[j]; }
                        }
                        
                        values.push_back(maxIndVal);
+            indicatorGroupings.push_back(maxGrouping);
                }
                
                return values;
@@ -1119,11 +1146,12 @@ vector<float> IndicatorCommand::driver(vector< vector<SharedRAbundFloatVector*>
        try {
                vector<float> pvalues;
                pvalues.resize(indicatorValues.size(), 0);
+        vector<string> notUsedGroupings;  //we dont care about the grouping for the pvalues since they are randomized, but we need to pass the function something to make it work.
                
                for(int i=0;i<numIters;i++){
                        if (m->control_pressed) { break; }
                        groupingsMap = randomizeGroupings(groupings, num);
-                       vector<float> randomIndicatorValues = getValues(groupings, groupingsMap);
+                       vector<float> randomIndicatorValues = getValues(groupings, notUsedGroupings, groupingsMap);
                        
                        for (int j = 0; j < indicatorValues.size(); j++) {
                                if (randomIndicatorValues[j] >= indicatorValues[j]) { pvalues[j]++; }
@@ -1232,11 +1260,12 @@ vector<float> IndicatorCommand::driver(vector< vector<SharedRAbundVector*> >& gr
        try {
                vector<float> pvalues;
                pvalues.resize(indicatorValues.size(), 0);
+        vector<string> notUsedGroupings;  //we dont care about the grouping for the pvalues since they are randomized, but we need to pass the function something to make it work.
                
                for(int i=0;i<numIters;i++){
                        if (m->control_pressed) { break; }
                        groupingsMap = randomizeGroupings(groupings, num);
-                       vector<float> randomIndicatorValues = getValues(groupings, groupingsMap);
+                       vector<float> randomIndicatorValues = getValues(groupings, notUsedGroupings, groupingsMap);
                        
                        for (int j = 0; j < indicatorValues.size(); j++) {
                                if (randomIndicatorValues[j] >= indicatorValues[j]) { pvalues[j]++; }
index 3c24dfb843e770567a1486436536b97fabfe12b5..b058af33b05b2a7a29f3f1e4aede4e22c37cbf7d 100644 (file)
@@ -50,13 +50,16 @@ private:
        int GetIndicatorSpecies(Tree*&);
        int GetIndicatorSpecies();
        set<string> getDescendantList(Tree*&, int, map<int, set<string> >, map<int, set<int> >&);
-       vector<float> getValues(vector< vector<SharedRAbundVector*> >&, map< vector<int>, vector<int> >);
-       vector<float> getValues(vector< vector<SharedRAbundFloatVector*> >&, map< vector<int>, vector<int> >);
+       vector<float> getValues(vector< vector<SharedRAbundVector*> >&, vector<string>&, map< vector<int>, vector<int> >);
+       vector<float> getValues(vector< vector<SharedRAbundFloatVector*> >&, vector<string>&, map< vector<int>, vector<int> >);
+    
        map<int, float> getDistToRoot(Tree*&);
        map< vector<int>, vector<int> > randomizeGroupings(vector< vector<SharedRAbundVector*> >&, int);
        map< vector<int>, vector<int> > randomizeGroupings(vector< vector<SharedRAbundFloatVector*> >&, int);
+    
        vector<float> driver(vector< vector<SharedRAbundFloatVector*> >&, map< vector<int>, vector<int> >, int, vector<float>, int);
        vector<float> driver(vector< vector<SharedRAbundVector*> >&, map< vector<int>, vector<int> >, int, vector<float>, int);
+    
        vector<float> getPValues(vector< vector<SharedRAbundFloatVector*> >&, map< vector<int>, vector<int> >, int, vector<float>);
        vector<float> getPValues(vector< vector<SharedRAbundVector*> >&, map< vector<int>, vector<int> >, int, vector<float>);
 
index 7c3f07f96e092d81c307673192dad29a31fee091..4bc33a3d24989a53aa063497dcbf238f432642e8 100644 (file)
@@ -269,7 +269,7 @@ int ListSeqsCommand::execute(){
                m->setAccnosFile(outputFileName);
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();    
                m->mothurOutEndLine();
                
index 77c2a2911468fe8c0cd123eddce3346b02a4c54c..a3aca93002977fae7cb5f4fb559f77936ba01bfc 100644 (file)
@@ -245,7 +245,7 @@ int MakeGroupCommand::execute(){
                out.close();
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: " + filename); m->mothurOutEndLine(); outputNames.push_back(filename); outputTypes["group"].push_back(filename); 
+               m->mothurOut("Output File Names: " + filename); m->mothurOutEndLine(); outputNames.push_back(filename); outputTypes["group"].push_back(filename); 
                m->mothurOutEndLine();
                
                //set group file as new current groupfile
index 0501859e258f82410fa8360ae86092a0b1ea86f6..f68bbbedd4b7704a85b55a41a90bc2aa855902ef 100644 (file)
@@ -135,7 +135,7 @@ int MergeFileCommand::execute(){
                if (m->control_pressed) {  m->mothurRemove(outputFileName); return 0;  }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();    outputNames.push_back(outputFileName); outputTypes["merge"].push_back(outputFileName);
                m->mothurOutEndLine();
 
index e32e0b6c339c5b80108a3e874ce9c990ef5a2376..091bf9bb0659dd0895bf47a414fa4ea86692f026 100644 (file)
@@ -241,7 +241,7 @@ int OtuHierarchyCommand::execute(){
                if (m->control_pressed) { outputTypes.clear(); m->mothurRemove(outputFileName); return 0; }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();    outputNames.push_back(outputFileName); outputTypes["otuheirarchy"].push_back(outputFileName); 
                m->mothurOutEndLine();
                
index f69faff477aee954801f0d04bb3bce67f785d1e5..dd824316744eda7025026869c0aebb44256f98dd 100644 (file)
@@ -499,7 +499,7 @@ int PairwiseSeqsCommand::execute(){
                }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }
                m->mothurOutEndLine();
                
index 816bdb5d38c53afb849be7d5e65b458ac8582148..ba23ae3253eed3c9ef3f5cbd8dc0b927348875a6 100644 (file)
@@ -14,8 +14,8 @@
 vector<string> ParseFastaQCommand::setParameters(){    
        try {
                CommandParameter pfastq("fastq", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pfastq);
-               CommandParameter pfasta("fasta", "Bool", "", "T", "", "", "",false,false); parameters.push_back(pfasta);
-               CommandParameter pqual("qfile", "Bool", "", "T", "", "", "",false,false); parameters.push_back(pqual);
+               CommandParameter pfasta("fasta", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pfasta);
+               CommandParameter pqual("qfile", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pqual);
                CommandParameter pformat("format", "Multiple", "sanger-illumina-solexa", "sanger", "", "", "",false,false); parameters.push_back(pformat);
         CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
                CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
index cde88b71203ac3c5fe364c2d7a7bd112bc8da8f8..96a216ab4a76f551cf1e1eef9972e60d728a72a3 100644 (file)
@@ -240,7 +240,7 @@ int ReverseSeqsCommand::execute(){
                
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for(int i=0;i<outputNames.size();i++){
                        m->mothurOut(outputNames[i]);
                        m->mothurOutEndLine();
index 4d04270ce649f8b2e579625eae7c074b322d10cb..870283c460e6946ed5aab103cd4d2f84a714aee2 100644 (file)
@@ -303,7 +303,7 @@ int AlignCheckCommand::execute(){
                
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outfile); m->mothurOutEndLine();   outputNames.push_back(outfile); outputTypes["aligncheck"].push_back(outfile);
                m->mothurOutEndLine();
                
index b62bb00548f3e1ee66f0c1cf2b4bee117c5416cf..5a1ead5c75a30d699787f52fed09139989ba46dd 100644 (file)
@@ -223,7 +223,7 @@ int SensSpecCommand::execute(){
                if (m->control_pressed) { m->mothurRemove(sensSpecFileName); return 0; }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(sensSpecFileName); m->mothurOutEndLine();  
                m->mothurOutEndLine();
                
index a2500949a9c207a5975b5734050533c1d1ea317f..fb43503b2e7cc987e56ee58f591f5fe75d47aaa1 100644 (file)
@@ -410,7 +410,7 @@ int SeqSummaryCommand::execute(){
                if (m->control_pressed) {  m->mothurRemove(summaryFile); return 0; }
                
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(summaryFile); m->mothurOutEndLine();       outputNames.push_back(summaryFile); outputTypes["summary"].push_back(summaryFile);
                m->mothurOutEndLine();
                
index d1fb1226236dc3842b9ace53536cf95a266f1d5e..7116909e3f97ec758ff4b9de178e0d9ebd0dded1 100644 (file)
@@ -28,7 +28,7 @@ public:
        
        vector<string> setParameters();
        string getCommandName()                 { return "sub.sample";  }
-       string getCommandCategory()             { return "General";             }
+       string getCommandCategory()             { return "Sequence Processing";         }
        string getOutputFileNameTag(string, string);
        string getHelpString(); 
        string getCitation() { return "http://www.mothur.org/wiki/Sub.sample"; }
index 5a073677804ae2e3176f08a3d4ff1e26a1bc5c03..48852a7d7d5d46491340062c4b989cc425bc6512 100644 (file)
@@ -251,7 +251,7 @@ int SummaryQualCommand::execute(){
                m->mothurOutEndLine();
                m->mothurOut("It took " + toString(time(NULL) - start) + " secs to create the summary file for " + toString(numSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(summaryFile); m->mothurOutEndLine();       outputNames.push_back(summaryFile); outputTypes["summary"].push_back(summaryFile);
                m->mothurOutEndLine();
                
index 7f5e5e5c285199cbb12a9fec151a466090bf9d5d..d33b4f014a07b46e252e36e24a68bd2db8fc6d5a 100644 (file)
@@ -296,7 +296,7 @@ int SummaryTaxCommand::execute(){
                m->mothurOutEndLine();
                m->mothurOut("It took " + toString(time(NULL) - start) + " secs to create the summary file for " + toString(numSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
                m->mothurOutEndLine();
-               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(summaryFile); m->mothurOutEndLine();       outputNames.push_back(summaryFile); outputTypes["summary"].push_back(summaryFile);
                m->mothurOutEndLine();