8 * Created by Sarah Westcott on 3/16/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
15 #include "calculator.h"
17 /***********************************************************************/
19 class NSeqs : public Calculator {
22 NSeqs() : Calculator("nseqs", 1, false) {};
23 EstOutput getValues(SAbundVector* rank){
25 data[0] = (double)rank->getNumSeqs();
29 EstOutput getValues(vector<SharedRAbundVector*> shared) { //return number of sequences in the sharedotus
31 int numGroups = shared.size();
32 data.clear(); data.resize(numGroups,0);
34 for (int i = 0; i < shared[0]->getNumBins(); i++) {
35 //get bin values and set sharedByAll
36 bool sharedByAll = true;
37 for (int j = 0; j < numGroups; j++) {
38 if (shared[j]->getAbundance(i) == 0) { sharedByAll = false; }
42 if (sharedByAll == true) { for (int j = 0; j < numGroups; j++) { data[j] += shared[j]->getAbundance(i); } }
47 string getCitation() { return "http://www.mothur.org/wiki/Nseqs"; }
50 /***********************************************************************/