X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=metastats2.c;h=8f5ce39eb9d5523e10dee238abbf65ed8530cbbb;hb=5c076cc7d3842d8050694918948e023334c9839e;hp=3b801a0b110c5685fcc3a62f66ab3ad516a862d2;hpb=7bf581f8c46b08eb3bb40715dac94695edee4a67;p=mothur.git diff --git a/metastats2.c b/metastats2.c index 3b801a0..8f5ce39 100644 --- a/metastats2.c +++ b/metastats2.c @@ -1,6 +1,8 @@ #include "metastats.h" +//The following code has been modified using the original Metastats program from White, J.R., Nagarajan, N. & Pop, M. Statistical methods for detecting differentially abundant features in clinical metagenomic samples. PLoS Comput Biol 5, e1000352 (2009). + 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; @@ -20,17 +22,23 @@ 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 storage[row][9]; - - for (i=0;i.999999999){ @@ -195,11 +214,14 @@ int metastat_main (char* outputFileName, int numRows, int numCols, double thresh } } else{ - + testp(permuted_ttests, permutes, permuted,pmatrix, nc, nr, gvalue,tinitial,pvalues); // Checks to make sure the matrix isn't sparse. - double sparse[row], sparse2[row]; + double * sparse, * sparse2; + sparse = (double *) malloc(size*sizeof(double)); + sparse2 = (double *) malloc(size*sizeof(double)); + for(i=0;i