X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=nseqs.h;h=c0f9549c87584bbf99e503388ff737c9f5343e8e;hp=42a1f57b57f59737d91d99d9546659c5730a5a2b;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=cdcf99b7760701e6869ca8e4e6e91c8e8c4ae186 diff --git a/nseqs.h b/nseqs.h index 42a1f57..c0f9549 100644 --- a/nseqs.h +++ b/nseqs.h @@ -25,7 +25,26 @@ public: data[0] = (double)rank->getNumSeqs(); return data; } - EstOutput getValues(vector) {return data;}; + + EstOutput getValues(vector shared) { //return number of sequences in the sharedotus + + int numGroups = shared.size(); + data.clear(); data.resize(numGroups,0); + + for (int i = 0; i < shared[0]->getNumBins(); i++) { + //get bin values and set sharedByAll + bool sharedByAll = true; + for (int j = 0; j < numGroups; j++) { + if (shared[j]->getAbundance(i) == 0) { sharedByAll = false; } + } + + //they are shared + if (sharedByAll == true) { for (int j = 0; j < numGroups; j++) { data[j] += shared[j]->getAbundance(i); } } + } + + return data; + } + string getCitation() { return "http://www.mothur.org/wiki/Nseqs"; } }; /***********************************************************************/