]> git.donarmstrong.com Git - mothur.git/commitdiff
added odum, canberra, structchi2, structchord, structeuclidean, gower, hellinger...
authorwestcott <westcott>
Fri, 17 Dec 2010 16:46:03 +0000 (16:46 +0000)
committerwestcott <westcott>
Fri, 17 Dec 2010 16:46:03 +0000 (16:46 +0000)
35 files changed:
Mothur.xcodeproj/project.pbxproj
collectsharedcommand.cpp
gower.cpp [new file with mode: 0644]
gower.h [new file with mode: 0644]
memchi2.cpp [new file with mode: 0644]
memchi2.h [new file with mode: 0644]
memchord.cpp [new file with mode: 0644]
memchord.h [new file with mode: 0644]
memeuclidean.cpp [new file with mode: 0644]
memeuclidean.h [new file with mode: 0644]
mempearson.cpp [new file with mode: 0644]
mempearson.h [new file with mode: 0644]
mothur
strictchi2.cpp [deleted file]
strictchi2.h [deleted file]
strictchord.cpp [deleted file]
strictchord.h [deleted file]
stricteuclidean.cpp [deleted file]
stricteuclidean.h [deleted file]
strictkulczynski.cpp [deleted file]
strictkulczynski.h [deleted file]
strictpearson.cpp [deleted file]
strictpearson.h [deleted file]
structchi2.cpp [new file with mode: 0644]
structchi2.h [new file with mode: 0644]
structchord.cpp [new file with mode: 0644]
structchord.h [new file with mode: 0644]
structeuclidean.cpp [new file with mode: 0644]
structeuclidean.h [new file with mode: 0644]
structkulczynski.cpp [new file with mode: 0644]
structkulczynski.h [new file with mode: 0644]
structpearson.cpp [new file with mode: 0644]
structpearson.h [new file with mode: 0644]
summarysharedcommand.cpp
validcalculator.cpp

index c1ab7985173339083b027b13df94194ac6fbd01e..560250413db85ada5d25ef760a16144c8ab77542 100644 (file)
                A732505F11E49EF100484B90 /* sffinfocommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sffinfocommand.cpp; sourceTree = "<group>"; };
                A73953DA11987ED100B0B160 /* chopseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chopseqscommand.h; sourceTree = "<group>"; };
                A73953DB11987ED100B0B160 /* chopseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chopseqscommand.cpp; sourceTree = "<group>"; };
-               A7460A3F12B8EF1C00866BB6 /* strictchord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strictchord.h; sourceTree = "<group>"; };
-               A7460A4012B8EF1C00866BB6 /* strictchord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strictchord.cpp; sourceTree = "<group>"; };
+               A7460A3F12B8EF1C00866BB6 /* structchord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structchord.h; sourceTree = "<group>"; };
+               A7460A4012B8EF1C00866BB6 /* structchord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = structchord.cpp; sourceTree = "<group>"; };
                A7460A7312B8FCDC00866BB6 /* hellinger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hellinger.h; sourceTree = "<group>"; };
                A7460A7412B8FCDC00866BB6 /* hellinger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hellinger.cpp; sourceTree = "<group>"; };
                A7460A9812B9061B00866BB6 /* manhattan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = manhattan.h; sourceTree = "<group>"; };
                A7460A9912B9061B00866BB6 /* manhattan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = manhattan.cpp; sourceTree = "<group>"; };
-               A7460AC912B90C5600866BB6 /* strictpearson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strictpearson.h; sourceTree = "<group>"; };
-               A7460ACA12B90C5600866BB6 /* strictpearson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strictpearson.cpp; sourceTree = "<group>"; };
+               A7460AC912B90C5600866BB6 /* structpearson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structpearson.h; sourceTree = "<group>"; };
+               A7460ACA12B90C5600866BB6 /* structpearson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = structpearson.cpp; sourceTree = "<group>"; };
                A7460ADB12B914B700866BB6 /* soergel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soergel.h; sourceTree = "<group>"; };
                A7460ADC12B914B700866BB6 /* soergel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = soergel.cpp; sourceTree = "<group>"; };
                A7460AF712B9218400866BB6 /* spearman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spearman.h; sourceTree = "<group>"; };
                A7460AF812B9218400866BB6 /* spearman.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spearman.cpp; sourceTree = "<group>"; };
-               A7460B3612B9377400866BB6 /* strictkulczynski.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strictkulczynski.h; sourceTree = "<group>"; };
-               A7460B3712B9377400866BB6 /* strictkulczynski.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strictkulczynski.cpp; sourceTree = "<group>"; };
+               A7460B3612B9377400866BB6 /* structkulczynski.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structkulczynski.h; sourceTree = "<group>"; };
+               A7460B3712B9377400866BB6 /* structkulczynski.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = structkulczynski.cpp; sourceTree = "<group>"; };
                A7460B5912B93F1F00866BB6 /* speciesprofile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = speciesprofile.h; sourceTree = "<group>"; };
                A7460B5A12B93F1F00866BB6 /* speciesprofile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = speciesprofile.cpp; sourceTree = "<group>"; };
                A7460B7812B9444800866BB6 /* hamming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hamming.h; sourceTree = "<group>"; };
                A798626E1240D91B005FC847 /* normalizesharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = normalizesharedcommand.cpp; sourceTree = "<group>"; };
                A7AE6302121C3408001DE6FC /* sharedrabundfloatvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedrabundfloatvector.h; sourceTree = "<group>"; };
                A7AE6303121C3408001DE6FC /* sharedrabundfloatvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedrabundfloatvector.cpp; sourceTree = "<group>"; };
-               A7BB555212BB87F30041F26F /* strictchi2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strictchi2.h; sourceTree = "<group>"; };
-               A7BB555312BB87F30041F26F /* strictchi2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strictchi2.cpp; sourceTree = "<group>"; };
+               A7BB555212BB87F30041F26F /* structchi2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structchi2.h; sourceTree = "<group>"; };
+               A7BB555312BB87F30041F26F /* structchi2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = structchi2.cpp; sourceTree = "<group>"; };
+               A7BB565F12BBB0480041F26F /* gower.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gower.h; sourceTree = "<group>"; };
+               A7BB566012BBB0480041F26F /* gower.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gower.cpp; sourceTree = "<group>"; };
+               A7BB56B812BBB5690041F26F /* memchi2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memchi2.h; sourceTree = "<group>"; };
+               A7BB56B912BBB5690041F26F /* memchi2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memchi2.cpp; sourceTree = "<group>"; };
+               A7BB56EB12BBBFDF0041F26F /* memchord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memchord.h; sourceTree = "<group>"; };
+               A7BB56EC12BBBFDF0041F26F /* memchord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memchord.cpp; sourceTree = "<group>"; };
+               A7BB570B12BBC2880041F26F /* memeuclidean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memeuclidean.h; sourceTree = "<group>"; };
+               A7BB570C12BBC2880041F26F /* memeuclidean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memeuclidean.cpp; sourceTree = "<group>"; };
+               A7BB573712BBC43B0041F26F /* mempearson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mempearson.h; sourceTree = "<group>"; };
+               A7BB573812BBC43B0041F26F /* mempearson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mempearson.cpp; sourceTree = "<group>"; };
                A7BBDA7B11B5694E006E6551 /* classifyotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = classifyotucommand.h; sourceTree = "<group>"; };
                A7BBDA7C11B5694E006E6551 /* classifyotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = classifyotucommand.cpp; sourceTree = "<group>"; };
                A7D215C811996C6E00F13F13 /* clearcutcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clearcutcommand.h; sourceTree = "<group>"; };
                A7F0C06512B7D64F0048BC64 /* odum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = odum.cpp; sourceTree = "<group>"; };
                A7F0C08A12B7EAE80048BC64 /* canberra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = canberra.h; sourceTree = "<group>"; };
                A7F0C08B12B7EAE80048BC64 /* canberra.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = canberra.cpp; sourceTree = "<group>"; };
-               A7F0C10112B80EEC0048BC64 /* stricteuclidean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stricteuclidean.h; sourceTree = "<group>"; };
-               A7F0C10212B80EEC0048BC64 /* stricteuclidean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stricteuclidean.cpp; sourceTree = "<group>"; };
+               A7F0C10112B80EEC0048BC64 /* structeuclidean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structeuclidean.h; sourceTree = "<group>"; };
+               A7F0C10212B80EEC0048BC64 /* structeuclidean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = structeuclidean.cpp; sourceTree = "<group>"; };
                A7F139481247C3CB0033324C /* splitgroupscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = splitgroupscommand.h; sourceTree = "<group>"; };
                A7F139491247C3CB0033324C /* splitgroupscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = splitgroupscommand.cpp; sourceTree = "<group>"; };
                A7F6C8E1124229F900299875 /* fisher2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fisher2.c; sourceTree = "<group>"; };
                                A7DA2059113FECD400BF472F /* geom.h */,
                                A7DA206C113FECD400BF472F /* goodscoverage.cpp */,
                                A7DA206D113FECD400BF472F /* goodscoverage.h */,
