]> git.donarmstrong.com Git - mothur.git/blob - shen.cpp
sffinfo bug with flow grams right index when clipQualRight=0
[mothur.git] / shen.cpp
1 /*
2  *  shen.cpp
3  *  Mothur
4  *
5  *  Created by Thomas Ryabin on 5/18/09.
6  *  Copyright 2009Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "shen.h"
11 #include "ace.h"
12
13         
14 /***********************************************************************/       
15 EstOutput Shen::getValues(SAbundVector* rank){
16
17         try {
18                 
19                 data.resize(1,0);
20                 
21                 double n = (double)rank->getNumSeqs();
22                 double f1 = (double)rank->get(1);
23                 
24                 Ace* calc = new Ace(abund);
25                 EstOutput ace = calc->getValues(rank);
26                 
27                 double f0 = ace[0]-rank->getNumBins();
28                 
29                 data[0] = f0 * (1 - pow(1 - f1/n/f0, f));
30                 
31                 delete calc;
32                 
33                 return data;
34         }
35         catch(exception& e) {
36                 m->errorOut(e, "Shen", "getValues");
37                 exit(1);
38         }
39 }
40
41
42 /***********************************************************************/