]> git.donarmstrong.com Git - mothur.git/blob - sharedsorabund.cpp
working on pam
[mothur.git] / sharedsorabund.cpp
1 /*
2  *  sharedsorabund.cpp
3  *  Dotur
4  *
5  *  Created by Sarah Westcott on 1/8/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "sharedsorabund.h"
11
12 /***********************************************************************/
13
14 EstOutput SorAbund::getValues(vector<SharedRAbundVector*> shared) {
15         try {
16                 EstOutput UVest;
17                 UVest.resize(2,0);
18                 data.resize(1,0);
19                 
20                 UVest = uv->getUVest(shared);
21                 
22                 //UVest[0] is Uest, UVest[1] is Vest
23                 data[0] = (2 * UVest[0] * UVest[1]) / ((float)(UVest[0] + UVest[1]));
24                 
25                 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
26                 data[0] = 1-data[0];
27                 
28                 return data;
29         }
30         catch(exception& e) {
31                 m->errorOut(e, "SorAbund", "getValues");
32                 exit(1);
33         }
34 }
35
36 /***********************************************************************/
37