]> git.donarmstrong.com Git - mothur.git/blob - goodscoverage.cpp
changes while testing
[mothur.git] / goodscoverage.cpp
1 /*
2  *  goodscoverage.cpp
3  *  Mothur
4  *
5  *  Created by Thomas Ryabin on 4/8/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "goodscoverage.h"
11 #include "calculator.h"
12
13 /**********************************************************/
14
15 EstOutput GoodsCoverage::getValues(SAbundVector* rank){
16         try {
17                 data.resize(1,0);
18                 
19                 double numSingletons = rank->get(1);
20                 double totalIndividuals = rank->getNumSeqs();
21                 
22                 data[0] = 1 - numSingletons/totalIndividuals;
23                 
24                 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
25
26                 return data;
27         }
28         catch(exception& e) {
29                 m->errorOut(e, "GoodsCoverage", "getValues");
30                 exit(1);
31         }
32 }
33
34 /***********************************************************************/
35