X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=nseqs.h;fp=nseqs.h;h=c011f10ca0980b0461f6f77d27061835da43949a;hb=1d7a10dc3dafd1606d6255bdb54e02429cbee47c;hp=42a1f57b57f59737d91d99d9546659c5730a5a2b;hpb=cea46f0830d8d1a6dc26e3410fc283d26c355831;p=mothur.git diff --git a/nseqs.h b/nseqs.h index 42a1f57..c011f10 100644 --- a/nseqs.h +++ b/nseqs.h @@ -25,7 +25,25 @@ 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]->size(); 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; + } }; /***********************************************************************/