From: westcott Date: Wed, 3 Jun 2009 12:37:21 +0000 (+0000) Subject: added get.rabund and get.sabund command and fixed bug introduced by line by line... X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=0024441c1ff9a98467ba53cc7420a37c98f32e86 added get.rabund and get.sabund command and fixed bug introduced by line by line optimization --- diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 245ed55..34dacfa 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -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 */; }; @@ -145,7 +149,6 @@ 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 */; }; @@ -230,6 +233,10 @@ 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 = ""; }; + 3749271C0FD58C840031C06B /* getsabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsabundcommand.cpp; sourceTree = ""; }; + 3749273D0FD5956B0031C06B /* getrabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getrabundcommand.h; sourceTree = ""; }; + 3749273E0FD5956B0031C06B /* getrabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getrabundcommand.cpp; sourceTree = ""; }; 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; }; @@ -298,6 +305,10 @@ 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 = ""; }; + 3799A94D0FD6A58C00E33EDE /* distancedb.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = distancedb.hpp; sourceTree = ""; }; + 3799A94E0FD6A58C00E33EDE /* seqsummarycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seqsummarycommand.cpp; sourceTree = ""; }; + 3799A94F0FD6A58C00E33EDE /* seqsummarycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seqsummarycommand.h; sourceTree = ""; }; 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; }; @@ -469,8 +480,6 @@ 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 = ""; }; - 7E9214810FD2081200699BF3 /* seqsummarycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seqsummarycommand.cpp; sourceTree = ""; }; 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; }; @@ -747,8 +756,6 @@ 37D928A90F2133E5001D4494 /* commands */ = { isa = PBXGroup; children = ( - 7E9214800FD2081200699BF3 /* seqsummarycommand.h */, - 7E9214810FD2081200699BF3 /* seqsummarycommand.cpp */, 37D927CD0F21331F001D4494 /* command.hpp */, 378DC5CD0FBDE1C8003B8607 /* aligncommand.h */, 378DC5CE0FBDE1C8003B8607 /* aligncommand.cpp */, @@ -778,6 +785,10 @@ 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 */, @@ -804,6 +815,8 @@ 372E126F0F26365B0095CF7E /* readotucommand.cpp */, 37E5F4900F2A3DA800F8D827 /* readtreecommand.h */, 37E5F4910F2A3DA800F8D827 /* readtreecommand.cpp */, + 3799A94E0FD6A58C00E33EDE /* seqsummarycommand.cpp */, + 3799A94F0FD6A58C00E33EDE /* seqsummarycommand.h */, 37D928270F21331F001D4494 /* sharedcommand.h */, 37D928260F21331F001D4494 /* sharedcommand.cpp */, 37D928470F21331F001D4494 /* summarycommand.h */, @@ -834,6 +847,8 @@ 37D927D40F21331F001D4494 /* database.hpp */, 37D927D30F21331F001D4494 /* database.cpp */, 37D927D50F21331F001D4494 /* datavector.hpp */, + 3799A94C0FD6A58C00E33EDE /* distancedb.cpp */, + 3799A94D0FD6A58C00E33EDE /* distancedb.hpp */, 37D927DC0F21331F001D4494 /* fastamap.h */, 37D927DB0F21331F001D4494 /* fastamap.cpp */, 375873EA0F7D64520040F377 /* fullmatrix.h */, @@ -1098,7 +1113,10 @@ 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; }; diff --git a/binsequencecommand.cpp b/binsequencecommand.cpp index c217578..8f0bb9f 100644 --- a/binsequencecommand.cpp +++ b/binsequencecommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/bootstrapsharedcommand.cpp b/bootstrapsharedcommand.cpp index 2835061..9ffd2b7 100644 --- a/bootstrapsharedcommand.cpp +++ b/bootstrapsharedcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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; diff --git a/collectcommand.cpp b/collectcommand.cpp index 01f2fff..3d7f1b0 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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 } diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index fd28e84..d2333d7 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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 } diff --git a/commandfactory.cpp b/commandfactory.cpp index 0edb024..9b64118 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -43,8 +43,11 @@ #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(); } diff --git a/errorchecking.cpp b/errorchecking.cpp index 39fb17e..0652492 100644 --- a/errorchecking.cpp +++ b/errorchecking.cpp @@ -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; } diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index acb9372..eb88fbf 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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 index 0000000..b0f7a92 --- /dev/null +++ b/getrabundcommand.cpp @@ -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 processedLabels; + set userLabels = globaldata->labels; + set 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::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 index 0000000..66a3211 --- /dev/null +++ b/getrabundcommand.h @@ -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 index 0000000..8c7f07c --- /dev/null +++ b/getsabundcommand.cpp @@ -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 processedLabels; + set userLabels = globaldata->labels; + set 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::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 index 0000000..27d25c2 --- /dev/null +++ b/getsabundcommand.h @@ -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 diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index c9f6ae5..e99537d 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index 3ecf6df..6602bf9 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/parselistcommand.cpp b/parselistcommand.cpp index 20f92f7..c0622f2 100644 --- a/parselistcommand.cpp +++ b/parselistcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index 752ff62..114c8d0 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index efcbe84..c930025 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/sharedcommand.cpp b/sharedcommand.cpp index b4de07b..22dc2e9 100644 --- a/sharedcommand.cpp +++ b/sharedcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/summarycommand.cpp b/summarycommand.cpp index e7fda2e..9bc0c0f 100644 --- a/summarycommand.cpp +++ b/summarycommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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(); diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index fafc290..0a742ea 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 7f97ef3..850df46 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -329,9 +329,10 @@ void TreeGroupCommand::makeSimsShared() { set processedLabels; set userLabels = globaldata->labels; + set 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)) { diff --git a/validcommands.cpp b/validcommands.cpp index 544933c..6439e9b 100644 --- a/validcommands.cpp +++ b/validcommands.cpp @@ -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"; diff --git a/validparameter.cpp b/validparameter.cpp index 6069a4f..547d4dc 100644 --- a/validparameter.cpp +++ b/validparameter.cpp @@ -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)); diff --git a/venncommand.cpp b/venncommand.cpp index 519e6cb..bb3762c 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -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 processedLabels; set userLabels = globaldata->labels; + set 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)) {