]> git.donarmstrong.com Git - mothur.git/commitdiff
added get.rabund and get.sabund command and fixed bug introduced by line by line...
authorwestcott <westcott>
Wed, 3 Jun 2009 12:37:21 +0000 (12:37 +0000)
committerwestcott <westcott>
Wed, 3 Jun 2009 12:37:21 +0000 (12:37 +0000)
24 files changed:
Mothur.xcodeproj/project.pbxproj
binsequencecommand.cpp
bootstrapsharedcommand.cpp
collectcommand.cpp
collectsharedcommand.cpp
commandfactory.cpp
errorchecking.cpp
getoturepcommand.cpp
getrabundcommand.cpp [new file with mode: 0644]
getrabundcommand.h [new file with mode: 0644]
getsabundcommand.cpp [new file with mode: 0644]
getsabundcommand.h [new file with mode: 0644]
heatmapcommand.cpp
matrixoutputcommand.cpp
parselistcommand.cpp
rarefactcommand.cpp
rarefactsharedcommand.cpp
sharedcommand.cpp
summarycommand.cpp
summarysharedcommand.cpp
treegroupscommand.cpp
validcommands.cpp
validparameter.cpp
venncommand.cpp

index 245ed5535ecc449999a20ae363a09cd4d90b6037..34dacfaa1bd701ec3387bb3faf3073b88cd3493e 100644 (file)
@@ -35,6 +35,8 @@
                3746107E0F4064D100460C57 /* weighted.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3746107D0F4064D100460C57 /* weighted.cpp */; };
                374610830F40652400460C57 /* unweighted.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 374610820F40652400460C57 /* unweighted.cpp */; };
                3746109D0F40657600460C57 /* unifracunweightedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3746109C0F40657600460C57 /* unifracunweightedcommand.cpp */; };
+               3749271D0FD58C840031C06B /* getsabundcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3749271C0FD58C840031C06B /* getsabundcommand.cpp */; };
+               3749273F0FD5956B0031C06B /* getrabundcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3749273E0FD5956B0031C06B /* getrabundcommand.cpp */; };
                37519A6B0F80E6EB00FED5E8 /* sharedanderbergs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37519A6A0F80E6EB00FED5E8 /* sharedanderbergs.cpp */; };
                37519AA10F810D0200FED5E8 /* venncommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37519AA00F810D0200FED5E8 /* venncommand.cpp */; };
                37519AB50F810FAE00FED5E8 /* venn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37519AB40F810FAE00FED5E8 /* venn.cpp */; };
@@ -67,6 +69,8 @@
                379294700F2E191800B9034A /* parsimonycommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3792946F0F2E191800B9034A /* parsimonycommand.cpp */; };
                3792948A0F2E258500B9034A /* parsimony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379294890F2E258500B9034A /* parsimony.cpp */; };
                379643ED0FB9B5A80081FDB6 /* readseqs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379643EB0FB9B5A80081FDB6 /* readseqs.cpp */; };
+               3799A9500FD6A58C00E33EDE /* distancedb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3799A94C0FD6A58C00E33EDE /* distancedb.cpp */; };
+               3799A9510FD6A58C00E33EDE /* seqsummarycommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3799A94E0FD6A58C00E33EDE /* seqsummarycommand.cpp */; };
                37AD4CE40F28AEA300AA2D49 /* sharedlistvector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */; };
                37AD4DBB0F28E2FE00AA2D49 /* tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */; };
                37AD4DCA0F28F3DD00AA2D49 /* readtree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */; };
                7E412F490F8D21B600381DD0 /* slibshuff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E412F480F8D21B600381DD0 /* slibshuff.cpp */; };
                7E412FEA0F8D3E2C00381DD0 /* libshuff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E412FE90F8D3E2C00381DD0 /* libshuff.cpp */; };
                7E4130F80F8E58FA00381DD0 /* dlibshuff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4130F60F8E58FA00381DD0 /* dlibshuff.cpp */; };
