]> git.donarmstrong.com Git - mothur.git/blobdiff - metastats2.c
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / metastats2.c
index de2a9303e49491384b122cdef6529dacbcc4df5c..70edc3d63cda154b51bca2dcb8ee36b9413a97a9 100644 (file)
@@ -5,13 +5,13 @@
 
 int metastat_main (char* outputFileName, int numRows, int numCols, double threshold, int numPermutations, double** data, int secondGroupingStart){
        
-       int size,c=0,i=0,j=0,k,counter=0, bflag=0; 
+       int size,c=0,i=0,j=0,counter=0, bflag=0; 
        int B=numPermutations;
        int row = numRows;
        int col = numCols;
        int g = secondGroupingStart;
        double thresh=threshold;
-       double placeholder=0,min=0; 
+       double min=0; 
        
        char output[1024];
        strcpy(output, outputFileName);
@@ -24,7 +24,7 @@ int metastat_main (char* outputFileName, int numRows, int numCols, double thresh
        // Initialize the matrices
        size = row*col;
        double matrix[row][col];
-       double pmatrix[size],pmatrix2[size],permuted[size];  
+       double pmatrix[size],permuted[size];  
        double storage[row][9];
        
        for (i=0;i<row;i++){
@@ -86,7 +86,7 @@ int metastat_main (char* outputFileName, int numRows, int numCols, double thresh
                ratio[i]=total[i]/min;
        }
        
-       // Change matrix into an array as received by R for compatibility.
+       //Change matrix into an array as received by R for compatibility.
        
        c=0;
        for(i=0;i<col;i++){
@@ -187,11 +187,16 @@ int metastat_main (char* outputFileName, int numRows, int numCols, double thresh
                        prt=&prt1;
                        pre=&pre1;
                        
+                       //MothurFisher fishtere;
+                       //double mothurFex = fishtere.fexact(f11, f12, f21, f22);
+                       
                        fexact(nr,nc,data, ldtabl,expect,prc,emin,prt,pre,work);
                        
                        if (*pre>.999999999){
                                *pre=1;
                        }
+                       
+                       //printf("feaxt = %f\t%f\t%f\t%f\t%f\t%f\n", *expect, *pre, f11, f12, f21, f22);
                        storage[i][8] = *pre;
                        pvalues[i]=*pre;
                }
@@ -343,7 +348,7 @@ void testp(double *permuted_ttests,int *B,double *permuted,
                   *ps) {
        
        double Tvalues[*nr];
-       int a, b, n, i, j,k=0;
+       int a, b, n, j;
        
        a = *B;
        b = *nr;