+                               A7BB565F12BBB0480041F26F /* gower.h */,
+                               A7BB566012BBB0480041F26F /* gower.cpp */,
                                A7460B7812B9444800866BB6 /* hamming.h */,
                                A7460B7912B9444800866BB6 /* hamming.cpp */,
                                7E5B2917121FF53C0005339C /* heip.h */,
                                A7DA2094113FECD400BF472F /* logsd.h */,
                                A7460A9812B9061B00866BB6 /* manhattan.h */,
                                A7460A9912B9061B00866BB6 /* manhattan.cpp */,
+                               A7BB56B812BBB5690041F26F /* memchi2.h */,
+                               A7BB56B912BBB5690041F26F /* memchi2.cpp */,
+                               A7BB56EB12BBBFDF0041F26F /* memchord.h */,
+                               A7BB56EC12BBBFDF0041F26F /* memchord.cpp */,
+                               A7BB570B12BBC2880041F26F /* memeuclidean.h */,
+                               A7BB570C12BBC2880041F26F /* memeuclidean.cpp */,
+                               A7BB573712BBC43B0041F26F /* mempearson.h */,
+                               A7BB573812BBC43B0041F26F /* mempearson.cpp */,
                                A7DA20AE113FECD400BF472F /* npshannon.cpp */,
                                A7DA20AF113FECD400BF472F /* npshannon.h */,
                                A7DA20B0113FECD400BF472F /* nseqs.h */,
                                A7460B5A12B93F1F00866BB6 /* speciesprofile.cpp */,
                                A7460AF712B9218400866BB6 /* spearman.h */,
                                A7460AF812B9218400866BB6 /* spearman.cpp */,
-                               A7BB555212BB87F30041F26F /* strictchi2.h */,
-                               A7BB555312BB87F30041F26F /* strictchi2.cpp */,
-                               A7460A3F12B8EF1C00866BB6 /* strictchord.h */,
-                               A7460A4012B8EF1C00866BB6 /* strictchord.cpp */,
-                               A7F0C10112B80EEC0048BC64 /* stricteuclidean.h */,
-                               A7F0C10212B80EEC0048BC64 /* stricteuclidean.cpp */,
-                               A7460B3612B9377400866BB6 /* strictkulczynski.h */,
-                               A7460B3712B9377400866BB6 /* strictkulczynski.cpp */,
-                               A7460AC912B90C5600866BB6 /* strictpearson.h */,
-                               A7460ACA12B90C5600866BB6 /* strictpearson.cpp */,
+                               A7BB555212BB87F30041F26F /* structchi2.h */,
+                               A7BB555312BB87F30041F26F /* structchi2.cpp */,
+                               A7460A3F12B8EF1C00866BB6 /* structchord.h */,
+                               A7460A4012B8EF1C00866BB6 /* structchord.cpp */,
+                               A7F0C10112B80EEC0048BC64 /* structeuclidean.h */,
+                               A7F0C10212B80EEC0048BC64 /* structeuclidean.cpp */,
+                               A7460B3612B9377400866BB6 /* structkulczynski.h */,
+                               A7460B3712B9377400866BB6 /* structkulczynski.cpp */,
+                               A7460AC912B90C5600866BB6 /* structpearson.h */,
+                               A7460ACA12B90C5600866BB6 /* structpearson.cpp */,
                                A7DA2160113FECD400BF472F /* treecalculator.h */,
                                A7DA216D113FECD400BF472F /* unweighted.cpp */,
                                A7DA216E113FECD400BF472F /* unweighted.h */,
index f31254828f421629270029c416428858293bfd59..7ab15df6db6eb276c9ab2e8696d3de56dd4a6c85 100644 (file)
 #include "whittaker.h"
 #include "odum.h"
 #include "canberra.h"
-#include "stricteuclidean.h"
-#include "strictchord.h"
+#include "structeuclidean.h"
+#include "structchord.h"
 #include "hellinger.h"
 #include "manhattan.h"
-#include "strictpearson.h"
+#include "structpearson.h"
 #include "soergel.h"
 #include "spearman.h"
-#include "strictkulczynski.h"
+#include "structkulczynski.h"
+#include "structchi2.h"
 #include "speciesprofile.h"
 #include "hamming.h"
