]> git.donarmstrong.com Git - mothur.git/blob - manhattan.cpp
changed random forest output filename
[mothur.git] / manhattan.cpp
1 /*
2  *  manhattan.cpp
3  *  Mothur
4  *
5  *  Created by westcott on 12/15/10.
6  *  Copyright 2010 Schloss Lab. All rights reserved.
7  *
8  */
9
10 #include "manhattan.h"
11
12 /***********************************************************************/
13 EstOutput Manhattan::getValues(vector<SharedRAbundVector*> shared) {
14         try {
15                 data.resize(1,0);
16                 
17                 double sum = 0.0;
18                 
19                 for (int i = 0; i < shared[0]->getNumBins(); i++) { 
20                         
21                         int Aij = shared[0]->getAbundance(i);
22                         int Bij = shared[1]->getAbundance(i);
23                         
24                         sum += abs((Aij - Bij));
25                 }
26                 
27                 data[0] = sum;
28                 
29                 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
30                 
31                 return data;
32         }
33         catch(exception& e) {
34                 m->errorOut(e, "Manhattan", "getValues");
35                 exit(1);
36         }
37 }
38 /***********************************************************************/