]> git.donarmstrong.com Git - mothur.git/commitdiff
added boneh, efron, and solow calculators
authorwestcott <westcott>
Mon, 18 May 2009 18:24:13 +0000 (18:24 +0000)
committerwestcott <westcott>
Mon, 18 May 2009 18:24:13 +0000 (18:24 +0000)
19 files changed:
boneh.cpp [new file with mode: 0644]
boneh.h [new file with mode: 0644]
collectcommand.cpp
collectcommand.h
collectsharedcommand.cpp
efron.cpp [new file with mode: 0644]
efron.h [new file with mode: 0644]
errorchecking.cpp
errorchecking.h
filterseqscommand.cpp
globaldata.cpp
globaldata.hpp
solow.cpp [new file with mode: 0644]
solow.h [new file with mode: 0644]
summarycommand.cpp
summarycommand.h
summarysharedcommand.cpp
validcalculator.cpp
validparameter.cpp

diff --git a/boneh.cpp b/boneh.cpp
new file mode 100644 (file)
index 0000000..7b52683
--- /dev/null
+++ b/boneh.cpp
@@ -0,0 +1,87 @@
+/*
+ *  boneh.cpp
+ *  Mothur
+ *
+ *  Created by Thomas Ryabin on 5/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "boneh.h"
+#include <math.h>
+
+/***********************************************************************/
+double Boneh::getV(double f1, double n, double rs) {
+
+       //cout << "f1 = " << f1 << "\nn = " << n << "\nrs = " << rs << "\n\n";
+       
+       double accuracy = .0001;
+       double v = 100000.0;
+       double step = v/2;
+       double ls = v * (1 - pow((1 - f1/(n*v)), n));
+       
+       //cout << "ls = " << ls << "\n";
+       
+       while(abs(ls - rs) > accuracy) {
+               if(ls > rs)
+                       v -= step;
+               else
+                       v += step;
+               
+               ls = v* (1 - pow((1 - f1/(n*v)), n));
+               step /= 2;
+               
+       //      cout << "ls = " << ls << "\n";
+       }
+       
+       return v;
+}
+       
+/***********************************************************************/      
+EstOutput Boneh::getValues(SAbundVector* rank){
+
+       try {
+               data.resize(1,0);
+               
+               bool valid = false;
+               double sum = 0;
+               double n = (double)rank->size() - 1;
+               double f1 = (double)rank->get(1);
+               
+               for(int i = 1; i < rank->size(); i++)
+                       sum += (double)rank->get(i) * exp(-i);
+               
+               if(rank->get(1) > sum)
+                       valid = true;
+               
+               sum = 0;
+               if(valid) {
+                       for(int j = 1; j < rank->size(); j++)
+                               sum += rank->get(j) * pow((1 - (double)j / n), n);
+                       
+                       double v = getV(f1, n, sum);
+                       
+               //      cout << "v = " << v << "\n";
+                       
+                       sum = 0;
+                       for(int j = 1; j < rank->size(); j++)
+                               sum += pow(1 - (double)rank->get(j) / n, n) * (1 - pow(1 - (double)rank->get(j) / n, m)) + v * pow(1 - f1/(n*v), n) * (1 - pow(1 - f1/(n*v), m));
+                               
+               }
+
+               data[0] = sum;
+               
+               return data;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Coverage class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+};
+
+
+/***********************************************************************/
diff --git a/boneh.h b/boneh.h
new file mode 100644 (file)
index 0000000..919200c
--- /dev/null
+++ b/boneh.h
@@ -0,0 +1,34 @@
+#ifndef BONEH_H
+#define BONEH_H
+
+/*
+ *  boneh.h
+ *  Mothur
+ *
+ *  Created by Thomas Ryabin on 5/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/* This class implements the boneh calculator on single group. 
+ It is a child of the calculator class. */
+
+/***********************************************************************/
+
+class Boneh : public Calculator  {
+       
+public: 
+       Boneh(int size) : m(size), Calculator("boneh", 1, false) {};
+       EstOutput getValues(SAbundVector*);     
+       EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+private:
+       double getV(double, double, double);
+       int m;
+};
+
+
+/***********************************************************************/
+
+#endif
index 233b7bef963a22bdc0ab9a2e524699bc49e4366c..e429dffb19721c6f8c124734f78f7ff2bf937e3c 100644 (file)
@@ -23,7 +23,9 @@
 #include "bergerparker.h"
 #include "bstick.h"
 #include "goodscoverage.h"
-
+#include "efron.h"
+#include "boneh.h"
+#include "solow.h"
 
 #include "coverage.h"
 
@@ -71,6 +73,15 @@ CollectCommand::CollectCommand(){
                                        cDisplays.push_back(new CollectDisplay(new BStick(), new ThreeColumnFile(fileNameRoot+"bstick")));
                                }else if (globaldata->Estimators[i] == "goodscoverage") { 
                                        cDisplays.push_back(new CollectDisplay(new GoodsCoverage(), new OneColumnFile(fileNameRoot+"goodscoverage")));
+                               }else if (globaldata->Estimators[i] == "efron") {
+                                       convert(globaldata->getSize(), size); 
+                                       cDisplays.push_back(new CollectDisplay(new Efron(size), new OneColumnFile(fileNameRoot+"efron")));
+                               }else if (globaldata->Estimators[i] == "boneh") {
+                                       convert(globaldata->getSize(), size); 
+                                       cDisplays.push_back(new CollectDisplay(new Boneh(size), new OneColumnFile(fileNameRoot+"boneh")));
+                               }else if (globaldata->Estimators[i] == "solow") {
+                                       convert(globaldata->getSize(), size); 
+                                       cDisplays.push_back(new CollectDisplay(new Solow(size), new OneColumnFile(fileNameRoot+"solow")));
                                }
                        }
                }