+#include "gower.h"
+#include "memchi2.h"
+#include "memchord.h"
+#include "memeuclidean.h"
+#include "mempearson.h"
 
 //**********************************************************************************************************************
 vector<string> CollectSharedCommand::getValidParameters(){     
@@ -108,16 +114,22 @@ CollectSharedCommand::CollectSharedCommand(){
                outputTypes["braycurtis"] = tempOutNames;
                outputTypes["odum"] = tempOutNames;
                outputTypes["canberra"] = tempOutNames;
-               outputTypes["stricteuclidean"] = tempOutNames;
-               outputTypes["strictchord"] = tempOutNames;
+               outputTypes["structeuclidean"] = tempOutNames;
+               outputTypes["structchord"] = tempOutNames;
                outputTypes["hellinger"] = tempOutNames;
                outputTypes["manhattan"] = tempOutNames;
-               outputTypes["strictpearson"] = tempOutNames;
+               outputTypes["structpearson"] = tempOutNames;
                outputTypes["soergel"] = tempOutNames;
                outputTypes["spearman"] = tempOutNames;
-               outputTypes["strictkulczynski"] = tempOutNames;
+               outputTypes["structkulczynski"] = tempOutNames;
+               outputTypes["structchi2"] = tempOutNames;
                outputTypes["speciesprofile"] = tempOutNames;
                outputTypes["hamming"] = tempOutNames;
+               outputTypes["gower"] = tempOutNames;
+               outputTypes["memchi2"] = tempOutNames;
+               outputTypes["memchord"] = tempOutNames;
+               outputTypes["memeuclidean"] = tempOutNames;
+               outputTypes["mempearson"] = tempOutNames;
                
        }
        catch(exception& e) {
@@ -178,17 +190,22 @@ CollectSharedCommand::CollectSharedCommand(string option)  {
                        outputTypes["braycurtis"] = tempOutNames;
                        outputTypes["odum"] = tempOutNames;
                        outputTypes["canberra"] = tempOutNames;
-                       outputTypes["stricteuclidean"] = tempOutNames;
-                       outputTypes["strictchord"] = tempOutNames;
+                       outputTypes["structeuclidean"] = tempOutNames;
+                       outputTypes["structchord"] = tempOutNames;
                        outputTypes["hellinger"] = tempOutNames;
                        outputTypes["manhattan"] = tempOutNames;
-                       outputTypes["strictpearson"] = tempOutNames;
+                       outputTypes["structpearson"] = tempOutNames;
                        outputTypes["soergel"] = tempOutNames;
                        outputTypes["spearman"] = tempOutNames;
-                       outputTypes["strictkulczynski"] = tempOutNames;
+                       outputTypes["structkulczynski"] = tempOutNames;
                        outputTypes["speciesprofile"] = tempOutNames;
+                       outputTypes["structchi2"] = tempOutNames;
                        outputTypes["hamming"] = tempOutNames;
-
+                       outputTypes["gower"] = tempOutNames;
+                       outputTypes["memchi2"] = tempOutNames;
+                       outputTypes["memchord"] = tempOutNames;
+                       outputTypes["memeuclidean"] = tempOutNames;
+                       outputTypes["mempearson"] = tempOutNames;
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = "";         }
@@ -318,36 +335,54 @@ CollectSharedCommand::CollectSharedCommand(string option)  {
                                                }else if (Estimators[i] == "canberra") { 
                                                        cDisplays.push_back(new CollectDisplay(new Canberra(), new SharedOneColumnFile(fileNameRoot+"canberra")));
                                                        outputNames.push_back(fileNameRoot+"canberra"); outputTypes["canberra"].push_back(fileNameRoot+"canberra");
-                                               }else if (Estimators[i] == "stricteuclidean") { 
-                                                       cDisplays.push_back(new CollectDisplay(new StrictEuclidean(), new SharedOneColumnFile(fileNameRoot+"stricteuclidean")));
-                                                       outputNames.push_back(fileNameRoot+"stricteuclidean"); outputTypes["stricteuclidean"].push_back(fileNameRoot+"stricteuclidean");
-                                               }else if (Estimators[i] == "strictchord") { 
-                                                       cDisplays.push_back(new CollectDisplay(new StrictChord(), new SharedOneColumnFile(fileNameRoot+"strictchord")));
-                                                       outputNames.push_back(fileNameRoot+"strictchord"); outputTypes["strictchord"].push_back(fileNameRoot+"strictchord");
+                                               }else if (Estimators[i] == "structeuclidean") { 
+                                                       cDisplays.push_back(new CollectDisplay(new StructEuclidean(), new SharedOneColumnFile(fileNameRoot+"structeuclidean")));
+                                                       outputNames.push_back(fileNameRoot+"structeuclidean"); outputTypes["structeuclidean"].push_back(fileNameRoot+"structeuclidean");
+                                               }else if (Estimators[i] == "structchord") { 
+                                                       cDisplays.push_back(new CollectDisplay(new StructChord(), new SharedOneColumnFile(fileNameRoot+"structchord")));
+                                                       outputNames.push_back(fileNameRoot+"structchord"); outputTypes["structchord"].push_back(fileNameRoot+"structchord");
                                                }else if (Estimators[i] == "hellinger") { 
                                                        cDisplays.push_back(new CollectDisplay(new Hellinger(), new SharedOneColumnFile(fileNameRoot+"hellinger")));
                                                        outputNames.push_back(fileNameRoot+"hellinger"); outputTypes["hellinger"].push_back(fileNameRoot+"hellinger");
                                                }else if (Estimators[i] == "manhattan") { 
                                                        cDisplays.push_back(new CollectDisplay(new Manhattan(), new SharedOneColumnFile(fileNameRoot+"manhattan")));
                                                        outputNames.push_back(fileNameRoot+"manhattan"); outputTypes["manhattan"].push_back(fileNameRoot+"manhattan");
-                                               }else if (Estimators[i] == "strictpearson") { 
-                                                       cDisplays.push_back(new CollectDisplay(new StrictPearson(), new SharedOneColumnFile(fileNameRoot+"strictpearson")));
-                                                       outputNames.push_back(fileNameRoot+"strictpearson"); outputTypes["strictpearson"].push_back(fileNameRoot+"strictpearson");
+                                               }else if (Estimators[i] == "structpearson") { 
+                                                       cDisplays.push_back(new CollectDisplay(new StructPearson(), new SharedOneColumnFile(fileNameRoot+"structpearson")));
+                                                       outputNames.push_back(fileNameRoot+"structpearson"); outputTypes["structpearson"].push_back(fileNameRoot+"structpearson");
                                                }else if (Estimators[i] == "soergel") { 
                                                        cDisplays.push_back(new CollectDisplay(new Soergel(), new SharedOneColumnFile(fileNameRoot+"soergel")));
                                                        outputNames.push_back(fileNameRoot+"soergel"); outputTypes["soergel"].push_back(fileNameRoot+"soergel");
                                                }else if (Estimators[i] == "spearman") { 
                                                        cDisplays.push_back(new CollectDisplay(new Spearman(), new SharedOneColumnFile(fileNameRoot+"spearman")));
                                                        outputNames.push_back(fileNameRoot+"spearman"); outputTypes["spearman"].push_back(fileNameRoot+"spearman");
-                                               }else if (Estimators[i] == "strictkulczynski") { 
-                                                       cDisplays.push_back(new CollectDisplay(new StrictKulczynski(), new SharedOneColumnFile(fileNameRoot+"strictkulczynski")));
-                                                       outputNames.push_back(fileNameRoot+"strictkulczynski"); outputTypes["strictkulczynski"].push_back(fileNameRoot+"strictkulczynski");
+                                               }else if (Estimators[i] == "structkulczynski") { 
+                                                       cDisplays.push_back(new CollectDisplay(new StructKulczynski(), new SharedOneColumnFile(fileNameRoot+"structkulczynski")));
+                                                       outputNames.push_back(fileNameRoot+"structkulczynski"); outputTypes["structkulczynski"].push_back(fileNameRoot+"structkulczynski");
                                                }else if (Estimators[i] == "speciesprofile") { 
                                                        cDisplays.push_back(new CollectDisplay(new SpeciesProfile(), new SharedOneColumnFile(fileNameRoot+"speciesprofile")));
                                                        outputNames.push_back(fileNameRoot+"speciesprofile"); outputTypes["speciesprofile"].push_back(fileNameRoot+"speciesprofile");
                                                }else if (Estimators[i] == "hamming") { 
                                                        cDisplays.push_back(new CollectDisplay(new Hamming(), new SharedOneColumnFile(fileNameRoot+"hamming")));
                                                        outputNames.push_back(fileNameRoot+"hamming"); outputTypes["hamming"].push_back(fileNameRoot+"hamming");
+                                               }else if (Estimators[i] == "structchi2") { 
+                                                       cDisplays.push_back(new CollectDisplay(new StructChi2(), new SharedOneColumnFile(fileNameRoot+"structchi2")));
+                                                       outputNames.push_back(fileNameRoot+"structchi2"); outputTypes["structchi2"].push_back(fileNameRoot+"structchi2");
+                                               }else if (Estimators[i] == "gower") { 
+                                                       cDisplays.push_back(new CollectDisplay(new Gower(), new SharedOneColumnFile(fileNameRoot+"gower")));
+                                                       outputNames.push_back(fileNameRoot+"gower"); outputTypes["gower"].push_back(fileNameRoot+"gower");
+                                               }else if (Estimators[i] == "memchi2") { 
+                                                       cDisplays.push_back(new CollectDisplay(new MemChi2(), new SharedOneColumnFile(fileNameRoot+"memchi2")));
+                                                       outputNames.push_back(fileNameRoot+"memchi2"); outputTypes["memchi2"].push_back(fileNameRoot+"memchi2");
+                                               }else if (Estimators[i] == "memchord") { 
+                                                       cDisplays.push_back(new CollectDisplay(new MemChord(), new SharedOneColumnFile(fileNameRoot+"memchord")));
+                                                       outputNames.push_back(fileNameRoot+"memchord"); outputTypes["memchord"].push_back(fileNameRoot+"memchord");
+                                               }else if (Estimators[i] == "memeuclidean") { 
+                                                       cDisplays.push_back(new CollectDisplay(new MemEuclidean(), new SharedOneColumnFile(fileNameRoot+"memeuclidean")));
+                                                       outputNames.push_back(fileNameRoot+"memeuclidean"); outputTypes["memeuclidean"].push_back(fileNameRoot+"memeuclidean");
+                                               }else if (Estimators[i] == "mempearson") { 
+                                                       cDisplays.push_back(new CollectDisplay(new MemPearson(), new SharedOneColumnFile(fileNameRoot+"mempearson")));
+                                                       outputNames.push_back(fileNameRoot+"mempearson"); outputTypes["mempearson"].push_back(fileNameRoot+"mempearson");
                                                }
                                                
                                        }
diff --git a/gower.cpp b/gower.cpp
new file mode 100644 (file)
index 0000000..5f0bf68
--- /dev/null
+++ b/gower.cpp
@@ -0,0 +1,56 @@
+/*
+ *  gower.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "gower.h"
+
+/***********************************************************************/
+EstOutput Gower::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               vector<int> maxOtus; maxOtus.resize(shared[0]->getNumBins());
+               vector<int> minOtus; minOtus.resize(shared[0]->getNumBins());
+               //for each otu
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       
+                       //set otus min and max to first one
+                       minOtus[i] = shared[0]->getAbundance(i);
+                       maxOtus[i] = shared[0]->getAbundance(i);
+                       
+                       //for each group
+                       for (int j = 1; j < shared.size(); j++) { 
+                               maxOtus[i] = max(shared[j]->getAbundance(i), maxOtus[i]);
+                               minOtus[i] = min(shared[j]->getAbundance(i), minOtus[i]);
+                       }
+               }
+               
+               double sum = 0.0;
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       int A = shared[0]->getAbundance(i);
+                       int B = shared[1]->getAbundance(i);
+                       
+                       double numerator = abs(A - B);
+                       double denominator = maxOtus[i] - minOtus[i];
+                               
+                       if (denominator != 0) { sum += (numerator / denominator); }
+               }
+               
+               data[0] = sum;
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "Gower", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/gower.h b/gower.h
new file mode 100644 (file)
index 0000000..b6337ce
--- /dev/null
+++ b/gower.h
@@ -0,0 +1,31 @@
+#ifndef GOWER_H
+#define GOWER_H
+
+/*
+ *  gower.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class Gower : public Calculator  {
+       
+public:
+       Gower() :  Calculator("gower", 1, false, true) {};  //the true means this calculator needs all groups to calculate the pair value
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
+
diff --git a/memchi2.cpp b/memchi2.cpp
new file mode 100644 (file)
index 0000000..07edd66
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *  memchi2.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "memchi2.h"
+
+/***********************************************************************/
+EstOutput MemChi2::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               int nonZeroA = 0;
+               int nonZeroB = 0;
+               int totalOtus = shared[0]->getNumBins();
+               int totalGroups = shared.size();
+               
+               //for each otu
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       if (shared[0]->getAbundance(i) != 0) { nonZeroA++; }
+                       if (shared[1]->getAbundance(i) != 0) { nonZeroB++; }
+               }
+               
+               double totalTerm = 1 / (float) totalGroups;
+               double sum = 0.0;
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       int A = shared[0]->getAbundance(i);
+                       int B = shared[1]->getAbundance(i);
+                       
+                       if (A > 0) { A = 1; }
+                       if (B > 0) { B = 1; }
+                       
+                       double Aterm = A / (float) nonZeroA;
+                       double Bterm = B / (float) nonZeroB;
+                       
+                       sum += (totalTerm * ((Aterm-Bterm)*(Aterm-Bterm)));
+               }
+               
+               data[0] = sqrt((totalOtus * sum));
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "MemChi2", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/memchi2.h b/memchi2.h
new file mode 100644 (file)
index 0000000..a81296c
--- /dev/null
+++ b/memchi2.h
@@ -0,0 +1,31 @@
+#ifndef MEMCHI2_H
+#define MEMCHI2_H
+
+/*
+ *  memchi2.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class MemChi2 : public Calculator  {
+       
+public:
+       MemChi2() :  Calculator("memchi2", 1, false, true) {};  //the true means this calculator needs all groups to calculate the pair value
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
diff --git a/memchord.cpp b/memchord.cpp
new file mode 100644 (file)
index 0000000..380ddbe
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *  memchord.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "memchord.h"
+
+/***********************************************************************/
+EstOutput MemChord::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double nonZeroA = 0;
+               double nonZeroB = 0;
+               
+               //for each otu
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       if (shared[0]->getAbundance(i) != 0) { nonZeroA++; }
+                       if (shared[1]->getAbundance(i) != 0) { nonZeroB++; }
+               }
+               
+               nonZeroA = sqrt(nonZeroA);
+               nonZeroB = sqrt(nonZeroB);
+               
+               double sum = 0.0;
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       int A = shared[0]->getAbundance(i);
+                       int B = shared[1]->getAbundance(i);
+                       
+                       if (A > 0) { A = 1; }
+                       if (B > 0) { B = 1; }
+                       
+                       double Aterm = A / nonZeroA;
+                       double Bterm = B / nonZeroB;
+                       
+                       sum += ((Aterm-Bterm)*(Aterm-Bterm));
+               }
+               
+               data[0] = sqrt(sum);
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "MemChord", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/memchord.h b/memchord.h
new file mode 100644 (file)
index 0000000..fc705ab
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef MEMCHORD_H
+#define MEMCHORD_H
+
+/*
+ *  memchord.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class MemChord : public Calculator  {
+       
+public:
+       MemChord() :  Calculator("memchord", 1, false) {};  
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
+
diff --git a/memeuclidean.cpp b/memeuclidean.cpp
new file mode 100644 (file)
index 0000000..e613473
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  memeuclidean.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "memeuclidean.h"
+
+/***********************************************************************/
+EstOutput MemEuclidean::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double sum = 0.0;
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       int A = shared[0]->getAbundance(i);
+                       int B = shared[1]->getAbundance(i);
+                       
+                       if (A > 0) { A = 1; }
+                       if (B > 0) { B = 1; }
+                       
+                       sum += ((A-B)*(A-B));
+               }
+               
+               data[0] = sqrt(sum);
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "MemEuclidean", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/memeuclidean.h b/memeuclidean.h
new file mode 100644 (file)
index 0000000..ae22be1
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef MEMEUCLIDEAN_H
+#define MEMEUCLIDEAN_H
+
+/*
+ *  memeuclidean.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class MemEuclidean : public Calculator  {
+       
+public:
+       MemEuclidean() :  Calculator("memeuclidean", 1, false) {};  
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
diff --git a/mempearson.cpp b/mempearson.cpp
new file mode 100644 (file)
index 0000000..b39afd8
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ *  mempearson.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "mempearson.h"
+
+/***********************************************************************/
+EstOutput MemPearson::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               int nonZeroA = 0;
+               int nonZeroB = 0;
+               int numOTUS = shared[0]->getNumBins();
+               
+               //for each otu
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       if (shared[0]->getAbundance(i) != 0) { nonZeroA++; }
+                       if (shared[1]->getAbundance(i) != 0) { nonZeroB++; }
+               }
+               
+               double numTerm1 = 0.0;
+               double numTerm2 = 0.0;
+               double denomTerm1 = 0.0;
+               double denomTerm2 = 0.0;
+               
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       int Aij =  shared[0]->getAbundance(i);
+                       int Bij =  shared[1]->getAbundance(i);
+                       
+                       if (Aij > 0) { Aij = 1; }
+                       if (Bij > 0) { Bij = 1; }
+                       
+                       numTerm1 += (Aij - (nonZeroA / (float) numOTUS));
+                       numTerm2 += (Bij - (nonZeroB / (float) numOTUS));
+                       
+                       denomTerm1 += ((Aij - (nonZeroA / (float) numOTUS)) * (Aij - (nonZeroA / (float) numOTUS)));
+                       denomTerm2 += ((Bij - (nonZeroB / (float) numOTUS)) * (Bij - (nonZeroB / (float) numOTUS)));
+               }
+               
+               denomTerm1 = sqrt(denomTerm1);
+               denomTerm2 = sqrt(denomTerm2);
+               
+               double denom = denomTerm1 * denomTerm2;
+               double numerator = numTerm1 * numTerm2;
+               
+               if (denom != 0) { 
+                       data[0] = 1.0 - (numerator / denom);
+               }else {
+                       data[0] = 1.0;
+               }
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "MemPearson", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/mempearson.h b/mempearson.h
new file mode 100644 (file)
index 0000000..d94f2ac
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef MEMPEARSON_H
+#define MEMPEARSON_H
+
+/*
+ *  mempearson.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class MemPearson : public Calculator  {
+       
+public:
+       MemPearson() :  Calculator("mempearson", 1, false) {};  
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
diff --git a/mothur b/mothur
index cf280b7d8f8759918e81680e9f5b9154c488ce06..dfbb7ad0a2fa873a9b35c09fa000672700e71d13 100755 (executable)
Binary files a/mothur and b/mothur differ
diff --git a/strictchi2.cpp b/strictchi2.cpp
deleted file mode 100644 (file)
index 9719aa8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  strictchi2.cpp
- *  Mothur
- *
- *  Created by westcott on 12/17/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-#include "strictchi2.h"
-
-/***********************************************************************/
-EstOutput StrictChi2::getValues(vector<SharedRAbundVector*> shared) {
-       try {
-               data.resize(1,0);
-               
-               double sumA = shared[0]->getNumSeqs();
-               double sumB = shared[1]->getNumSeqs();
-               double totalSum = 0.0;
-               
-               for (int i = 0; i < shared.size(); i++) { totalSum += shared[i]->getNumSeqs();  }
-               
-               vector<int> sumOtus; sumOtus.resize(shared[0]->getNumBins(), 0);
-               //for each otu
-               for (int i = 0; i < shared[0]->getNumBins(); i++) {
-                       //for each group
-                       for (int j = 0; j < shared.size(); j++) { 
-                               
-                       }
-               }
-                               
-               
-                               
-               //data[0] = sqrt(sum);
-               
-               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
-               
-               return data;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "StrictChi2", "getValues");
-               exit(1);
-       }
-}
-/***********************************************************************/
diff --git a/strictchi2.h b/strictchi2.h
deleted file mode 100644 (file)
index 1099d73..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef STRICTCHI2_H
-#define STRICTCHI2_H
-
-/*
- *  strictchi2.h
- *  Mothur
- *
- *  Created by westcott on 12/17/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-
-#include "calculator.h"
-
-/***********************************************************************/
-
-class StrictChi2 : public Calculator  {
-       
-public:
-       StrictChi2() :  Calculator("strictchi2", 1, false, true) {};  //the true means this calculator needs all groups to calculate the pair value
-       EstOutput getValues(SAbundVector*) {return data;};
-       EstOutput getValues(vector<SharedRAbundVector*>);
-private:
-       
-};
-
-/***********************************************************************/
-
-#endif
\ No newline at end of file
diff --git a/strictchord.cpp b/strictchord.cpp
deleted file mode 100644 (file)
index ef99354..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *  strictchord.cpp
- *  Mothur
- *
- *  Created by westcott on 12/15/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-#include "strictchord.h"
-
-/***********************************************************************/
-EstOutput StrictChord::getValues(vector<SharedRAbundVector*> shared) {
-       try {
-               data.resize(1,0);
-               
-               double sumAj2 = 0.0;
-               double sumBj2 = 0.0;
-               
-               //calc the 2 denominators
-               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
-                       
-                       int Aij = shared[0]->getAbundance(i);
-                       int Bij = shared[1]->getAbundance(i);
-                       
-                       //(Aij) ^ 2
-                       sumAj2 += (Aij * Aij);
-                       sumBj2 += (Bij * Bij);
-               }
-               
-               sumAj2 = sqrt(sumAj2);
-               sumBj2 = sqrt(sumBj2);
-               
-               //calc sum
-               double sum = 0.0;
-               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
-                       
-                       int Aij = shared[0]->getAbundance(i);
-                       int Bij = shared[1]->getAbundance(i);
-                       
-                       sum += (((Aij / sumAj2) - (Bij / sumBj2)) * ((Aij / sumAj2) - (Bij / sumBj2)));
-               }
-               
-               data[0] = sqrt(sum);
-               
-               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
-               
-               return data;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "StrictChord", "getValues");
-               exit(1);
-       }
-}
-/***********************************************************************/
diff --git a/strictchord.h b/strictchord.h
deleted file mode 100644 (file)
index ef96d82..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef STRICTCHORD_H
-#define STRICTCHORD_H
-
-/*
- *  strictchord.h
- *  Mothur
- *
- *  Created by westcott on 12/15/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-
-#include "calculator.h"
-
-/***********************************************************************/
-
-class StrictChord : public Calculator  {
-       
-public:
-       StrictChord() :  Calculator("strictchord", 1, false) {};
-       EstOutput getValues(SAbundVector*) {return data;};
-       EstOutput getValues(vector<SharedRAbundVector*>);
-private:
-       
-};
-
-/***********************************************************************/
-
-#endif
-
-
-
diff --git a/stricteuclidean.cpp b/stricteuclidean.cpp
deleted file mode 100644 (file)
index 3f40363..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  stricteuclidean.cpp
- *  Mothur
- *
- *  Created by westcott on 12/14/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-#include "stricteuclidean.h"
-
-/***********************************************************************/
-EstOutput StrictEuclidean::getValues(vector<SharedRAbundVector*> shared) {
-       try {
-               data.resize(1,0);
-               
-               double sum = 0.0;
-               
-               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
-                       
-                       int Aij = shared[0]->getAbundance(i);
-                       int Bij = shared[1]->getAbundance(i);
-                       
-                       //(Aij - Bij) ^ 2
-                       sum += ((Aij - Bij) * (Aij - Bij));
-               }
-               
-               data[0] = sqrt(sum);
-               
-               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
-               
-               return data;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "StrictEuclidean", "getValues");
-               exit(1);
-       }
-}
-/***********************************************************************/
-
diff --git a/stricteuclidean.h b/stricteuclidean.h
deleted file mode 100644 (file)
index 52f0538..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef STRICTEUCLIDEAN_H
-#define STRICTEUCLIDEAN_H
-
-/*
- *  stricteuclidean.h
- *  Mothur
- *
- *  Created by westcott on 12/14/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-
-
-#include "calculator.h"
-
-/***********************************************************************/
-
-class StrictEuclidean : public Calculator  {
-       
-public:
-       StrictEuclidean() :  Calculator("stricteuclidean", 1, false) {};
-       EstOutput getValues(SAbundVector*) {return data;};
-       EstOutput getValues(vector<SharedRAbundVector*>);
-private:
-       
-};
-
-/***********************************************************************/
-
-#endif
-
-
diff --git a/strictkulczynski.cpp b/strictkulczynski.cpp
deleted file mode 100644 (file)
index edc2b71..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *  strictkulczynski.cpp
- *  Mothur
- *
- *  Created by westcott on 12/15/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-#include "strictkulczynski.h"
-
-/***********************************************************************/
-EstOutput StrictKulczynski::getValues(vector<SharedRAbundVector*> shared) {
-       try {
-               data.resize(1,0);
-               
-               double sumA = 0.0;
-               double sumB = 0.0;
-               double sumMin = 0.0;
-               
-               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
-                       
-                       int A = shared[0]->getAbundance(i);
-                       int B = shared[1]->getAbundance(i);
-                       
-                       sumA += A;
-                       sumB += B;
-                       sumMin += min(A, B);
-               }
-               
-               data[0] = 1.0 - (0.5 * ((sumMin / sumA) + (sumMin / sumB)));
-               
-               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
-               
-               return data;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "StrictKulczynski", "getValues");
-               exit(1);
-       }
-}
-/***********************************************************************/
-
-
diff --git a/strictkulczynski.h b/strictkulczynski.h
deleted file mode 100644 (file)
index c9395de..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef STRICTKULCZYNSKI_H
-#define STRICTKULCZYNSKI_H
-
-/*
- *  strictkulczynski.h
- *  Mothur
- *
- *  Created by westcott on 12/15/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-
-#include "calculator.h"
-
-/***********************************************************************/
-
-class StrictKulczynski : public Calculator  {
-       
-public:
-       StrictKulczynski() :  Calculator("strictkulczynski", 1, false) {};
-       EstOutput getValues(SAbundVector*) {return data;};
-       EstOutput getValues(vector<SharedRAbundVector*>);
-private:
-       
-};
-
-/***********************************************************************/
-
-#endif
-
-
-
diff --git a/strictpearson.cpp b/strictpearson.cpp
deleted file mode 100644 (file)
index 6bfa44f..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *  strictpearson.cpp
- *  Mothur
- *
- *  Created by westcott on 12/15/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-#include "strictpearson.h"
-
-/***********************************************************************/
-EstOutput StrictPearson::getValues(vector<SharedRAbundVector*> shared) {
-       try {
-               data.resize(1,0);
-               
-               double sumA = 0.0;
-               double sumB = 0.0;
-               int numOTUS = shared[0]->getNumBins();
-               
-               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
-                       sumA += shared[0]->getAbundance(i);
-                       sumB += shared[1]->getAbundance(i);
-               }
-               
-               double numTerm1 = 0.0;
-               double numTerm2 = 0.0;
-               double denomTerm1 = 0.0;
-               double denomTerm2 = 0.0;
-               
-               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
-                       int Aij =  shared[0]->getAbundance(i);
-                       int Bij =  shared[1]->getAbundance(i);
-                       
-                       numTerm1 += (Aij - (sumA / (float) numOTUS));
-                       numTerm2 += (Bij - (sumB / (float) numOTUS));
-                       
-                       denomTerm1 += ((Aij - (sumA / (float) numOTUS)) * (Aij - (sumA / (float) numOTUS)));
-                       denomTerm2 += ((Bij - (sumB / (float) numOTUS)) * (Bij - (sumB / (float) numOTUS)));
-               }
-               
-               denomTerm1 = sqrt(denomTerm1);
-               denomTerm2 = sqrt(denomTerm2);
-               
-               double denom = denomTerm1 * denomTerm2;
-               double numerator = numTerm1 * numTerm2;
-               
-               data[0] = 1.0 - (numerator / denom);
-               
-               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
-               
-               return data;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "StrictPearson", "getValues");
-               exit(1);
-       }
-}
-/***********************************************************************/
diff --git a/strictpearson.h b/strictpearson.h
deleted file mode 100644 (file)
index 70d728d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef STRICTPEARSON_H
-#define STRICTPEARSON_H
-
-/*
- *  strictpearson.h
- *  Mothur
- *
- *  Created by westcott on 12/15/10.
- *  Copyright 2010 Schloss Lab. All rights reserved.
- *
- */
-
-
-
-#include "calculator.h"
-
-/***********************************************************************/
-
-class StrictPearson : public Calculator  {
-       
-public:
-       StrictPearson() :  Calculator("strictpearson", 1, false) {};
-       EstOutput getValues(SAbundVector*) {return data;};
-       EstOutput getValues(vector<SharedRAbundVector*>);
-private:
-       
-};
-
-/***********************************************************************/
-
-#endif
-
-
diff --git a/structchi2.cpp b/structchi2.cpp
new file mode 100644 (file)
index 0000000..00ec097
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ *  structchi2.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "structchi2.h"
+
+/***********************************************************************/
+EstOutput StructChi2::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double sumA = shared[0]->getNumSeqs();
+               double sumB = shared[1]->getNumSeqs();
+               double totalSum = 0.0;
+               
+               for (int i = 0; i < shared.size(); i++) { totalSum += shared[i]->getNumSeqs();  }
+               
+               vector<int> sumOtus; sumOtus.resize(shared[0]->getNumBins(), 0);
+               //for each otu
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       //for each group
+                       for (int j = 0; j < shared.size(); j++) { 
+                               sumOtus[i] += shared[j]->getAbundance(i);
+                       }
+               }
+               
+               double sum = 0.0;
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
+                       int A = shared[0]->getAbundance(i);
+                       int B = shared[1]->getAbundance(i);
+                       
+                       double totalTerm = 1 / (float) sumOtus[i];
+                       double Aterm = A / sumA;
+                       double Bterm = B / sumB;
+                       
+                       sum += (totalTerm * ((Aterm-Bterm)*(Aterm-Bterm)));
+               }
+                               
+               data[0] = sqrt((totalSum * sum));
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "StructChi2", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/structchi2.h b/structchi2.h
new file mode 100644 (file)
index 0000000..aa82e75
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef STRUCTCHI2_H
+#define STRUCTCHI2_H
+
+/*
+ *  structchi2.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/17/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class StructChi2 : public Calculator  {
+       
+public:
+       StructChi2() :  Calculator("structchi2", 1, false, true) {};  //the true means this calculator needs all groups to calculate the pair value
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
\ No newline at end of file
diff --git a/structchord.cpp b/structchord.cpp
new file mode 100644 (file)
index 0000000..e85846f
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *  structchord.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/15/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "structchord.h"
+
+/***********************************************************************/
+EstOutput StructChord::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double sumAj2 = 0.0;
+               double sumBj2 = 0.0;
+               
+               //calc the 2 denominators
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       
+                       int Aij = shared[0]->getAbundance(i);
+                       int Bij = shared[1]->getAbundance(i);
+                       
+                       //(Aij) ^ 2
+                       sumAj2 += (Aij * Aij);
+                       sumBj2 += (Bij * Bij);
+               }
+               
+               sumAj2 = sqrt(sumAj2);
+               sumBj2 = sqrt(sumBj2);
+               
+               //calc sum
+               double sum = 0.0;
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       
+                       int Aij = shared[0]->getAbundance(i);
+                       int Bij = shared[1]->getAbundance(i);
+                       
+                       sum += (((Aij / sumAj2) - (Bij / sumBj2)) * ((Aij / sumAj2) - (Bij / sumBj2)));
+               }
+               
+               data[0] = sqrt(sum);
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "StructChord", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
diff --git a/structchord.h b/structchord.h
new file mode 100644 (file)
index 0000000..f35c890
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef STRUCTCHORD_H
+#define STRUCTCHORD_H
+
+/*
+ *  structchord.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/15/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class StructChord : public Calculator  {
+       
+public:
+       StructChord() :  Calculator("structchord", 1, false) {};
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
+
+
+
diff --git a/structeuclidean.cpp b/structeuclidean.cpp
new file mode 100644 (file)
index 0000000..1737920
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  structeuclidean.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/14/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "structeuclidean.h"
+
+/***********************************************************************/
+EstOutput StructEuclidean::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double sum = 0.0;
+               
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       
+                       int Aij = shared[0]->getAbundance(i);
+                       int Bij = shared[1]->getAbundance(i);
+                       
+                       //(Aij - Bij) ^ 2
+                       sum += ((Aij - Bij) * (Aij - Bij));
+               }
+               
+               data[0] = sqrt(sum);
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "StructEuclidean", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
diff --git a/structeuclidean.h b/structeuclidean.h
new file mode 100644 (file)
index 0000000..37c54fc
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef STRUCTEUCLIDEAN_H
+#define STRUCTEUCLIDEAN_H
+
+/*
+ *  structeuclidean.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/14/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class StructEuclidean : public Calculator  {
+       
+public:
+       StructEuclidean() :  Calculator("structeuclidean", 1, false) {};
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
+
+
diff --git a/structkulczynski.cpp b/structkulczynski.cpp
new file mode 100644 (file)
index 0000000..9518068
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ *  structkulczynski.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/15/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "structkulczynski.h"
+
+/***********************************************************************/
+EstOutput StructKulczynski::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double sumA = 0.0;
+               double sumB = 0.0;
+               double sumMin = 0.0;
+               
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       
+                       int A = shared[0]->getAbundance(i);
+                       int B = shared[1]->getAbundance(i);
+                       
+                       sumA += A;
+                       sumB += B;
+                       sumMin += min(A, B);
+               }
+               
+               data[0] = 1.0 - (0.5 * ((sumMin / sumA) + (sumMin / sumB)));
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "StructKulczynski", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
+
+
diff --git a/structkulczynski.h b/structkulczynski.h
new file mode 100644 (file)
index 0000000..75cd8a6
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef STRUCTKULCZYNSKI_H
+#define STRUCTKULCZYNSKI_H
+
+/*
+ *  structkulczynski.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/15/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class StructKulczynski : public Calculator  {
+       
+public:
+       StructKulczynski() :  Calculator("structkulczynski", 1, false) {};
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
+
+
+
diff --git a/structpearson.cpp b/structpearson.cpp
new file mode 100644 (file)
index 0000000..9d030ef
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *  structpearson.cpp
+ *  Mothur
+ *
+ *  Created by westcott on 12/15/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "structpearson.h"
+
+/***********************************************************************/
+EstOutput StructPearson::getValues(vector<SharedRAbundVector*> shared) {
+       try {
+               data.resize(1,0);
+               
+               double sumA = 0.0;
+               double sumB = 0.0;
+               int numOTUS = shared[0]->getNumBins();
+               
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       sumA += shared[0]->getAbundance(i);
+                       sumB += shared[1]->getAbundance(i);
+               }
+               
+               double numTerm1 = 0.0;
+               double numTerm2 = 0.0;
+               double denomTerm1 = 0.0;
+               double denomTerm2 = 0.0;
+               
+               for (int i = 0; i < shared[0]->getNumBins(); i++) { 
+                       int Aij =  shared[0]->getAbundance(i);
+                       int Bij =  shared[1]->getAbundance(i);
+                       
+                       numTerm1 += (Aij - (sumA / (float) numOTUS));
+                       numTerm2 += (Bij - (sumB / (float) numOTUS));
+                       
+                       denomTerm1 += ((Aij - (sumA / (float) numOTUS)) * (Aij - (sumA / (float) numOTUS)));
+                       denomTerm2 += ((Bij - (sumB / (float) numOTUS)) * (Bij - (sumB / (float) numOTUS)));
+               }
+               
+               denomTerm1 = sqrt(denomTerm1);
+               denomTerm2 = sqrt(denomTerm2);
+               
+               double denom = denomTerm1 * denomTerm2;
+               double numerator = numTerm1 * numTerm2;
+               
+               data[0] = 1.0 - (numerator / denom);
+               
+               if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
+               
+               return data;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "StructPearson", "getValues");
+               exit(1);
+       }
+}
+/***********************************************************************/
diff --git a/structpearson.h b/structpearson.h
new file mode 100644 (file)
index 0000000..c3b9455
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef STRUCTPEARSON_H
+#define STRUCTPEARSON_H
+
+/*
+ *  structpearson.h
+ *  Mothur
+ *
+ *  Created by westcott on 12/15/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class StructPearson : public Calculator  {
+       
+public:
+       StructPearson() :  Calculator("structpearson", 1, false) {};
+       EstOutput getValues(SAbundVector*) {return data;};
+       EstOutput getValues(vector<SharedRAbundVector*>);
+private:
+       
+};
+
+/***********************************************************************/
+
+#endif
+
+
index 4d982fa630168cf51bb1bfdf5943473795925add..b3f7729e10a709a202b627148386b7bd66d5ac31 100644 (file)
 #include "whittaker.h"
 #include "odum.h"
 #include "canberra.h"
