]> git.donarmstrong.com Git - mothur.git/blob - strictchi2.cpp
9719aa8050c6c85415a0cc56ee886ae67d164a96
[mothur.git] / strictchi2.cpp
1 /*
2  *  strictchi2.cpp
3  *  Mothur
4  *
5  *  Created by westcott on 12/17/10.
6  *  Copyright 2010 Schloss Lab. All rights reserved.
7  *
8  */
9
10 #include "strictchi2.h"
11
12 /***********************************************************************/
13 EstOutput StrictChi2::getValues(vector<SharedRAbundVector*> shared) {
14         try {
15                 data.resize(1,0);
16                 
17                 double sumA = shared[0]->getNumSeqs();
18                 double sumB = shared[1]->getNumSeqs();
19                 double totalSum = 0.0;
20                 
21                 for (int i = 0; i < shared.size(); i++) { totalSum += shared[i]->getNumSeqs();  }
22                 
23                 vector<int> sumOtus; sumOtus.resize(shared[0]->getNumBins(), 0);
24                 //for each otu
25                 for (int i = 0; i < shared[0]->getNumBins(); i++) {
26                         //for each group
27                         for (int j = 0; j < shared.size(); j++) { 
28                                 
29                         }
30                 }
31                                 
32                 
33                                 
34                 //data[0] = sqrt(sum);
35                 
36                 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
37                 
38                 return data;
39         }
40         catch(exception& e) {
41                 m->errorOut(e, "StrictChi2", "getValues");
42                 exit(1);
43         }
44 }
45 /***********************************************************************/