-               7E9214820FD2081200699BF3 /* seqsummarycommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E9214810FD2081200699BF3 /* seqsummarycommand.cpp */; };
                7EC3D4550FA0FFF900338DA5 /* coverage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EC3D4500FA0FFF900338DA5 /* coverage.cpp */; };
                7EC3D4560FA0FFF900338DA5 /* whittaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EC3D4530FA0FFF900338DA5 /* whittaker.cpp */; };
                8DD76F6A0486A84900D96B5E /* Mothur.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859E8B029090EE04C91782 /* Mothur.1 */; };
                374610820F40652400460C57 /* unweighted.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unweighted.cpp; sourceTree = SOURCE_ROOT; };
                3746109B0F40657600460C57 /* unifracunweightedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unifracunweightedcommand.h; sourceTree = SOURCE_ROOT; };
                3746109C0F40657600460C57 /* unifracunweightedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unifracunweightedcommand.cpp; sourceTree = SOURCE_ROOT; };
+               3749271B0FD58C840031C06B /* getsabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsabundcommand.h; sourceTree = "<group>"; };
+               3749271C0FD58C840031C06B /* getsabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsabundcommand.cpp; sourceTree = "<group>"; };
+               3749273D0FD5956B0031C06B /* getrabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getrabundcommand.h; sourceTree = "<group>"; };
+               3749273E0FD5956B0031C06B /* getrabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getrabundcommand.cpp; sourceTree = "<group>"; };
                37519A690F80E6EB00FED5E8 /* sharedanderbergs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderbergs.h; sourceTree = SOURCE_ROOT; };
                37519A6A0F80E6EB00FED5E8 /* sharedanderbergs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedanderbergs.cpp; sourceTree = SOURCE_ROOT; };
                37519A9F0F810D0200FED5E8 /* venncommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = venncommand.h; sourceTree = SOURCE_ROOT; };
                3792948D0F2E271100B9034A /* treecalculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treecalculator.h; sourceTree = SOURCE_ROOT; };
                379643EB0FB9B5A80081FDB6 /* readseqs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readseqs.cpp; sourceTree = SOURCE_ROOT; };
                379643EC0FB9B5A80081FDB6 /* readseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readseqs.h; sourceTree = SOURCE_ROOT; };
+               3799A94C0FD6A58C00E33EDE /* distancedb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = distancedb.cpp; sourceTree = "<group>"; };
+               3799A94D0FD6A58C00E33EDE /* distancedb.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = distancedb.hpp; sourceTree = "<group>"; };
+               3799A94E0FD6A58C00E33EDE /* seqsummarycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seqsummarycommand.cpp; sourceTree = "<group>"; };
+               3799A94F0FD6A58C00E33EDE /* seqsummarycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seqsummarycommand.h; sourceTree = "<group>"; };
                37AD4CE20F28AEA300AA2D49 /* sharedlistvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedlistvector.h; sourceTree = SOURCE_ROOT; };
                37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedlistvector.cpp; sourceTree = SOURCE_ROOT; };
                37AD4DB90F28E2FE00AA2D49 /* tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tree.h; sourceTree = SOURCE_ROOT; };
                7E412FE90F8D3E2C00381DD0 /* libshuff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = libshuff.cpp; sourceTree = SOURCE_ROOT; };
                7E4130F60F8E58FA00381DD0 /* dlibshuff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dlibshuff.cpp; sourceTree = SOURCE_ROOT; };
                7E4130F70F8E58FA00381DD0 /* dlibshuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dlibshuff.h; sourceTree = SOURCE_ROOT; };
-               7E9214800FD2081200699BF3 /* seqsummarycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seqsummarycommand.h; sourceTree = "<group>"; };
-               7E9214810FD2081200699BF3 /* seqsummarycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seqsummarycommand.cpp; sourceTree = "<group>"; };
                7EC3D4500FA0FFF900338DA5 /* coverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coverage.cpp; sourceTree = SOURCE_ROOT; };
                7EC3D4510FA0FFF900338DA5 /* coverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coverage.h; sourceTree = SOURCE_ROOT; };
                7EC3D4520FA0FFF900338DA5 /* sharedanderberg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderberg.h; sourceTree = SOURCE_ROOT; };
                37D928A90F2133E5001D4494 /* commands */ = {
                        isa = PBXGroup;
                        children = (
-                               7E9214800FD2081200699BF3 /* seqsummarycommand.h */,
-                               7E9214810FD2081200699BF3 /* seqsummarycommand.cpp */,
                                37D927CD0F21331F001D4494 /* command.hpp */,
                                378DC5CD0FBDE1C8003B8607 /* aligncommand.h */,
                                378DC5CE0FBDE1C8003B8607 /* aligncommand.cpp */,
                                A70B53A80F4CD7AD0064797E /* getlinecommand.cpp */,
                                370B88050F8A4EE4005AB382 /* getoturepcommand.h */,
                                370B88060F8A4EE4005AB382 /* getoturepcommand.cpp */,
+                               3749273D0FD5956B0031C06B /* getrabundcommand.h */,
+                               3749273E0FD5956B0031C06B /* getrabundcommand.cpp */,
+                               3749271B0FD58C840031C06B /* getsabundcommand.h */,
+                               3749271C0FD58C840031C06B /* getsabundcommand.cpp */,
                                375873F10F7D64800040F377 /* heatmapcommand.h */,
                                375873F00F7D64800040F377 /* heatmapcommand.cpp */,
                                37D927E40F21331F001D4494 /* helpcommand.h */,
                                372E126F0F26365B0095CF7E /* readotucommand.cpp */,
                                37E5F4900F2A3DA800F8D827 /* readtreecommand.h */,
                                37E5F4910F2A3DA800F8D827 /* readtreecommand.cpp */,
+                               3799A94E0FD6A58C00E33EDE /* seqsummarycommand.cpp */,
+                               3799A94F0FD6A58C00E33EDE /* seqsummarycommand.h */,
                                37D928270F21331F001D4494 /* sharedcommand.h */,
                                37D928260F21331F001D4494 /* sharedcommand.cpp */,
                                37D928470F21331F001D4494 /* summarycommand.h */,
                                37D927D40F21331F001D4494 /* database.hpp */,
                                37D927D30F21331F001D4494 /* database.cpp */,
                                37D927D50F21331F001D4494 /* datavector.hpp */,
+                               3799A94C0FD6A58C00E33EDE /* distancedb.cpp */,
+                               3799A94D0FD6A58C00E33EDE /* distancedb.hpp */,
                                37D927DC0F21331F001D4494 /* fastamap.h */,
                                37D927DB0F21331F001D4494 /* fastamap.cpp */,
                                375873EA0F7D64520040F377 /* fullmatrix.h */,
                                373C699C0FC1E63600137ACD /* solow.cpp in Sources */,
                                EB72FE260FC1F5CA0051AC11 /* shen.cpp in Sources */,
                                21E859D80FC4632E005E1A48 /* matrixoutputcommand.cpp in Sources */,
-                               7E9214820FD2081200699BF3 /* seqsummarycommand.cpp in Sources */,
+                               3749271D0FD58C840031C06B /* getsabundcommand.cpp in Sources */,
+                               3749273F0FD5956B0031C06B /* getrabundcommand.cpp in Sources */,
+                               3799A9500FD6A58C00E33EDE /* distancedb.cpp in Sources */,
+                               3799A9510FD6A58C00E33EDE /* seqsummarycommand.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index c21757850b858d4a53173619da911ffcab5d24a3..8f0bb9fd45b34fbaa6d72b81f9d42e7658d2ee3a 100644 (file)
@@ -77,9 +77,10 @@ int BinSeqCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
 
                                
-               while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(list->getLabel()) == 1){
                                
@@ -88,7 +89,7 @@ int BinSeqCommand::execute(){
                                                        
                                processedLabels.insert(list->getLabel());
                                userLabels.erase(list->getLabel());
-
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastList->getLabel()) != 1)) {
index 2835061392732dfa402f626a3d339726a601435a..9ffd2b73f0935df7ea46402f5555fb9ea9372ada 100644 (file)
@@ -104,6 +104,7 @@ int BootSharedCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                                
                //set users groups
                util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "treegroup");
@@ -120,7 +121,7 @@ int BootSharedCommand::execute(){
                tmap->makeSim(globaldata->gGroupmap);
                globaldata->gTreemap = tmap;
                        
-               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){                       
                                
@@ -129,10 +130,10 @@ int BootSharedCommand::execute(){
                                
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
-                               
-                       //you have a label the user want that is smaller than this line and the last line has not already been processed 
+                               userLines.erase(count);
                        }
                        
+                       //you have a label the user want that is smaller than this line and the last line has not already been processed
                        if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastOrder->getLabel()) != 1)) {
                                                                                        
                                cout << lastOrder->getLabel() << '\t' << count << endl;
index 01f2fff68b93596a52fc60703bce790559b0fbec..3d7f1b0fead598d628491f6214ed3701bd65edea 100644 (file)
@@ -133,8 +133,9 @@ int CollectCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                
-               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
                                
@@ -145,6 +146,7 @@ int CollectCommand::execute(){
                                cout << order->getLabel() << '\t' << count << endl;
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
+                               userLines.erase(count);
                        
                        //you have a label the user want that is smaller than this line and the last line has not already been processed 
                        }
index fd28e841faee71bf35ed49a3f6ff21e4455cb8fa..d2333d74c6890f8d1c5563e22e9f27ba633046f2 100644 (file)
@@ -140,12 +140,13 @@ int CollectSharedCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                                
                //set users groups
                util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "collect");
                util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex);
 
-               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
 
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
                                
@@ -157,6 +158,7 @@ int CollectSharedCommand::execute(){
                                cout << order->getLabel() << '\t' << count << endl;
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
+                               userLines.erase(count);
 
                        //you have a label the user want that is smaller than this line and the last line has not already been processed 
                        }
index 0edb024b35084c16255ccc030f41efe271bf5826..9b6411855b19a8cee7a9f5a4489d8fc522a689c8 100644 (file)
 #include "distancecommand.h"
 #include "aligncommand.h"
 #include "matrixoutputcommand.h"
+#include "getsabundcommand.h"
+#include "getrabundcommand.h"
 #include "seqsummarycommand.h"
 
+
 /***********************************************************/
 
 /***********************************************************/
@@ -85,6 +88,8 @@ Command* CommandFactory::getCommand(string commandName){
                else if(commandName == "get.group")             {   command = new GetgroupCommand();                    }
                else if(commandName == "get.label")             {   command = new GetlabelCommand();                    }
                else if(commandName == "get.line")              {   command = new GetlineCommand();                             }
+               else if(commandName == "get.sabund")            {   command = new GetSAbundCommand();                   }
+               else if(commandName == "get.rabund")            {   command = new GetRAbundCommand();                   }
                else if(commandName == "libshuff")              {   command = new LibShuffCommand();                    }
                else if(commandName == "heatmap")                               {   command = new HeatMapCommand();                             }
                else if(commandName == "filter.seqs")                   {   command = new FilterSeqsCommand();          }
index 39fb17e47a4e2f72692f5d5be15f19866fca2bef..06524921a4db4670bdb4a7253977178f468c9b19 100644 (file)
@@ -246,10 +246,18 @@ bool ErrorCheck::checkInput(string input) {
                        else {cout << "Not a valid clustering method.  Valid clustering algorithms are furthest, nearest or average." << endl; return false; }
                }
                
-               if ((commandName == "collect.single") || (commandName == "rarefaction.single") || (commandName == "summary.single") ){ 
+               if ((commandName == "collect.single") || (commandName == "rarefaction.single") || (commandName == "summary.single")){ 
                        if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { cout << "You must read a list, sabund or rabund before you can use the collect.single, rarefaction.single or summary.single commands." << endl; return false; }
                }
                
+               if (commandName == "get.rabund") {
+                       if (globaldata->getListFile() == "") { cout << "You must read a listfile before you can use the get.rabund command." << endl; return false; }
+               }
+               
+               if (commandName == "get.sabund") {
+                       if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "")) { cout << "You must read a list or rabund before you can use the get.sabund command." << endl; return false; }
+               }
+               
                if ((commandName == "collect.shared") || (commandName == "rarefaction.shared") || (commandName == "summary.shared") || (commandName == "bootstrap.shared") || (commandName == "dist.shared")){ 
                        if (globaldata->getSharedFile() == "") {
                                if (globaldata->getListFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared, summary.shared, tree.shared, bootstrap.shared or dist.shared commands." << endl; return false; }
index acb9372ff173b211685ea555531643966f8addc1..eb88fbf5ab807b451b00025d55a1ce719a6c6ccd 100644 (file)
@@ -99,9 +99,10 @@ int GetOTURepCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
 
                
-               while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(list->getLabel()) == 1){
                                        cout << list->getLabel() << '\t' << count << endl;
@@ -110,6 +111,7 @@ int GetOTURepCommand::execute(){
                                        
                                        processedLabels.insert(list->getLabel());
                                        userLabels.erase(list->getLabel());
+                                       userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastList->getLabel()) != 1)) {
diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp
new file mode 100644 (file)
index 0000000..b0f7a92
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ *  getrabundcommand.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 6/2/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "getrabundcommand.h"
+
+//**********************************************************************************************************************
+
+GetRAbundCommand::GetRAbundCommand(){
+       try {
+               globaldata = GlobalData::getInstance();
+               filename = getRootName(globaldata->inputFileName) + "rabund";
+               
+               openOutputFile(filename, out);
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the GetRAbundCommand class Function GetRAbundCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the GetRAbundCommand class function GetRAbundCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+                       
+}
+
+//**********************************************************************************************************************
+
+GetRAbundCommand::~GetRAbundCommand(){
+}
+
+//**********************************************************************************************************************
+
+int GetRAbundCommand::execute(){
+       try {
+               int count = 1;
+               
+               //read first line
+               read = new ReadOTUFile(globaldata->inputFileName);      
+               read->read(&*globaldata); 
+                       
+               input = globaldata->ginput;
+               list = globaldata->gListVector;
+               ListVector* lastList = list;
+               
+               //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
+               set<string> processedLabels;
+               set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
+
+               
+               while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+                       
+                       if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(list->getLabel()) == 1){
+                                       cout << list->getLabel() << '\t' << count << endl;
+                                       rabund = new RAbundVector();
+                                       *rabund = (list->getRAbundVector());
+                                       rabund->print(out);
+                                       delete rabund;
+                                                                                                                       
+                                       processedLabels.insert(list->getLabel());
+                                       userLabels.erase(list->getLabel());
+                                       userLines.erase(count);
+                       }
+                       
+                       if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastList->getLabel()) != 1)) {
+                                       cout << lastList->getLabel() << '\t' << count << endl;
+                                       rabund = new RAbundVector();
+                                       *rabund = (lastList->getRAbundVector());
+                                       rabund->print(out);
+                                       delete rabund;
+
+                                       processedLabels.insert(lastList->getLabel());
+                                       userLabels.erase(lastList->getLabel());
+                       }
+                       
+                       if (count != 1) { delete lastList; }
+                       lastList = list;                        
+                       
+                       list = input->getListVector();
+                       count++;
+               }
+               
+               //output error messages about any remaining user labels
+               set<string>::iterator it;
+               bool needToRun = false;
+               for (it = userLabels.begin(); it != userLabels.end(); it++) {  
+                       cout << "Your file does not include the label "<< *it; 
+                       if (processedLabels.count(lastList->getLabel()) != 1) {
+                               cout << ". I will use " << lastList->getLabel() << "." << endl;
+                               needToRun = true;
+                       }else {
+                               cout << ". Please refer to " << lastList->getLabel() << "." << endl;
+                       }
+               }
+               
+               //run last line if you need to
+               if (needToRun == true)  {
+                       cout << lastList->getLabel() << '\t' << count << endl;
+                       rabund = new RAbundVector();
+                       *rabund = (lastList->getRAbundVector());
+                       rabund->print(out);
+                       delete rabund;
+               }
+               delete lastList;
+
+               out.close(); 
+               return 0;               
+       }
+
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the GetRAbundCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the GetRAbundCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+}
+
+//**********************************************************************************************************************
+
+
diff --git a/getrabundcommand.h b/getrabundcommand.h
new file mode 100644 (file)
index 0000000..66a3211
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef GETRABUNDCOMMAND_H
+#define GETRABUNDCOMMAND_H
+
+/*
+ *  getrabundcommand.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 6/2/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+
+#include "command.hpp"
+#include "inputdata.h"
+#include "readotu.h"
+#include "listvector.hpp"
+
+class GlobalData;
+
+class GetRAbundCommand : public Command {
+public:
+       GetRAbundCommand();
+       ~GetRAbundCommand();
+       int execute();
+       
+private:
+       GlobalData* globaldata;
+       string filename;
+       ofstream out;
+       ReadOTUFile* read;
+       InputData* input;
+       ListVector* list;
+       RAbundVector* rabund;
+};
+
+#endif
+
diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp
new file mode 100644 (file)
index 0000000..8c7f07c
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ *  getsabundcommand.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 6/2/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "getsabundcommand.h"
+
+//**********************************************************************************************************************
+
+GetSAbundCommand::GetSAbundCommand(){
+       try {
+               globaldata = GlobalData::getInstance();
+               filename = getRootName(globaldata->inputFileName) + "sabund";
+               
+               openOutputFile(filename, out);
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the GetSAbundCommand class Function GetSAbundCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the GetSAbundCommand class function GetSAbundCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+                       
+}
+
+//**********************************************************************************************************************
+
+GetSAbundCommand::~GetSAbundCommand(){
+}
+
+//**********************************************************************************************************************
+
+int GetSAbundCommand::execute(){
+       try {
+               int count = 1;
+               
+               //using order vector so you don't have to distinguish between the list and rabund files
+               read = new ReadOTUFile(globaldata->inputFileName);      
+               read->read(&*globaldata); 
+               
+               order = globaldata->gorder;
+               lastOrder = order;
+               input = globaldata->ginput;
+                                               
+               //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
+               set<string> processedLabels;
+               set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
+
+               
+               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+                       
+                       if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
+                                       cout << order->getLabel() << '\t' << count << endl;
+                                       sabund = new SAbundVector();
+                                       *sabund = (order->getSAbundVector());
+                                       sabund->print(out);
+                                       delete sabund;
+
+                                       processedLabels.insert(order->getLabel());
+                                       userLabels.erase(order->getLabel());
+                                       userLines.erase(count);
+                       }
+                       
+                       if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastOrder->getLabel()) != 1)) {
+                                       cout << lastOrder->getLabel() << '\t' << count << endl;
+                                       sabund = new SAbundVector();
+                                       *sabund = (lastOrder->getSAbundVector());
+                                       sabund->print(out);
+                                       delete sabund;
+
+                                       processedLabels.insert(lastOrder->getLabel());
+                                       userLabels.erase(lastOrder->getLabel());
+                       }
+                       
+                       if (count != 1) { delete lastOrder; }
+                       lastOrder = order;      
+                                       
+                       order = (input->getOrderVector());
+                       count++;
+               }
+               
+               //output error messages about any remaining user labels
+               set<string>::iterator it;
+               bool needToRun = false;
+               for (it = userLabels.begin(); it != userLabels.end(); it++) {  
+                       cout << "Your file does not include the label "<< *it; 
+                       if (processedLabels.count(lastOrder->getLabel()) != 1) {
+                               cout << ". I will use " << lastOrder->getLabel() << "." << endl;
+                               needToRun = true;
+                       }else {
+                               cout << ". Please refer to " << lastOrder->getLabel() << "." << endl;
+                       }
+               }
+               
+               //run last line if you need to
+               if (needToRun == true)  {
+                       cout << lastOrder->getLabel() << '\t' << count << endl;
+                       sabund = new SAbundVector();
+                       *sabund = (lastOrder->getSAbundVector());
+                       sabund->print(out);
+                       delete sabund;
+               }
+               delete lastOrder;
+
+               out.close();
+               return 0;               
+       }
+
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the GetSAbundCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the GetSAbundCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+}
+
+//**********************************************************************************************************************
+
+
diff --git a/getsabundcommand.h b/getsabundcommand.h
new file mode 100644 (file)
index 0000000..27d25c2
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef GETSABUNDCOMMAND_H
+#define GETSABUNDCOMMAND_H
+
+/*
+ *  getsabundcommand.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 6/2/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+
+#include "command.hpp"
+#include "inputdata.h"
+#include "readotu.h"
+#include "sabundvector.hpp"
+
+class GlobalData;
+
+class GetSAbundCommand : public Command {
+public:
+       GetSAbundCommand();
+       ~GetSAbundCommand();
+       int execute();
+       
+private:
+       GlobalData* globaldata;
+       string filename, format;
+       ofstream out;
+       ReadOTUFile* read;
+       OrderVector* order;
+       OrderVector* lastOrder;
+       InputData* input;
+       SAbundVector* sabund;
+};
+
+#endif
index c9f6ae524fe7121d59b6538f061830ad522182cd..e99537dcd50f5987a8104be73fc1f3b36e74dc85 100644 (file)
@@ -64,11 +64,12 @@ int HeatMapCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
 
                if (format != "list") { 
                
                        //as long as you are not at the end of the file or done wih the lines you want
-                       while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+                       while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                                if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){                   
        
@@ -77,6 +78,7 @@ int HeatMapCommand::execute(){
                                        
                                        processedLabels.insert(lookup[0]->getLabel());
                                        userLabels.erase(lookup[0]->getLabel());
+                                       userLines.erase(count);
                                }
                                
                                if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLookup[0]->getLabel()) != 1)) {
@@ -122,7 +124,7 @@ int HeatMapCommand::execute(){
                        
                }else{
                
-                       while((rabund != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+                       while((rabund != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
 
                                if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(rabund->getLabel()) == 1){                      
        
@@ -131,6 +133,7 @@ int HeatMapCommand::execute(){
                                        
                                        processedLabels.insert(rabund->getLabel());
                                        userLabels.erase(rabund->getLabel());
+                                       userLines.erase(count);
                                }
                                
                                if ((anyLabelsToProcess(rabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastRAbund->getLabel()) != 1)) {
index 3ecf6df36e5ea33266d409fecee2620aec7a2d9f..6602bf93ae462ab54c9f97433222bd8fab17babc 100644 (file)
@@ -94,13 +94,14 @@ int MatrixOutputCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                                
                if (lookup.size() < 2) { cout << "You have not provided enough valid groups.  I cannot run the command." << endl; return 0;}
                
                numGroups = globaldata->Groups.size();
                                
                //as long as you are not at the end of the file or done wih the lines you want
-               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){                   
                                cout << lookup[0]->getLabel() << '\t' << count << endl;
@@ -108,6 +109,7 @@ int MatrixOutputCommand::execute(){
                                
                                processedLabels.insert(lookup[0]->getLabel());
                                userLabels.erase(lookup[0]->getLabel());
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLookup[0]->getLabel()) != 1)) {
index 20f92f73b3e8107bd47a1e99f253779e67d2a423..c0622f219cc252be7ca0bf29d28ac349cddb3357 100644 (file)
@@ -99,6 +99,7 @@ int ParseListCommand::execute(){
                        //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                        set<string> processedLabels;
                        set<string> userLabels = globaldata->labels;
+                       set<int> userLines = globaldata->lines;
 
                        //read in group map info.
                        groupMap = new GroupMap(globaldata->getGroupFile());
@@ -112,7 +113,7 @@ int ParseListCommand::execute(){
                                                
                        //parses and sets each groups listvector
                        //as long as you are not at the end of the file or done wih the lines you want
-                       while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+                       while((list != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                                                                
                                if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(list->getLabel()) == 1){
                                        cout << list->getLabel() << '\t' << count << endl;
@@ -120,6 +121,7 @@ int ParseListCommand::execute(){
                                        
                                        processedLabels.insert(list->getLabel());
                                        userLabels.erase(list->getLabel());
+                                       userLines.erase(count);
                                }
                                
                                if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastList->getLabel()) != 1)) {
index 752ff62298ed183f18e033982b1e0c20513bd963..114c8d06dc3a3a76fbe22e9ee3aec017e335401c 100644 (file)
@@ -104,9 +104,10 @@ int RareFactCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
        
                //as long as you are not at the end of the file or done wih the lines you want
-               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
                        
@@ -117,6 +118,7 @@ int RareFactCommand::execute(){
                                cout << order->getLabel() << '\t' << count << endl;
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastOrder->getLabel()) != 1)) {
index efcbe8437c0ba18902d493ef3a2c7abfe420c960..c9300259f90726511200a077c9ef633ec7eaa76b 100644 (file)
@@ -83,9 +83,10 @@ int RareFactSharedCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
        
                //as long as you are not at the end of the file or done wih the lines you want
-               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){
                                
@@ -96,6 +97,7 @@ int RareFactSharedCommand::execute(){
                                cout << lookup[0]->getLabel() << '\t' << count << endl;
                                processedLabels.insert(lookup[0]->getLabel());
                                userLabels.erase(lookup[0]->getLabel());
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLookup[0]->getLabel()) != 1)) {
index b4de07b082fb0274c02ba71793c0e3023d192a35..22dc2e9f7ab15a671f4a3dd699ca570655b688a4 100644 (file)
@@ -49,10 +49,11 @@ int SharedCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                
                shared = new Shared();
                
-               while((SharedList != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((SharedList != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                                                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(SharedList->getLabel()) == 1){
@@ -62,6 +63,7 @@ int SharedCommand::execute(){
                                
                                        processedLabels.insert(SharedList->getLabel());
                                        userLabels.erase(SharedList->getLabel());
+                                       userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(SharedList->getLabel(), userLabels, errorOff) == true) && (processedLabels.count(lastList->getLabel()) != 1)) {
index e7fda2e5dedcd8052b3c610931964377e356a7af..9bc0c0f2239282193748a651389af8c238b1daa2 100644 (file)
@@ -144,14 +144,16 @@ int SummaryCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                
-               while((sabund != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((sabund != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(sabund->getLabel()) == 1){                      
        
                                cout << sabund->getLabel() << '\t' << count << endl;
                                processedLabels.insert(sabund->getLabel());
                                userLabels.erase(sabund->getLabel());
+                               userLines.erase(count);
 
                                
                                outputFileHandle << sabund->getLabel();
index fafc290b0cdf8dd9bce4c7cb626797c6bf1ba4af..0a742ea562852e8097485bea5a67200f6d8524c8 100644 (file)
@@ -169,9 +169,10 @@ int SummarySharedCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                
                //as long as you are not at the end of the file or done wih the lines you want
-               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){                   
                                cout << lookup[0]->getLabel() << '\t' << count << endl;
@@ -179,6 +180,7 @@ int SummarySharedCommand::execute(){
                                
                                processedLabels.insert(lookup[0]->getLabel());
                                userLabels.erase(lookup[0]->getLabel());
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLookup[0]->getLabel()) != 1)) {
index 7f97ef3e31bb802b01aa0f86eb2262c50b230ac8..850df46929f8b4f7efa076a17b0052136f204b23 100644 (file)
@@ -329,9 +329,10 @@ void TreeGroupCommand::makeSimsShared() {
                
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
 
                //as long as you are not at the end of the file or done wih the lines you want
-               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){                   
                                cout << lookup[0]->getLabel() << '\t' << count << endl;
@@ -339,6 +340,7 @@ void TreeGroupCommand::makeSimsShared() {
                                
                                processedLabels.insert(lookup[0]->getLabel());
                                userLabels.erase(lookup[0]->getLabel());
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLookup[0]->getLabel()) != 1)) {
index 544933c804abcf2d1aa372936352d9c476aac838..6439e9bfca12a19751b44cd0a570cdd266d81105 100644 (file)
@@ -39,6 +39,8 @@ ValidCommands::ValidCommands() {
                commands["get.group"]           = "get.group";
                commands["get.label"]           = "get.label";
                commands["get.line"]            = "get.line";
+               commands["get.sabund"]          = "get.sabund";
+               commands["get.rabund"]          = "get.rabund";
                commands["bootstrap.shared"]    = "bootstrap.shared";
                commands["concensus"]                   = "concensus";
                commands["help"]                                = "help"; 
index 6069a4fc387521a327b21b5c257bf76a7d170c36..547d4dcd22c944443552ccc11edd7bea4b6e5124 100644 (file)
@@ -239,6 +239,12 @@ void ValidParameters::initCommandParameters() {
 
                string getlineArray[] =  {};
                commandParameters["get.line"] = addParameters(getlineArray, sizeof(getlineArray)/sizeof(string));
+               
+               string getsabundArray[] =  {"line", "label"};
+               commandParameters["get.sabund"] = addParameters(getsabundArray, sizeof(getsabundArray)/sizeof(string));
+               
+               string getrabundArray[] =  {"line", "label"};
+               commandParameters["get.rabund"] = addParameters(getrabundArray, sizeof(getrabundArray)/sizeof(string));
 
                string rarefactionsingleArray[] =  {"iters","freq","line","label","calc","abund"};
                commandParameters["rarefaction.single"] = addParameters(rarefactionsingleArray, sizeof(rarefactionsingleArray)/sizeof(string));
index 519e6cbec1be64d87fbb1af2f54208df1e04e46f..bb3762cc54f741d1e7c0a1fd7bdf9bc6c35f38db 100644 (file)
@@ -115,16 +115,18 @@ int VennCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
                
                if (format != "list") { 
                        
                        //as long as you are not at the end of the file or done wih the lines you want
-                       while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+                       while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                                if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){                   
                                        cout << lookup[0]->getLabel() << '\t' << count << endl;
                                        processedLabels.insert(lookup[0]->getLabel());
                                        userLabels.erase(lookup[0]->getLabel());
+                                       userLines.erase(count);
                                        
                                        if (lookup.size() > 4) {
                                                cout << "Error: Too many groups chosen.  You may use up to 4 groups with the venn command.  I will use the first four groups in your groupfile." << endl;
@@ -184,7 +186,7 @@ int VennCommand::execute(){
                        
                }else{
                
-                       while((sabund != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+                       while((sabund != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                                if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(sabund->getLabel()) == 1){                      
        
@@ -193,6 +195,7 @@ int VennCommand::execute(){
                                        
                                        processedLabels.insert(sabund->getLabel());
                                        userLabels.erase(sabund->getLabel());
+                                       userLines.erase(count);
                                }
                                
                                if ((anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastSAbund->getLabel()) != 1)) {