-#include "stricteuclidean.h"
-#include "strictchord.h"
+#include "structeuclidean.h"
+#include "structchord.h"
 #include "hellinger.h"
 #include "manhattan.h"
-#include "strictpearson.h"
+#include "structpearson.h"
 #include "soergel.h"
 #include "spearman.h"
-#include "strictkulczynski.h"
+#include "structkulczynski.h"
+#include "structchi2.h"
 #include "speciesprofile.h"
 #include "hamming.h"
+#include "gower.h"
+#include "memchi2.h"
+#include "memchord.h"
+#include "memeuclidean.h"
+#include "mempearson.h"
 
 //**********************************************************************************************************************
 vector<string> SummarySharedCommand::getValidParameters(){     
@@ -226,26 +232,38 @@ SummarySharedCommand::SummarySharedCommand(string option)  {
                                                        sumCalculators.push_back(new Odum());
                                                }else if (Estimators[i] == "canberra") { 
                                                        sumCalculators.push_back(new Canberra());
-                                               }else if (Estimators[i] == "stricteuclidean") { 
-                                                       sumCalculators.push_back(new StrictEuclidean());
-                                               }else if (Estimators[i] == "strictchord") { 
-                                                       sumCalculators.push_back(new StrictChord());
+                                               }else if (Estimators[i] == "structeuclidean") { 
+                                                       sumCalculators.push_back(new StructEuclidean());
+                                               }else if (Estimators[i] == "structchord") { 
+                                                       sumCalculators.push_back(new StructChord());
                                                }else if (Estimators[i] == "hellinger") { 
                                                        sumCalculators.push_back(new Hellinger());
                                                }else if (Estimators[i] == "manhattan") { 
                                                        sumCalculators.push_back(new Manhattan());
-                                               }else if (Estimators[i] == "strictpearson") { 
-                                                       sumCalculators.push_back(new StrictPearson());
+                                               }else if (Estimators[i] == "structpearson") { 
+                                                       sumCalculators.push_back(new StructPearson());
                                                }else if (Estimators[i] == "soergel") { 
                                                        sumCalculators.push_back(new Soergel());
                                                }else if (Estimators[i] == "spearman") { 
                                                        sumCalculators.push_back(new Spearman());
-                                               }else if (Estimators[i] == "strictkulczynski") { 
-                                                       sumCalculators.push_back(new StrictKulczynski());
+                                               }else if (Estimators[i] == "structkulczynski") { 
+                                                       sumCalculators.push_back(new StructKulczynski());
                                                }else if (Estimators[i] == "speciesprofile") { 
                                                        sumCalculators.push_back(new SpeciesProfile());
                                                }else if (Estimators[i] == "hamming") { 
                                                        sumCalculators.push_back(new Hamming());
+                                               }else if (Estimators[i] == "structchi2") { 
+                                                       sumCalculators.push_back(new StructChi2());
+                                               }else if (Estimators[i] == "gower") { 
+                                                       sumCalculators.push_back(new Gower());
+                                               }else if (Estimators[i] == "memchi2") { 
+                                                       sumCalculators.push_back(new MemChi2());
+                                               }else if (Estimators[i] == "memchord") { 
+                                                       sumCalculators.push_back(new MemChord());
+                                               }else if (Estimators[i] == "memeuclidean") { 
+                                                       sumCalculators.push_back(new MemEuclidean());
+                                               }else if (Estimators[i] == "mempearson") { 
+                                                       sumCalculators.push_back(new MemPearson());
                                                }
                                        }
                                }