index 016f37e225f5b065d90278d5db5db2c0331d2464..8057f9ff78fc1f749a986772f53664ae4e03c75d 100644 (file)
@@ -49,7 +49,7 @@ private:
        Collect* cCurve;
        ValidCalculators* validCalculator;
        vector<Display*> cDisplays;
-       int freq, abund;
+       int freq, abund, size;
 
 };
 
index 0ac767ddc9cc1410352fd8f34701413d3359140b..582628d8f6a98151efb9a525bf9cdc26383be379 100644 (file)
@@ -30,7 +30,7 @@
 #include "sharedmorisitahorn.h"
 #include "sharedbraycurtis.h"
 #include "sharedjackknife.h"
-#include "sharedwhittaker.h"
+#include "whittaker.h"
 
 
 
diff --git a/efron.cpp b/efron.cpp
new file mode 100644 (file)
index 0000000..e843641
--- /dev/null
+++ b/efron.cpp
@@ -0,0 +1,44 @@
+/*
+ *  efron.cpp
+ *  Mothur
+ *
+ *  Created by Thomas Ryabin on 5/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "efron.h"
+#include <math.h>
+
+/***********************************************************************/
+EstOutput Efron::getValues(SAbundVector* rank){
+
+       try {
+               data.resize(1,0);
+               
+               if(m > rank->size()-1) {
+                       cout << "Error in the 'efron' calculator. 'size' must be less than the length of the smalled sabund vector.\n";
+                       data[0] = 0;
+                       return data;
+               }
+               
+               double sum = 0;
+               for(int i = 1; i < rank->size(); i++)
+                       sum += pow(-1, (double)(i+1)) * pow(((double)m / (double)(rank->size()-1)), i) * (double)(rank->get(i));
+
+               data[0] = sum;
+               
+               return data;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Coverage class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+};
+
+
+/***********************************************************************/
diff --git a/efron.h b/efron.h
new file mode 100644 (file)
index 0000000..652159d
--- /dev/null
+++ b/efron.h
@@ -0,0 +1,33 @@
+#ifndef EFRON_H
+#define EFRON_H
+
+/*
+ *  efron.h
+ *  Mothur
+ *
+ *  Created by Thomas Ryabin on 5/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/* This class implements the efron calculator on single group. 
+ It is a child of the calculator class. */
+
+/***********************************************************************/
+
+class Efron : public Calculator  {
+       
+public: 
+       Efron(int size) : m(size), Calculator("efron", 1, false) {};
+       EstOutput getValues(SAbundVector*);     
+       EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+private:
+       int m;
+};
+
+
+/***********************************************************************/
+
+#endif
index dfe96072e3e8ae8799856982f56b85fff15b0289..b460987ae401827664d14cdc5645905e0d673d8e 100644 (file)
@@ -118,6 +118,8 @@ bool ErrorCheck::checkInput(string input) {
                                if (parameter == "scale" )                      { scale = value;        }
                                if (parameter == "ends" )                       { ends = value; }
                                if (parameter == "processors" )         { processors = value;   }
+                               if (parameter == "size" )                       { size = value; }
+
                                if (parameter == "template")            { templatefile = value; }
                                if (parameter == "search")                      { search = value;               }
                                if (parameter == "ksize")                       { ksize = value;                }
@@ -167,6 +169,7 @@ bool ErrorCheck::checkInput(string input) {
                                if (parameter == "scale" )                      { scale = value;        }
                                if (parameter == "ends" )                       { ends = value; }
                                if (parameter == "processors" )         { processors = value;   }
+                               if (parameter == "size" )                       { size = value; }
                                if (parameter == "template")            { templatefile = value; }
                                if (parameter == "search")                      { search = value;               }
                                if (parameter == "ksize")                       { ksize = value;                }
index d6388f7d2337bacafd148a201cc62a27f83e1375..5057ab02b2962d92ea3814fdfabf5e039eda2dd7 100644 (file)
@@ -35,7 +35,7 @@ class ErrorCheck {
                void clear();
                void refresh();
                string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, nexusfile, clustalfile, treefile, sharedfile, cutoff, format; 
-               string precision, method, fileroot, label, line, iters, jumble, freq, single, rarefaction, shared, summary, randomtree, abund, sorted, trump, soft, filter, scale, ends, processors;
+               string precision, method, fileroot, label, line, iters, jumble, freq, single, rarefaction, shared, summary, randomtree, abund, sorted, trump, soft, filter, scale, ends, processors, size;
                string templatefile, search, ksize, align, match, mismatch, gapopen, gapextend;
                string commandName, optionText;
                bool errorFree;
index 6170d0043252b8283728db25b59a4adc5b7930b2..f4cc6d82fbe5d97779d4d80dbba9ee9a483940ab 100644 (file)
@@ -14,7 +14,7 @@ void FilterSeqsCommand::doTrump() {
        trump = globaldata->getTrump();
        for(int i = 0; i < db->size(); i++) {
                Sequence cur = db->get(i);
-               string curAligned = cur.getUnaligned();
+               string curAligned = cur.getAligned();
                for(int j = 0; j < curAligned.length(); j++) {
                        string curChar = curAligned.substr(j, 1);
                        if(curChar.compare(trump) == 0) 
@@ -37,7 +37,7 @@ void FilterSeqsCommand::doSoft() {
        
        for(int i = 0; i < db->size(); i++) {
                Sequence cur = db->get(i);
-               string curAligned = cur.getUnaligned();
+               string curAligned = cur.getAligned();
                
                for(int j = 0; j < curAligned.length(); j++) {
                        string curChar = curAligned.substr(j, 1);
@@ -112,7 +112,7 @@ int FilterSeqsCommand::execute() {
                db = readSeqs->getDB();
                
                //for(int i = 0; i < db->size(); i++) {
-//                     cout << db->get(i).getLength() << "\n" << db->get(i).getName() << ": " << db->get(i).getUnaligned() << "\n\n";
+//                     cout << db->get(i).getLength() << "\n" << db->get(i).getName() << ": " << db->get(i).getAligned() << "\n\n";
 //             }
 
                for(int i = 0; i < db->get(0).getLength(); i++) 
@@ -140,7 +140,7 @@ int FilterSeqsCommand::execute() {
                SequenceDB newDB;
                for(int i = 0; i < db->size(); i++) {
                        Sequence curSeq = db->get(i);
-                       string curAligned = curSeq.getUnaligned();
+                       string curAligned = curSeq.getAligned();
                        string curName = curSeq.getName();
                        string newAligned = "";
                        for(int j = 0; j < curAligned.length(); j++) 
index b4239f36bebb2fce5544cb171d6493c0d4a86aaf..88c5a13aa364239131f0d86ecb2b99dfe25d5930 100644 (file)
@@ -85,6 +85,11 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                if (key == "scale")                     { scale = value;                }
                                if (key == "ends" )                     { ends = value;                 }
                                if (key == "processors" )       { processors = value;   }
+                               if (key == "size" )         { size = value;         }
+                               
+
+                               
+
                                if (key == "template")          { templatefile = value; }
                                if (key == "search")            { search = value;               }
                                if (key == "ksize")                     { ksize = value;                }
@@ -155,6 +160,8 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        if (key == "scale")                     { scale = value;                }
                        if (key == "ends" )                     { ends = value;                 }
                        if (key == "processors" )       { processors = value;   }
+                       if (key == "size" )         { size = value;         }
+
                        if (key == "template")          { templatefile = value; }
                        if (key == "search")            { search = value;               }
                        if (key == "ksize")                     { ksize = value;                }
@@ -196,7 +203,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                //input defaults for calculators
                if (commandName == "collect.single") {
 
-                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
+                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson-efron-boneh-solow"; }
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
@@ -212,7 +219,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        splitAtDash(calc, Estimators); 
                }
                if (commandName == "summary.single") {
-                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
+                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson-efron-boneh-solow"; }
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
@@ -300,6 +307,13 @@ string GlobalData::getFilter()                     {   return filter;              }
 string GlobalData::getScale()                  {       return scale;           }
 string GlobalData::getEnds()                   {   return ends;                }
 string GlobalData::getProcessors()             {       return processors;      }
+string GlobalData::getSize()            {   return size;        }
+
+void GlobalData::setListFile(string file)      {       listfile = file;        inputFileName = file;}
+void GlobalData::setRabundFile(string file)    {       rabundfile = file;      inputFileName = file;}
+void GlobalData::setSabundFile(string file)    {       sabundfile = file;      inputFileName = file;}
+void GlobalData::setPhylipFile(string file)    {       phylipfile = file;    inputFileName = file;}
+void GlobalData::setColumnFile(string file)    {       columnfile = file;    inputFileName = file;}
 string GlobalData::getTemplateFile()   {       return templatefile;}
 string GlobalData::getSearch()                 {       return search;          }
 string GlobalData::getKSize()                  {       return ksize;           }
@@ -309,12 +323,7 @@ string GlobalData::getMismatch()           {       return mismatch;        }
 string GlobalData::getGapopen()                        {       return gapopen;         }
 string GlobalData::getGapextend()              {       return gapextend;       }
 
-void GlobalData::setListFile(string file)              {       listfile = file;        inputFileName = file;}
 void GlobalData::setGroupFile(string file)             {       groupfile = file;       }
-void GlobalData::setRabundFile(string file)            {       rabundfile = file;      inputFileName = file;}
-void GlobalData::setSabundFile(string file)            {       sabundfile = file;      inputFileName = file;}
-void GlobalData::setPhylipFile(string file)            {       phylipfile = file;    inputFileName = file;}
-void GlobalData::setColumnFile(string file)            {       columnfile = file;    inputFileName = file;}
 void GlobalData::setSharedFile(string file)            {       sharedfile = file;      inputFileName = file; fileroot = file;}
 void GlobalData::setNameFile(string file)              {       namefile = file;                }
 void GlobalData::setFormat(string Format)              {       format = Format;                }
@@ -377,6 +386,7 @@ void GlobalData::clear() {
        scale                   =       "log10";
        ends                    =   "T";  //yes
        processors              =       "1";
+       size            =   "1000";
        search                  =       "suffix";
        ksize                   =       "7";
        align                   =       "blast";
@@ -384,8 +394,6 @@ void GlobalData::clear() {
        mismatch                =       "-1.0";
        gapopen                 =       "-5.0";
        gapextend               =       "-2.0";
-       
-
 }
 
 //*******************************************************/
@@ -407,6 +415,7 @@ void GlobalData::reset() {
        form                    =       "integral";
        ends                    =   "T";
        processors              =       "1";
+       size            =   "1000";
        search                  =       "suffix";
        ksize                   =       "7";
        align                   =       "blast";
index cb9aff67dfb4c07918891630c8729b61960451b5..d427aba4436eae1811be227fe0e59b25a4495be4 100644 (file)
@@ -77,6 +77,7 @@ public:
        string getSorted();
        string getEnds();
        string getProcessors();
+       string getSize();
        string getTemplateFile();
        string getSearch();
        string getKSize();
@@ -123,7 +124,7 @@ public:
 private:
 
        string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, nexusfile, clustalfile, treefile, sharedfile, line, label, randomtree, groups;
-       string cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, filter, scale, ends, processors, templatefile, search, ksize, align, match;
+       string cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, filter, scale, ends, processors, templatefile, search, ksize, align, match, size;
        string mismatch, gapopen, gapextend;
 
 
diff --git a/solow.cpp b/solow.cpp
new file mode 100644 (file)
index 0000000..3a15fdf
--- /dev/null
+++ b/solow.cpp
@@ -0,0 +1,39 @@
+/*
+ *  solow.cpp
+ *  Mothur
+ *
+ *  Created by Thomas Ryabin on 5/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "solow.h"
+#include <math.h>
+
+       
+/***********************************************************************/      
+EstOutput Solow::getValues(SAbundVector* rank){
+
+       try {
+               data.resize(1,0);
+               
+               double n = (double)rank->size() - 1;
+               double f1 = (double)rank->get(1);
+               double f2 = (double)rank->get(2);
+
+               data[0] = f1*f1/2/f2 * (1 - pow(1 - 2*f2/n/f1, m));
+               
+               return data;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Coverage class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+};
+
+
+/***********************************************************************/
diff --git a/solow.h b/solow.h
new file mode 100644 (file)
index 0000000..6d58df2
--- /dev/null
+++ b/solow.h
@@ -0,0 +1,33 @@
+#ifndef SOLOW_H
+#define SOLOW_H
+
+/*
+ *  solow.h
+ *  Mothur
+ *
+ *  Created by Thomas Ryabin on 5/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/* This class implements the solow calculator on single group. 
+ It is a child of the calculator class. */
+
+/***********************************************************************/
+
+class Solow : public Calculator  {
+       
+public: 
+       Solow(int size) : m(size), Calculator("solow", 1, false) {};
+       EstOutput getValues(SAbundVector*);     
+       EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+private:
+       int m;
+};
+
+
+/***********************************************************************/
+
+#endif
index bd8deb1c60d1682a8d6b1377d6a46434ec823916..d0124d8516033800804e16cf5a092af8517e7fe7 100644 (file)
@@ -24,6 +24,9 @@
 #include "bstick.h"
 #include "goodscoverage.h"
 #include "coverage.h"
+#include "efron.h"
+#include "boneh.h"
+#include "solow.h"
 
 //**********************************************************************************************************************
 
@@ -70,6 +73,15 @@ SummaryCommand::SummaryCommand(){
                                        sumCalculators.push_back(new NSeqs());
                                }else if (globaldata->Estimators[i] == "goodscoverage") { 
                                        sumCalculators.push_back(new GoodsCoverage());
+                               }else if (globaldata->Estimators[i] == "efron") { 
+                                       convert(globaldata->getSize(), size);
+                                       sumCalculators.push_back(new Efron(size));
+                               }else if (globaldata->Estimators[i] == "boneh") { 
+                                       convert(globaldata->getSize(), size);
+                                       sumCalculators.push_back(new Boneh(size));
+                               }else if (globaldata->Estimators[i] == "solow") { 
+                                       convert(globaldata->getSize(), size);
+                                       sumCalculators.push_back(new Solow(size));
                                }
                        }
                }
index 8f42f459bf2de9a6c12679a42ea8bbf35c7835a1..135c4025ec15d0097c6bee83f239039bf22c83f4 100644 (file)
@@ -46,6 +46,6 @@ private:
        SAbundVector* sabund;
        string outputFileName;
        ofstream outputFileHandle;
-       int abund;
+       int abund, size;
 };
 #endif
index 486e6c4982b885c82a39e5387b0b987e54f843ec..46055c0f6f9f428db22e258b9f4a28c060ac774f 100644 (file)
@@ -30,7 +30,7 @@
 #include "sharedmorisitahorn.h"
 #include "sharedbraycurtis.h"
 #include "sharedjackknife.h"
-#include "sharedwhittaker.h"
+#include "whittaker.h"
 
 
 //**********************************************************************************************************************
index 14fa775e7398d4be2b5b13a02f111303093c9e9d..7a07fd1af9e7eab2b7e7551cb170a852b62aa031 100644 (file)
@@ -201,6 +201,9 @@ void ValidCalculators::initialSingle() {
                single["goodscoverage"] = "goodscoverage";
                single["nseqs"]                 = "nseqs";
                single["coverage"]              = "coverage";
+               single["efron"]         = "efron";
+               single["boneh"]         = "boneh";
+               single["solow"]         = "solow";
                single["default"]           = "default";
        }
        catch(exception& e) {
@@ -294,6 +297,9 @@ void ValidCalculators::initialSummary() {
                summary["nseqs"]                = "nseqs";
                summary["goodscoverage"]= "goodscoverage";
                summary["coverage"]             = "coverage";
+               summary["efron"]        = "efron";
+               summary["boneh"]        = "boneh";
+               summary["solow"]        = "solow";
                summary["default"]          = "default";
        }
        catch(exception& e) {
index e79a2db2663a48ceee335dba6c1a77973dd09bb6..1a1555df410d25f18b11176ffe2fb5aa0f1af6d6 100644 (file)
@@ -225,7 +225,7 @@ void ValidParameters::initCommandParameters() {
                string deconvoluteArray[] =  {"fasta"};
                commandParameters["deconvolute"] = addParameters(deconvoluteArray, sizeof(deconvoluteArray)/sizeof(string));
                
-               string collectsingleArray[] =  {"freq","line","label","calc","abund"};
+               string collectsingleArray[] =  {"freq","line","label","calc","abund","size"};
                commandParameters["collect.single"] = addParameters(collectsingleArray, sizeof(collectsingleArray)/sizeof(string));
 
                string collectsharedArray[] =  {"freq","line","label","calc","groups"};
@@ -249,7 +249,7 @@ void ValidParameters::initCommandParameters() {
                string libshuffArray[] =  {"iters","groups","step","form","cutoff"};
                commandParameters["libshuff"] = addParameters(libshuffArray, sizeof(libshuffArray)/sizeof(string));
                
-               string summarysingleArray[] =  {"line","label","calc","abund"};
+               string summarysingleArray[] =  {"line","label","calc","abund","size"};
                commandParameters["summary.single"] = addParameters(summarysingleArray, sizeof(summarysingleArray)/sizeof(string));
 
                string summarysharedArray[] =  {"line","label","calc","groups"};
@@ -346,6 +346,9 @@ void ValidParameters::initParameterRanges() {
                
                string softArray[] = {">=","0", "<=","100", "between"};
                parameterRanges["soft"] = addParameters(softArray, rangeSize);
+               
+               string sizeArray[] = {">=","1", "<","NA", "between"};
+               parameterRanges["size"] = addParameters(sizeArray, rangeSize);
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";