374CD63F0F65832000D90B4A /* libshuffcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 374CD63E0F65832000D90B4A /* libshuffcommand.cpp */; };
374CD6F10F65A4C100D90B4A /* coverage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 374CD6F00F65A4C100D90B4A /* coverage.cpp */; };
3765B47A0F77D15900C3EDC5 /* nocommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3765B4780F77D15900C3EDC5 /* nocommands.cpp */; };
+ 3765B4E20F78055000C3EDC5 /* sharedochiai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3765B4E10F78055000C3EDC5 /* sharedochiai.cpp */; };
+ 3765B5160F780A7F00C3EDC5 /* sharedanderberg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3765B5150F780A7F00C3EDC5 /* sharedanderberg.cpp */; };
3782163D0F616079008E1F6D /* fullmatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3782163C0F616079008E1F6D /* fullmatrix.cpp */; };
379293C30F2DE73400B9034A /* treemap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379293C20F2DE73400B9034A /* treemap.cpp */; };
379294700F2E191800B9034A /* parsimonycommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3792946F0F2E191800B9034A /* parsimonycommand.cpp */; };
374CD6F00F65A4C100D90B4A /* coverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coverage.cpp; sourceTree = "<group>"; };
3765B4780F77D15900C3EDC5 /* nocommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nocommands.cpp; sourceTree = "<group>"; };
3765B4790F77D15900C3EDC5 /* nocommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nocommands.h; sourceTree = "<group>"; };
+ 3765B4E00F78055000C3EDC5 /* sharedochiai.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedochiai.h; sourceTree = "<group>"; };
+ 3765B4E10F78055000C3EDC5 /* sharedochiai.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedochiai.cpp; sourceTree = "<group>"; };
+ 3765B5140F780A7F00C3EDC5 /* sharedanderberg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderberg.h; sourceTree = "<group>"; };
+ 3765B5150F780A7F00C3EDC5 /* sharedanderberg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedanderberg.cpp; sourceTree = "<group>"; };
3782163B0F616079008E1F6D /* fullmatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fullmatrix.h; sourceTree = "<group>"; };
3782163C0F616079008E1F6D /* fullmatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fullmatrix.cpp; sourceTree = "<group>"; };
379293C10F2DE73400B9034A /* treemap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treemap.h; sourceTree = "<group>"; };
37D9281E0F21331F001D4494 /* shannon.cpp */,
37D928230F21331F001D4494 /* sharedace.h */,
37D928220F21331F001D4494 /* sharedace.cpp */,
+ 3765B5140F780A7F00C3EDC5 /* sharedanderberg.h */,
+ 3765B5150F780A7F00C3EDC5 /* sharedanderberg.cpp */,
37D928250F21331F001D4494 /* sharedchao1.h */,
37D928240F21331F001D4494 /* sharedchao1.cpp */,
37D928290F21331F001D4494 /* sharedjabund.h */,
37D9282D0F21331F001D4494 /* sharedjest.h */,
37D9282C0F21331F001D4494 /* sharedjest.cpp */,
3709370A0F6E7FC100EB4C2C /* sharednseqs.h */,
+ 3765B4E00F78055000C3EDC5 /* sharedochiai.h */,
+ 3765B4E10F78055000C3EDC5 /* sharedochiai.cpp */,
37D928350F21331F001D4494 /* sharedsobs.h */,
37D928340F21331F001D4494 /* sharedsobs.cpp */,
37AFC71D0F445386005F492D /* sharedsobscollectsummary.h */,
374CD63F0F65832000D90B4A /* libshuffcommand.cpp in Sources */,
374CD6F10F65A4C100D90B4A /* coverage.cpp in Sources */,
3765B47A0F77D15900C3EDC5 /* nocommands.cpp in Sources */,
+ 3765B4E20F78055000C3EDC5 /* sharedochiai.cpp in Sources */,
+ 3765B5160F780A7F00C3EDC5 /* sharedanderberg.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "sharedthetayc.h"
#include "sharedthetan.h"
#include "sharednseqs.h"
+#include "sharedochiai.h"
+#include "sharedanderberg.h"
//**********************************************************************************************************************
cDisplays.push_back(new CollectDisplay(new SharedThetaN(), new SharedOneColumnFile(fileNameRoot+"shared.thetan")));
}else if (globaldata->Estimators[i] == "sharednseqs") {
cDisplays.push_back(new CollectDisplay(new SharedNSeqs(), new SharedOneColumnFile(fileNameRoot+"shared.nseqs")));
+ }else if (globaldata->Estimators[i] == "sharedochiai") {
+ cDisplays.push_back(new CollectDisplay(new SharedOchiai(), new SharedOneColumnFile(fileNameRoot+"shared.ochiai")));
+ }else if (globaldata->Estimators[i] == "sharedanderberg") {
+ cDisplays.push_back(new CollectDisplay(new SharedAnderberg(), new SharedOneColumnFile(fileNameRoot+"shared.anderberg")));
}
}
data[l][k].push_back(0.0);
}
}
-
- /**************************************/
- //get the minimums for each comparision
- /**************************************/
+
int count = 0;
int count2 = 0;
matrix->restore();
}
}
-
count2++;
}
count += numGroups+1; //go from AA to BB to CC
--- /dev/null
+/*
+ * sharedanderberg.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 3/23/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "sharedanderberg.h"
+
+/***********************************************************************/
+
+EstOutput SharedAnderberg::getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2) {
+ try {
+ int S1, S2, S12, tempA, tempB;
+ S1 = 0; S2 = 0; S12 = 0; tempA = 0; tempB = 0;
+
+ /*S1, S2 = number of OTUs observed or estimated in A and B
+ S12=number of OTUs shared between A and B */
+
+ data.resize(1,0);
+
+ for (int i = 0; i < shared1->size(); i++) {
+ //store in temps to avoid multiple repetitive function calls
+ tempA = shared1->getAbundance(i);
+ tempB = shared2->getAbundance(i);
+
+ if (tempA != 0) { S1++; }
+ if (tempB != 0) { S2++; }
+
+ //they are shared
+ if ((tempA != 0) && (tempB != 0)) { S12++; }
+ }
+
+ data[0] = S12 / ((float)((2 * S1) + (2 * S2) - (3 * S12)));
+
+ if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+
+ return data;
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the SharedAnderberg class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the SharedAnderberg class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+/***********************************************************************/
--- /dev/null
+#ifndef SHAREDANDERBERG_H
+#define SHAREDANDERBERG_H
+/*
+ * sharedanderberg.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 3/23/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class SharedAnderberg : public Calculator {
+
+public:
+ SharedAnderberg() : Calculator("SharedAnderberg", 1) {};
+ EstOutput getValues(SAbundVector*) {return data;};
+ EstOutput getValues(SharedRAbundVector*, SharedRAbundVector*);
+private:
+
+};
+
+/***********************************************************************/
+
+
+
+#endif
\ No newline at end of file
--- /dev/null
+/*
+ * sharedochiai.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 3/23/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "sharedochiai.h"
+
+/***********************************************************************/
+
+EstOutput SharedOchiai::getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2) {
+ try {
+ int S1, S2, S12, tempA, tempB;
+ S1 = 0; S2 = 0; S12 = 0; tempA = 0; tempB = 0;
+
+ /*S1, S2 = number of OTUs observed or estimated in A and B
+ S12=number of OTUs shared between A and B */
+
+ data.resize(1,0);
+
+ for (int i = 0; i < shared1->size(); i++) {
+ //store in temps to avoid multiple repetitive function calls
+ tempA = shared1->getAbundance(i);
+ tempB = shared2->getAbundance(i);
+
+ if (tempA != 0) { S1++; }
+ if (tempB != 0) { S2++; }
+
+ //they are shared
+ if ((tempA != 0) && (tempB != 0)) { S12++; }
+ }
+
+ data[0] = S12 / ((float)pow((S1 * S2), 0.5));
+
+ if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+
+ return data;
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the SharedOchiai class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the SharedOchiai class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+/***********************************************************************/
--- /dev/null
+#ifndef SHAREDOCHIAI_H
+#define SHAREDOCHIAI_H
+/*
+ * sharedochiai.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 3/23/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class SharedOchiai : public Calculator {
+
+public:
+ SharedOchiai() : Calculator("SharedOchiai", 1) {};
+ EstOutput getValues(SAbundVector*) {return data;};
+ EstOutput getValues(SharedRAbundVector*, SharedRAbundVector*);
+private:
+
+};
+
+/***********************************************************************/
+
+
+#endif
\ No newline at end of file
#include "sharedsorest.h"
#include "sharedthetayc.h"
#include "sharedthetan.h"
+#include "sharedochiai.h"
+#include "sharedanderberg.h"
//**********************************************************************************************************************
sumCalculators.push_back(new SharedThetaN());
}else if (globaldata->Estimators[i] == "sharednseqs") {
sumCalculators.push_back(new SharedNSeqs());
+ }else if (globaldata->Estimators[i] == "sharedochiai") {
+ sumCalculators.push_back(new SharedOchiai());
+ }else if (globaldata->Estimators[i] == "sharedanderberg") {
+ sumCalculators.push_back(new SharedAnderberg());
}
+
+
}
}
shared["sharedthetayc"] = "sharedthetayc";
shared["sharedthetan"] = "sharedthetan";
shared["sharednseqs"] = "sharednseqs";
+ shared["sharedochiai"] = "sharedochiai";
+ shared["sharedanderberg"] = "sharedanderberg";
shared["default"] = "default";
}
catch(exception& e) {
sharedsummary["sharedthetayc"] = "sharedthetayc";
sharedsummary["sharedthetan"] = "sharedthetan";
sharedsummary["sharednseqs"] = "sharednseqs";
+ sharedsummary["sharedochiai"] = "sharedochiai";
+ sharedsummary["sharedanderberg"] = "sharedanderberg";
sharedsummary["default"] = "default";
}
catch(exception& e) {