@@ -709,7 +727,15 @@ int SummarySharedCommand::driver(vector<SharedRAbundVector*> thisLookup, int sta
                                }
                                
                                for(int i=0;i<sumCalculators.size();i++) {
-
+                                       
+                                       //if this calc needs all groups to calculate the pair load all groups
+                                       if (sumCalculators[i]->getNeedsAll()) { 
+                                               //load subset with rest of lookup for those calcs that need everyone to calc for a pair
+                                               for (int w = 0; w < thisLookup.size(); w++) {
+                                                       if ((w != k) && (w != l)) { subset.push_back(thisLookup[w]); }
+                                               }
+                                       }
+                                       
                                        vector<double> tempdata = sumCalculators[i]->getValues(subset); //saves the calculator outputs
                                        
                                        if (m->control_pressed) { outputFileHandle.close(); return 1; }
index d3a641f0b9c37286d241f126e01d708a144569c6..6242d5aaf5c7e49eb54a75b26a0eb48425302123 100644 (file)
@@ -262,16 +262,22 @@ void ValidCalculators::initialShared() {
                shared["braycurtis"]                    = "braycurtis";
                shared["odum"]                                  = "odum";
                shared["canberra"]                              = "canberra";
-               shared["stricteuclidean"]               = "stricteuclidean";
-               shared["strictchord"]                   = "strictchord";
+               shared["structeuclidean"]               = "structeuclidean";
+               shared["structchord"]                   = "structchord";
                shared["hellinger"]                             = "hellinger";
                shared["manhattan"]                             = "manhattan";
-               shared["strictpearson"]                 = "strictpearson";
+               shared["structpearson"]                 = "structpearson";
                shared["soergel"]                               = "soergel";
                shared["spearman"]                              = "spearman";
-               shared["strictkulczynski"]              = "strictkulczynski";
+               shared["structkulczynski"]              = "structkulczynski";
+               shared["structchi2"]                    = "structchi2";
                shared["speciesprofile"]                = "speciesprofile";
                shared["hamming"]                               = "hamming";
+               shared["gower"]                                 = "gower";
+               shared["memchi2"]                               = "memchi2";
+               shared["memchord"]                              = "memchord";
+               shared["memeuclidean"]                  = "memeuclidean";
+               shared["mempearson"]                    = "mempearson";
                shared["default"]                   = "default";
        }
        catch(exception& e) {
@@ -369,16 +375,22 @@ void ValidCalculators::initialSharedSummary() {
                sharedsummary["braycurtis"]                             = "braycurtis";
                sharedsummary["odum"]                                   = "odum";
                sharedsummary["canberra"]                               = "canberra";
-               sharedsummary["stricteuclidean"]                = "stricteuclidean";
-               sharedsummary["strictchord"]                    = "strictchord";
+               sharedsummary["structeuclidean"]                = "structeuclidean";
+               sharedsummary["structchord"]                    = "structchord";
                sharedsummary["hellinger"]                              = "hellinger";
                sharedsummary["manhattan"]                              = "manhattan";
-               sharedsummary["strictpearson"]                  = "strictpearson";
-               sharedsummary["strictkulczynski"]               = "strictkulczynski";
+               sharedsummary["structpearson"]                  = "structpearson";
+               sharedsummary["structkulczynski"]               = "structkulczynski";
+               sharedsummary["structchi2"]                             = "structchi2";
                sharedsummary["soergel"]                                = "soergel";
                sharedsummary["spearman"]                               = "spearman";
                sharedsummary["speciesprofile"]                 = "speciesprofile";
                sharedsummary["hamming"]                                = "hamming";
+               sharedsummary["gower"]                                  = "gower";
+               sharedsummary["memchi2"]                                = "memchi2";
+               sharedsummary["memchord"]                               = "memchord";
+               sharedsummary["memeuclidean"]                   = "memeuclidean";
+               sharedsummary["mempearson"]                             = "mempearson";
                sharedsummary["default"]                                = "default";
        }
        catch(exception& e) {