#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;
// Initialize the matrices
size = row*col;
+//printf("size = %d\n.", size);
double matrix[row][col];
double pmatrix[size],pmatrix2[size],permuted[size];
double storage[row][9];
-
+//printf("here\n.", size);
for (i=0;i<row;i++){
for (j =0;j<9;j++){
storage[i][j]=0;
if (! seeded) {
seeded = 1;
- srandom(time(NULL));
+ srand(time(NULL));
}
for (i = 0; i < n; i++) {
- int selection = random() % (n - i);
+ int selection = rand() % (n - i);
int tmp = array[i + selection];
array[i + selection] = array[i];
array[i] = tmp;