objects = {
/* Begin PBXFileReference section */
+ 7E4EBD43122018FB00D85E7B /* simpsoneven.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simpsoneven.h; sourceTree = "<group>"; };
+ 7E4EBD44122018FB00D85E7B /* simpsoneven.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simpsoneven.cpp; sourceTree = "<group>"; };
+ 7E5B28DC121FEFCC0005339C /* shannoneven.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shannoneven.h; sourceTree = "<group>"; };
+ 7E5B28DD121FEFCC0005339C /* shannoneven.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shannoneven.cpp; sourceTree = "<group>"; };
+ 7E5B2917121FF53C0005339C /* heip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = heip.h; sourceTree = "<group>"; };
+ 7E5B2918121FF53C0005339C /* heip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = heip.cpp; sourceTree = "<group>"; };
+ 7E5B294A121FFADC0005339C /* smithwilson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smithwilson.h; sourceTree = "<group>"; };
+ 7E5B294B121FFADC0005339C /* smithwilson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smithwilson.cpp; sourceTree = "<group>"; };
7E84528511EF4BEB00564975 /* seqerrorcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seqerrorcommand.h; sourceTree = "<group>"; };
7E84528611EF4BEB00564975 /* seqerrorcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seqerrorcommand.cpp; sourceTree = "<group>"; };
7E85BD1C11EB5E9B00FD37C0 /* qualityscores.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qualityscores.h; sourceTree = "<group>"; };
7E85BD1D11EB5E9B00FD37C0 /* qualityscores.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qualityscores.cpp; sourceTree = "<group>"; };
+ 7E962A40121F76B1007464B5 /* invsimpson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = invsimpson.h; sourceTree = "<group>"; };
+ 7E962A41121F76B1007464B5 /* invsimpson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = invsimpson.cpp; sourceTree = "<group>"; };
7EA299BA11E384940022D8D3 /* sensspeccommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sensspeccommand.h; sourceTree = "<group>"; };
7EA299BB11E384940022D8D3 /* sensspeccommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sensspeccommand.cpp; sourceTree = "<group>"; };
7EC61A0911BEA6AF00F668D9 /* weightedlinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = weightedlinkage.cpp; sourceTree = "<group>"; };
08FB7794FE84155DC02AAC07 /* mothur */ = {
isa = PBXGroup;
children = (
+ 7E5B28DC121FEFCC0005339C /* shannoneven.h */,
+ 7E5B28DD121FEFCC0005339C /* shannoneven.cpp */,
A7639F8D1175DF35008F5578 /* makefile */,
A7DA1FF0113FECD400BF472F /* alignment.cpp */,
A7DA1FF1113FECD400BF472F /* alignment.hpp */,
A7CB593B11402EF90010EB83 /* calculators */ = {
isa = PBXGroup;
children = (
+ 7E4EBD43122018FB00D85E7B /* simpsoneven.h */,
+ 7E4EBD44122018FB00D85E7B /* simpsoneven.cpp */,
+ 7E5B294A121FFADC0005339C /* smithwilson.h */,
+ 7E5B294B121FFADC0005339C /* smithwilson.cpp */,
+ 7E962A40121F76B1007464B5 /* invsimpson.h */,
+ 7E962A41121F76B1007464B5 /* invsimpson.cpp */,
A7DA200B113FECD400BF472F /* calculator.cpp */,
A7DA200C113FECD400BF472F /* calculator.h */,
A7DA1FED113FECD400BF472F /* ace.h */,
A7CB593E11402F110010EB83 /* commands */ = {
isa = PBXGroup;
children = (
+ 7E5B2917121FF53C0005339C /* heip.h */,
+ 7E5B2918121FF53C0005339C /* heip.cpp */,
A7DA202B113FECD400BF472F /* command.hpp */,
A7DA1FEF113FECD400BF472F /* aligncommand.h */,
A7DA1FEE113FECD400BF472F /* aligncommand.cpp */,
#include "chao1.h"
#include "bootstrap.h"
#include "simpson.h"
+#include "simpsoneven.h"
+#include "invsimpson.h"
#include "npshannon.h"
#include "shannon.h"
+#include "smithwilson.h"
+#include "heip.h"
+#include "shannoneven.h"
#include "jackknife.h"
#include "geom.h"
#include "qstat.h"
}else if (Estimators[i] == "shannon") {
cDisplays.push_back(new CollectDisplay(new Shannon(), new ThreeColumnFile(fileNameRoot+"shannon")));
outputNames.push_back(fileNameRoot+"shannon");
+ }else if (Estimators[i] == "shannoneven") {
+ cDisplays.push_back(new CollectDisplay(new ShannonEven(), new OneColumnFile(fileNameRoot+"shannoneven")));
+ outputNames.push_back(fileNameRoot+"shannoneven");
}else if (Estimators[i] == "npshannon") {
cDisplays.push_back(new CollectDisplay(new NPShannon(), new OneColumnFile(fileNameRoot+"np_shannon")));
outputNames.push_back(fileNameRoot+"np_shannon");
+ }else if (Estimators[i] == "heip") {
+ cDisplays.push_back(new CollectDisplay(new Heip(), new OneColumnFile(fileNameRoot+"heip")));
+ outputNames.push_back(fileNameRoot+"heip");
+ }else if (Estimators[i] == "smithwilson") {
+ cDisplays.push_back(new CollectDisplay(new SmithWilson(), new OneColumnFile(fileNameRoot+"smithwilson")));
+ outputNames.push_back(fileNameRoot+"smithwilson");
}else if (Estimators[i] == "simpson") {
cDisplays.push_back(new CollectDisplay(new Simpson(), new ThreeColumnFile(fileNameRoot+"simpson")));
outputNames.push_back(fileNameRoot+"simpson");
+ }else if (Estimators[i] == "simpsoneven") {
+ cDisplays.push_back(new CollectDisplay(new SimpsonEven(), new OneColumnFile(fileNameRoot+"simpsoneven")));
+ outputNames.push_back(fileNameRoot+"simpsoneven");
+ }else if (Estimators[i] == "invsimpson") {
+ cDisplays.push_back(new CollectDisplay(new InvSimpson(), new ThreeColumnFile(fileNameRoot+"invsimpson")));
+ outputNames.push_back(fileNameRoot+"invsimpson");
}else if (Estimators[i] == "bootstrap") {
cDisplays.push_back(new CollectDisplay(new Bootstrap(), new OneColumnFile(fileNameRoot+"bootstrap")));
outputNames.push_back(fileNameRoot+"bootstrap");
--- /dev/null
+/*
+ * heip.cpp
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "heip.h"
+#include "shannon.h"
+
+/***********************************************************************/
+
+EstOutput Heip::getValues(SAbundVector* rank){
+ try {
+ data.resize(1,0.0000);
+ vector<double> shanData(3,0);
+ Shannon* shannon = new Shannon();
+ shanData = shannon->getValues(rank);
+
+ long int sobs = rank->getNumBins();
+ if(sobs > 1){
+ data[0] = (exp(shanData[0])-1) / (sobs - 1);;
+ }
+ else{
+ data[0] = 1;
+ }
+
+ delete shannon;
+ return data;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Heip", "getValues");
+ exit(1);
+ }
+}
+
+/***********************************************************************/
--- /dev/null
+#ifndef HEIP
+#define HEIP
+
+/*
+ * heip.h
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class Heip : public Calculator {
+
+public:
+ Heip() : Calculator("heip", 1, false) {};
+ EstOutput getValues(SAbundVector*);
+ EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+};
+
+/***********************************************************************/
+
+#endif
--- /dev/null
+/*
+ * invsimpson.cpp
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/20/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "invsimpson.h"
+#include "simpson.h"
+
+/***********************************************************************/
+
+EstOutput InvSimpson::getValues(SAbundVector* rank){
+ try {
+ //vector<double> simpsonData(3,0);
+ data.resize(3,0);
+ vector<double> simpData(3,0);
+ Simpson* simp = new Simpson();
+ simpData = simp->getValues(rank);
+
+ if(simpData[0] != 0){
+ data[0] = 1/simpData[0];
+ data[1] = 1/simpData[2];
+ data[2] = 1/simpData[1];
+ }
+ else{
+ data.assign(3,1);
+ }
+
+ delete simp;
+
+ return data;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "InvSimpson", "getValues");
+ exit(1);
+ }
+}
+
+/***********************************************************************/
--- /dev/null
+#ifndef INVSIMPSON
+#define INVSIMPSON
+
+/*
+ * invsimpson.h
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/20/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class InvSimpson : public Calculator {
+
+public:
+ InvSimpson() : Calculator("invsimpson", 3, false) {};
+ EstOutput getValues(SAbundVector*);
+ EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+};
+
+/***********************************************************************/
+
+#endif
in >> firstCol >> secondCol; gobble(in);
names[firstCol] = secondCol;
int size = 1;
- while (secondCol.find_first_of(',') != -1) {
- size++;
- secondCol = secondCol.substr(secondCol.find_first_of(',')+1, secondCol.length());
+
+ for(int i=0;i<secondCol.size();i++){
+ if(secondCol[i] == ','){ size++; }
}
sizes[firstCol] = size;
}
#include "chao1.h"
#include "bootstrap.h"
#include "simpson.h"
+#include "simpsoneven.h"
+#include "heip.h"
+#include "smithwilson.h"
+#include "invsimpson.h"
#include "npshannon.h"
+#include "shannoneven.h"
#include "shannon.h"
#include "jackknife.h"
#include "coverage.h"
}else if (Estimators[i] == "shannon") {
rDisplays.push_back(new RareDisplay(new Shannon(), new ThreeColumnFile(fileNameRoot+"r_shannon")));
outputNames.push_back(fileNameRoot+"r_shannon");
+ }else if (Estimators[i] == "shannoneven") {
+ rDisplays.push_back(new RareDisplay(new ShannonEven(), new ThreeColumnFile(fileNameRoot+"r_shannoneven")));
+ outputNames.push_back(fileNameRoot+"r_shannoneven");
+ }else if (Estimators[i] == "heip") {
+ rDisplays.push_back(new RareDisplay(new Heip(), new ThreeColumnFile(fileNameRoot+"r_heip")));
+ outputNames.push_back(fileNameRoot+"r_heip");
+ }else if (Estimators[i] == "smithwilson") {
+ rDisplays.push_back(new RareDisplay(new SmithWilson(), new ThreeColumnFile(fileNameRoot+"r_smithwilson")));
+ outputNames.push_back(fileNameRoot+"r_smithwilson");
}else if (Estimators[i] == "npshannon") {
rDisplays.push_back(new RareDisplay(new NPShannon(), new ThreeColumnFile(fileNameRoot+"r_npshannon")));
outputNames.push_back(fileNameRoot+"r_npshannon");
}else if (Estimators[i] == "simpson") {
rDisplays.push_back(new RareDisplay(new Simpson(), new ThreeColumnFile(fileNameRoot+"r_simpson")));
outputNames.push_back(fileNameRoot+"r_simpson");
+ }else if (Estimators[i] == "simpsoneven") {
+ rDisplays.push_back(new RareDisplay(new SimpsonEven(), new ThreeColumnFile(fileNameRoot+"r_simpsoneven")));
+ outputNames.push_back(fileNameRoot+"r_simpsoneven");
+ }else if (Estimators[i] == "invsimpson") {
+ rDisplays.push_back(new RareDisplay(new InvSimpson(), new ThreeColumnFile(fileNameRoot+"r_invsimpson")));
+ outputNames.push_back(fileNameRoot+"r_invsimpson");
}else if (Estimators[i] == "bootstrap") {
rDisplays.push_back(new RareDisplay(new Bootstrap(), new ThreeColumnFile(fileNameRoot+"r_bootstrap")));
outputNames.push_back(fileNameRoot+"r_bootstrap");
--- /dev/null
+/*
+ * shannoneven.cpp
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "shannoneven.h"
+#include "shannon.h"
+
+/***********************************************************************/
+
+EstOutput ShannonEven::getValues(SAbundVector* rank){
+ try {
+ //vector<double> simpsonData(3,0);
+ data.resize(1,0);
+ vector<double> shanData(3,0);
+ Shannon* shannon = new Shannon();
+ shanData = shannon->getValues(rank);
+
+ long int sobs = rank->getNumBins();
+ if(sobs > 1){
+ data[0] = shanData[0] / log(sobs);
+ }
+ else{
+ data[0] = 1;
+ }
+
+ delete shannon;
+ return data;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ShannonEven", "getValues");
+ exit(1);
+ }
+}
+
+/***********************************************************************/
--- /dev/null
+#ifndef SHANNONEVEN
+#define SHANNONEVEN
+
+/*
+ * shannoneven.h
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class ShannonEven : public Calculator {
+
+public:
+ ShannonEven() : Calculator("shannoneven", 1, false) {};
+ EstOutput getValues(SAbundVector*);
+ EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+};
+
+/***********************************************************************/
+
+#endif
--- /dev/null
+/*
+ * simpsoneven.cpp
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "simpsoneven.h"
+#include "invsimpson.h"
+
+/***********************************************************************/
+
+EstOutput SimpsonEven::getValues(SAbundVector* rank){
+ try {
+ data.resize(1,0);
+
+ InvSimpson* simp = new InvSimpson();
+ vector<double> invSimpData = simp->getValues(rank);
+
+ data[0] = invSimpData[0] / double(rank->getNumBins());
+
+
+ return data;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SimpsonEven", "getValues");
+ exit(1);
+ }
+}
+
+/***********************************************************************/
+
--- /dev/null
+#ifndef SIMPSONEVEN_H
+#define SIMPSONEVEN_H
+
+/*
+ * simpsoneven.h
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class SimpsonEven : public Calculator {
+
+public:
+ SimpsonEven() : Calculator("simpsoneven", 1, false) {};
+ EstOutput getValues(SAbundVector*);
+ EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+};
+
+/***********************************************************************/
+
+#endif
+
--- /dev/null
+/*
+ * smithwilson.cpp
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "smithwilson.h"
+
+/***********************************************************************/
+
+EstOutput SmithWilson::getValues(SAbundVector* rank){
+ try {
+
+ data.resize(1,0);
+
+ double maxRank = rank->getMaxRank();
+ double sobs = rank->getNumBins();
+
+ double innerSum = 0;
+ for(int i=1;i<=maxRank;i++){
+ innerSum += rank->get(i) * log(i);
+ }
+ innerSum /= sobs;
+
+ double outerSum = 0;
+ for(int i=1;i<=maxRank;i++){
+ outerSum += rank->get(i) * (log(i) - innerSum) * (log(i) - innerSum);
+ }
+ outerSum /= sobs;
+
+ if(outerSum > 0){
+ data[0] = 1.0000 - 2.0000 / (3.14159 * atan(outerSum));
+ }
+ else{
+ data[0] = 1.0000;
+ }
+
+
+ return data;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "InvSimpson", "getValues");
+ exit(1);
+ }
+}
+
+/***********************************************************************/
--- /dev/null
+#ifndef SMITHWILSON
+#define SMITHWILSON
+
+/*
+ * smithwilson.h
+ * Mothur
+ *
+ * Created by Pat Schloss on 8/21/10.
+ * Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class SmithWilson : public Calculator {
+
+public:
+ SmithWilson() : Calculator("smithwilson", 1, false) {};
+ EstOutput getValues(SAbundVector*);
+ EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
+};
+
+/***********************************************************************/
+
+#endif
#include "chao1.h"
#include "bootstrap.h"
#include "simpson.h"
+#include "simpsoneven.h"
+#include "invsimpson.h"
#include "npshannon.h"
#include "shannon.h"
+#include "heip.h"
+#include "smithwilson.h"
+#include "shannoneven.h"
#include "jackknife.h"
#include "geom.h"
#include "logsd.h"
sumCalculators.push_back(new Jackknife());
}else if(Estimators[i] == "shannon"){
sumCalculators.push_back(new Shannon());
+ }else if(Estimators[i] == "shannoneven"){
+ sumCalculators.push_back(new ShannonEven());
}else if(Estimators[i] == "npshannon"){
sumCalculators.push_back(new NPShannon());
+ }else if(Estimators[i] == "heip"){
+ sumCalculators.push_back(new Heip());
+ }else if(Estimators[i] == "smithwilson"){
+ sumCalculators.push_back(new SmithWilson());
}else if(Estimators[i] == "simpson"){
sumCalculators.push_back(new Simpson());
+ }else if(Estimators[i] == "simpsoneven"){
+ sumCalculators.push_back(new SimpsonEven());
+ }else if(Estimators[i] == "invsimpson"){
+ sumCalculators.push_back(new InvSimpson());
}else if(Estimators[i] == "bootstrap"){
sumCalculators.push_back(new Bootstrap());
}else if (Estimators[i] == "nseqs") {
single["jack"] = "jack";
single["shannon"] = "shannon";
single["npshannon"] = "npshannon";
+ single["shannoneven"] = "shannoneven";
+ single["smithwilson"] = "smithwilson";
+ single["heip"] = "heip";
single["simpson"] = "simpson";
+ single["simpsoneven"] = "simpsoneven";
+ single["invsimpson"] = "invsimpson";
single["bergerparker"] = "bergerparker";
single["bootstrap"] = "bootstrap";
single["geometric"] = "geometric";
- single["logseries"] = "logseries";
+ single["logseries"] = "logseries";
single["qstat"] = "qstat";
single["bstick"] = "bstick";
single["goodscoverage"] = "goodscoverage";
rarefaction["ace"] = "ace";
rarefaction["jack"] = "jack";
rarefaction["shannon"] = "shannon";
+ rarefaction["smithwilson"] = "smithwilson";
+ rarefaction["heip"] = "heip";
rarefaction["npshannon"] = "npshannon";
+ rarefaction["shannoneven"] = "shannoneven";
rarefaction["simpson"] = "simpson";
+ rarefaction["invsimpson"] = "invsimpson";
+ rarefaction["simpsoneven"] = "simpsoneven";
rarefaction["bootstrap"] = "bootstrap";
rarefaction["nseqs"] = "nseqs";
rarefaction["coverage"] = "coverage";
summary["ace"] = "ace";
summary["jack"] = "jack";
summary["shannon"] = "shannon";
+ summary["heip"] = "heip";
+ summary["shannoneven"] = "shannoneven";
+ summary["smithwilson"] = "smithwilson";
+ summary["invsimpson"] = "invsimpson";
summary["npshannon"] = "npshannon";
summary["simpson"] = "simpson";
+ summary["simpsoneven"] = "simpsoneven";
summary["bergerparker"] = "bergerparker";
summary["geometric"] = "geometric";
summary["bootstrap"] = "bootstrap";