From 83950cc7a80a36c79dededb484daec5ec26b330f Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 27 Mar 2009 20:09:47 +0000 Subject: [PATCH] added heatmap command --- Mothur.xcodeproj/project.pbxproj | 12 -------- collectsharedcommand.cpp | 6 ++-- sharedanderberg.cpp | 52 -------------------------------- summarysharedcommand.cpp | 6 ++-- 4 files changed, 6 insertions(+), 70 deletions(-) delete mode 100644 sharedanderberg.cpp diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index a84195d..64eb04b 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -20,14 +20,12 @@ 375873AA0F7D61240040F377 /* heatmapcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873910F7D61240040F377 /* heatmapcommand.cpp */; }; 375873AB0F7D61240040F377 /* libshuffcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873930F7D61240040F377 /* libshuffcommand.cpp */; }; 375873AC0F7D61240040F377 /* nocommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873950F7D61240040F377 /* nocommands.cpp */; }; - 375873AD0F7D61240040F377 /* sharedanderberg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873980F7D61240040F377 /* sharedanderberg.cpp */; }; 375873AE0F7D61240040F377 /* sharedbraycurtis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3758739A0F7D61240040F377 /* sharedbraycurtis.cpp */; }; 375873AF0F7D61240040F377 /* sharedkulczynski.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3758739C0F7D61240040F377 /* sharedkulczynski.cpp */; }; 375873B00F7D61240040F377 /* sharedkulczynskicody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3758739E0F7D61240040F377 /* sharedkulczynskicody.cpp */; }; 375873B10F7D61240040F377 /* sharedlennon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873A00F7D61240040F377 /* sharedlennon.cpp */; }; 375873B20F7D61240040F377 /* sharedmorisitahorn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873A20F7D61240040F377 /* sharedmorisitahorn.cpp */; }; 375873B30F7D61240040F377 /* sharedochiai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873A50F7D61240040F377 /* sharedochiai.cpp */; }; - 375873E30F7D63B50040F377 /* sharedanderberg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873E20F7D63B50040F377 /* sharedanderberg.cpp */; }; 375873E70F7D63E90040F377 /* coverage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873E50F7D63E90040F377 /* coverage.cpp */; }; 375873EC0F7D64520040F377 /* fullmatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873EB0F7D64520040F377 /* fullmatrix.cpp */; }; 375873EF0F7D646F0040F377 /* heatmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375873EE0F7D646F0040F377 /* heatmap.cpp */; }; @@ -170,8 +168,6 @@ 375873950F7D61240040F377 /* nocommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nocommands.cpp; sourceTree = ""; }; 375873960F7D61240040F377 /* nocommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nocommands.h; sourceTree = ""; }; 375873970F7D61240040F377 /* nseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nseqs.h; sourceTree = ""; }; - 375873980F7D61240040F377 /* sharedanderberg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedanderberg.cpp; sourceTree = ""; }; - 375873990F7D61240040F377 /* sharedanderberg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderberg.h; sourceTree = ""; }; 3758739A0F7D61240040F377 /* sharedbraycurtis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedbraycurtis.cpp; sourceTree = ""; }; 3758739B0F7D61240040F377 /* sharedbraycurtis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedbraycurtis.h; sourceTree = ""; }; 3758739C0F7D61240040F377 /* sharedkulczynski.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedkulczynski.cpp; sourceTree = ""; }; @@ -185,7 +181,6 @@ 375873A40F7D61240040F377 /* sharednseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharednseqs.h; sourceTree = ""; }; 375873A50F7D61240040F377 /* sharedochiai.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedochiai.cpp; sourceTree = ""; }; 375873A60F7D61240040F377 /* sharedochiai.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedochiai.h; sourceTree = ""; }; - 375873E20F7D63B50040F377 /* sharedanderberg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedanderberg.cpp; sourceTree = ""; }; 375873E50F7D63E90040F377 /* coverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coverage.cpp; sourceTree = ""; }; 375873E60F7D63E90040F377 /* coverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coverage.h; sourceTree = ""; }; 375873EA0F7D64520040F377 /* fullmatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fullmatrix.h; sourceTree = ""; }; @@ -199,7 +194,6 @@ 375873F60F7D649C0040F377 /* nocommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nocommands.cpp; sourceTree = ""; }; 375873F70F7D649C0040F377 /* nocommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nocommands.h; sourceTree = ""; }; 375873F90F7D64AB0040F377 /* nseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nseqs.h; sourceTree = ""; }; - 375873FA0F7D64D20040F377 /* sharedanderberg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderberg.h; sourceTree = ""; }; 375873FB0F7D64DA0040F377 /* sharedbraycurtis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedbraycurtis.h; sourceTree = ""; }; 375873FC0F7D64DA0040F377 /* sharedbraycurtis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedbraycurtis.cpp; sourceTree = ""; }; 375873FE0F7D64EF0040F377 /* sharedkulczynski.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedkulczynski.cpp; sourceTree = ""; }; @@ -475,8 +469,6 @@ 375873950F7D61240040F377 /* nocommands.cpp */, 375873960F7D61240040F377 /* nocommands.h */, 375873970F7D61240040F377 /* nseqs.h */, - 375873980F7D61240040F377 /* sharedanderberg.cpp */, - 375873990F7D61240040F377 /* sharedanderberg.h */, 3758739A0F7D61240040F377 /* sharedbraycurtis.cpp */, 3758739B0F7D61240040F377 /* sharedbraycurtis.h */, 3758739C0F7D61240040F377 /* sharedkulczynski.cpp */, @@ -561,8 +553,6 @@ 37D9281E0F21331F001D4494 /* shannon.cpp */, 37D928230F21331F001D4494 /* sharedace.h */, 37D928220F21331F001D4494 /* sharedace.cpp */, - 375873FA0F7D64D20040F377 /* sharedanderberg.h */, - 375873E20F7D63B50040F377 /* sharedanderberg.cpp */, 375873FB0F7D64DA0040F377 /* sharedbraycurtis.h */, 375873FC0F7D64DA0040F377 /* sharedbraycurtis.cpp */, EB6F01590F6AC1670048081A /* sharedbdiversity.h */, @@ -873,14 +863,12 @@ 375873AA0F7D61240040F377 /* heatmapcommand.cpp in Sources */, 375873AB0F7D61240040F377 /* libshuffcommand.cpp in Sources */, 375873AC0F7D61240040F377 /* nocommands.cpp in Sources */, - 375873AD0F7D61240040F377 /* sharedanderberg.cpp in Sources */, 375873AE0F7D61240040F377 /* sharedbraycurtis.cpp in Sources */, 375873AF0F7D61240040F377 /* sharedkulczynski.cpp in Sources */, 375873B00F7D61240040F377 /* sharedkulczynskicody.cpp in Sources */, 375873B10F7D61240040F377 /* sharedlennon.cpp in Sources */, 375873B20F7D61240040F377 /* sharedmorisitahorn.cpp in Sources */, 375873B30F7D61240040F377 /* sharedochiai.cpp in Sources */, - 375873E30F7D63B50040F377 /* sharedanderberg.cpp in Sources */, 375873E70F7D63E90040F377 /* coverage.cpp in Sources */, 375873EC0F7D64520040F377 /* fullmatrix.cpp in Sources */, 375873EF0F7D646F0040F377 /* heatmap.cpp in Sources */, diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index c5b8130..3c1ad52 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -23,7 +23,7 @@ #include "sharedbdiversity.h" #include "sharednseqs.h" #include "sharedochiai.h" -#include "sharedanderberg.h" +//#include "sharedanderberg.h" #include "sharedkulczynski.h" #include "sharedkulczynskicody.h" #include "sharedlennon.h" @@ -75,8 +75,8 @@ CollectSharedCommand::CollectSharedCommand(){ 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"))); + //}else if (globaldata->Estimators[i] == "sharedanderberg") { + // cDisplays.push_back(new CollectDisplay(new SharedAnderberg(), new SharedOneColumnFile(fileNameRoot+"shared.anderberg"))); }else if (globaldata->Estimators[i] == "sharedkulczynski") { cDisplays.push_back(new CollectDisplay(new SharedKulczynski(), new SharedOneColumnFile(fileNameRoot+"shared.kulczynski"))); }else if (globaldata->Estimators[i] == "sharedkulczynskicody") { diff --git a/sharedanderberg.cpp b/sharedanderberg.cpp deleted file mode 100644 index 52745ec..0000000 --- a/sharedanderberg.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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); - } -} - -/***********************************************************************/ diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index a7c38f7..8b3a63f 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -23,7 +23,7 @@ #include "sharedkstest.h" #include "sharedbdiversity.h" #include "sharedochiai.h" -#include "sharedanderberg.h" +//#include "sharedanderberg.h" #include "sharedkulczynski.h" #include "sharedkulczynskicody.h" #include "sharedlennon.h" @@ -72,8 +72,8 @@ SummarySharedCommand::SummarySharedCommand(){ 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()); + //}else if (globaldata->Estimators[i] == "sharedanderberg") { + //sumCalculators.push_back(new SharedAnderberg()); }else if (globaldata->Estimators[i] == "sharedkulczynski") { sumCalculators.push_back(new SharedKulczynski()); }else if (globaldata->Estimators[i] == "sharedkulczynskicody") { -- 2.39.2