/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 370936DE0F6E7A4A00EB4C2C /* nseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nseqs.h; sourceTree = "<group>"; };
+ 3709370A0F6E7FC100EB4C2C /* sharednseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharednseqs.h; sourceTree = "<group>"; };
372E126E0F26365B0095CF7E /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = "<group>"; };
372E126F0F26365B0095CF7E /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = "<group>"; };
372E12940F263D5A0095CF7E /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = "<group>"; };
37D927E70F21331F001D4494 /* jackknife.cpp */,
37D927F50F21331F001D4494 /* npshannon.h */,
37D927F40F21331F001D4494 /* npshannon.cpp */,
+ 370936DE0F6E7A4A00EB4C2C /* nseqs.h */,
379294880F2E258500B9034A /* parsimony.h */,
379294890F2E258500B9034A /* parsimony.cpp */,
37D928020F21331F001D4494 /* rarecalc.h */,
37D9282A0F21331F001D4494 /* sharedjclass.cpp */,
37D9282D0F21331F001D4494 /* sharedjest.h */,
37D9282C0F21331F001D4494 /* sharedjest.cpp */,
+ 3709370A0F6E7FC100EB4C2C /* sharednseqs.h */,
37D928350F21331F001D4494 /* sharedsobs.h */,
37D928340F21331F001D4494 /* sharedsobs.cpp */,
37AFC71D0F445386005F492D /* sharedsobscollectsummary.h */,
#include "collectcommand.h"
#include "ace.h"
#include "sobs.h"
+#include "nseqs.h"
#include "chao1.h"
#include "bootstrap.h"
#include "simpson.h"
cDisplays.push_back(new CollectDisplay(new Sobs(), new OneColumnFile(fileNameRoot+"sobs")));
}else if (globaldata->Estimators[i] == "chao") {
cDisplays.push_back(new CollectDisplay(new Chao1(), new ThreeColumnFile(fileNameRoot+"chao")));
+ }else if (globaldata->Estimators[i] == "nseqs") {
+ cDisplays.push_back(new CollectDisplay(new NSeqs(), new OneColumnFile(fileNameRoot+"nseqs")));
}else if (globaldata->Estimators[i] == "ace") {
- convert(globaldata->getAbund(), abund);
+ convert(globaldata->getAbund(), abund);
cDisplays.push_back(new CollectDisplay(new Ace(abund), new ThreeColumnFile(fileNameRoot+"ace")));
}else if (globaldata->Estimators[i] == "jack") {
cDisplays.push_back(new CollectDisplay(new Jackknife(), new ThreeColumnFile(fileNameRoot+"jack")));
#include "sharedsorest.h"
#include "sharedthetayc.h"
#include "sharedthetan.h"
+#include "sharednseqs.h"
//**********************************************************************************************************************
cDisplays.push_back(new CollectDisplay(new SharedThetaYC(), new SharedOneColumnFile(fileNameRoot+"shared.thetayc")));
}else if (globaldata->Estimators[i] == "sharedthetan") {
cDisplays.push_back(new CollectDisplay(new SharedThetaN(), new SharedOneColumnFile(fileNameRoot+"shared.thetan")));
+ }else if (globaldata->Estimators[i] == "sharednseqs") {
+ cDisplays.push_back(new CollectDisplay(new SharedNSeqs(), new SharedOneColumnFile(fileNameRoot+"shared.nseqs")));
}
+
}
}
void FullMatrix::getMinsForRowsVectors(){
try{
numGroups = globaldata->gGroupmap->namesOfGroups.size();
- numUserGroups = globaldata->Groups.size();
//sort globaldata->gGroupmap.namesOfGroups so that it will match the matrix
sort(globaldata->gGroupmap->namesOfGroups.begin(), globaldata->gGroupmap->namesOfGroups.end());
/*************************************************/
//find where in matrix each group starts and stops
/*************************************************/
- vector<int> bounds; //bounds[0] = 0, bounds[1] = starting row in matrix from group B, bounds[2] = starting row in matrix from group C, bounds[3] = no need to find C because its numSeqs.
+ vector<int> bounds; //bounds[1] = starting row in matrix from group B, bounds[2] = starting row in matrix from group C, bounds[3] = no need to find upper bound of C because its numSeqs.
bounds.resize(numGroups);
- bounds[numGroups] = numSeqs;
+ bounds[0] = 0;
+ bounds[numGroups] = numSeqs-1;
//for each group find bounds of subgroup/comparison
- for (int i = 0; i < numGroups; i++) {
+ for (int i = 1; i < numGroups; i++) {
getBounds(bounds[i], globaldata->gGroupmap->namesOfGroups[i]);
}
/************************************************************/
//fill the minsForRows vectors for each group the user wants
/************************************************************/
- int countx = bounds[0]; //where second group starts
- int county = bounds[0];
+ int countx = bounds[1]; //where second group starts
+ int county = bounds[1];
//go through the entire matrix
for (int x = 0; x < numSeqs; x++) {
for (int y = 0; y < numSeqs; y++) {
//if have not changed groups
if ((x < countx) && (y < county)) {
- if (inUsersGroups(index[x].groupname, globaldata->Groups)) {
- }
+
}
}
}
--- /dev/null
+#ifndef NSEQS_H
+#define NSEQS_H
+
+/*
+ * nseqs.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 3/16/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+
+class NSeqs : public Calculator {
+
+public:
+ NSeqs() : Calculator("NSeqs", 1) {};
+ EstOutput getValues(SAbundVector* rank){
+ data.resize(1,0);
+ data[0] = (double)rank->getNumSeqs();
+ return data;
+ }
+ EstOutput getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2) {return data;};
+};
+
+/***********************************************************************/
+
+#endif
for (int i = 0; i< T.size(); i++) {
for(int a = 0; a < numComp; a++) {
if (UScoreSig[a][i] > (1/(float)iters)) {
- outSum << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
- cout << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
+ outSum << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
+ cout << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
}else {
outSum << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << "<" << (1/float(iters)) << endl;
cout << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << "<" << (1/float(iters)) << endl;
#include "rarefactcommand.h"
#include "ace.h"
#include "sobs.h"
+#include "nseqs.h"
#include "chao1.h"
#include "bootstrap.h"
#include "simpson.h"
rDisplays.push_back(new RareDisplay(new Simpson(), new ThreeColumnFile(fileNameRoot+"r_simpson")));
}else if (globaldata->Estimators[i] == "bootstrap") {
rDisplays.push_back(new RareDisplay(new Bootstrap(), new ThreeColumnFile(fileNameRoot+"r_bootstrap")));
+ }else if (globaldata->Estimators[i] == "nseqs") {
+ rDisplays.push_back(new RareDisplay(new NSeqs(), new ThreeColumnFile(fileNameRoot+"r_nseqs")));
}
}
}
#include "rarefactsharedcommand.h"
#include "sharedsobs.h"
+#include "sharednseqs.h"
//**********************************************************************************************************************
if (validCalculator->isValidCalculator("sharedrarefaction", globaldata->Estimators[i]) == true) {
if (globaldata->Estimators[i] == "sharedobserved") {
rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"shared.rarefaction", "")));
+ }else if (globaldata->Estimators[i] == "sharednseqs") {
+ rDisplays.push_back(new RareDisplay(new SharedNSeqs(), new SharedThreeColumnFile(fileNameRoot+"shared.r_nseqs", "")));
}
+
}
}
--- /dev/null
+#ifndef SHAREDNSEQS_H
+#define SHAREDNSEQS_H
+
+/*
+ * sharednseqs.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 3/16/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+
+
+
+#include "calculator.h"
+
+/***********************************************************************/
+class SharedNSeqs : public Calculator {
+
+public:
+ SharedNSeqs() : Calculator("SharedNSeqs", 1) {};
+ EstOutput getValues(SAbundVector* rank){ return data; };
+ EstOutput getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2) {
+ data.resize(1,0);
+ data[0] = (double)shared1->getNumSeqs() + (double)shared2->getNumSeqs();
+ return data;
+ }
+};
+
+/***********************************************************************/
+
+#endif
#include "summarycommand.h"
#include "ace.h"
#include "sobs.h"
+#include "nseqs.h"
#include "chao1.h"
#include "bootstrap.h"
#include "simpson.h"
sumCalculators.push_back(new Simpson());
}else if(globaldata->Estimators[i] == "bootstrap"){
sumCalculators.push_back(new Bootstrap());
+ }else if (globaldata->Estimators[i] == "nseqs") {
+ sumCalculators.push_back(new NSeqs());
}
}
}
#include "sharedsobscollectsummary.h"
#include "sharedchao1.h"
#include "sharedace.h"
+#include "sharednseqs.h"
#include "sharedjabund.h"
#include "sharedsorabund.h"
#include "sharedjclass.h"
sumCalculators.push_back(new SharedThetaYC());
}else if (globaldata->Estimators[i] == "sharedthetan") {
sumCalculators.push_back(new SharedThetaN());
+ }else if (globaldata->Estimators[i] == "sharednseqs") {
+ sumCalculators.push_back(new SharedNSeqs());
}
}
}
int n = 1;
for (int k = 0; k < (lookup.size() - 1); k++) { // pass cdd each set of groups to commpare
for (int l = n; l < lookup.size(); l++) {
- outputFileHandle << order->getLabel() << '\t' << (lookup[k]->getGroup() + lookup[l]->getGroup()) << '\t' << '\t'; //print out label and group
+ outputFileHandle << order->getLabel() << '\t';
+
+ //sort groups to be alphanumeric
+ if (lookup[k]->getGroup() > lookup[l]->getGroup()) {
+ outputFileHandle << (lookup[l]->getGroup() +'\t' + lookup[k]->getGroup()) << '\t'; //print out groups
+ }else{
+ outputFileHandle << (lookup[k]->getGroup() +'\t' + lookup[l]->getGroup()) << '\t'; //print out groups
+ }
+
for(int i=0;i<sumCalculators.size();i++){
sumCalculators[i]->getValues(lookup[k], lookup[l]); //saves the calculator outputs
outputFileHandle << '\t';
for(int a = 0; a < numComp; a++) {
if (UWScoreSig[a][0] > (1/(float)iters)) {
- outSum << setprecision(6) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl;
- cout << setprecision(6) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl;
+ outSum << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl;
+ cout << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl;
}else {
- outSum << setprecision(6) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
- cout << setprecision(6) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
+ outSum << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
+ cout << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
}
}
for (int i = 0; i < T.size(); i++) {
for (int j = 0; j < numComp; j++) {
if (WScoreSig[count] > (1/(float)iters)) {
- outSum << setprecision(6) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
- cout << setprecision(6) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
+ outSum << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
+ cout << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << WScoreSig[count] << endl;
}else{
outSum << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
cout << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
void ValidCalculators::initialSingle() {
try {
- single["sobs"] = "sobs";
+ single["sobs"] = "sobs";
single["chao"] = "chao";
single["ace"] = "ace";
single["jack"] = "jack";
single["simpson"] = "simpson";
single["bootstrap"] = "bootstrap";
single["default"] = "default";
+ single["nseqs"] = "nseqs";
}
catch(exception& e) {
cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
shared["sharedsorest"] = "sharedsorest";
shared["sharedthetayc"] = "sharedthetayc";
shared["sharedthetan"] = "sharedthetan";
+ shared["sharednseqs"] = "sharednseqs";
shared["default"] = "default";
}
catch(exception& e) {
rarefaction["npshannon"] = "npshannon";
rarefaction["simpson"] = "simpson";
rarefaction["bootstrap"] = "bootstrap";
+ rarefaction["nseqs"] = "nseqs";
rarefaction["default"] = "default";
}
catch(exception& e) {
summary["npshannon"] = "npshannon";
summary["simpson"] = "simpson";
summary["bootstrap"] = "bootstrap";
+ summary["nseqs"] = "nseqs";
summary["default"] = "default";
}
catch(exception& e) {
sharedsummary["sharedsorest"] = "sharedsorest";
sharedsummary["sharedthetayc"] = "sharedthetayc";
sharedsummary["sharedthetan"] = "sharedthetan";
+ sharedsummary["sharednseqs"] = "sharednseqs";
sharedsummary["default"] = "default";
}
catch(exception& e) {
void ValidCalculators::initialSharedRarefact() {
try {
sharedrarefaction["sharedobserved"] = "sharedobserved";
+ sharedrarefaction["sharednseqs"] = "sharednseqs";
sharedrarefaction["default"] = "default";
}
catch(exception& e) {