85bd10da37f403d155c4434d90edcd146e682948 braney Mon May 15 13:03:32 2017 -0700 add sorting to composite wiggles. diff --git src/optimalLeaf/readFile.cc src/optimalLeaf/readFile.cc new file mode 100644 index 0000000..dc68de6 --- /dev/null +++ src/optimalLeaf/readFile.cc @@ -0,0 +1,199 @@ +//---------------------------------------------------- +// readFile.hh +// reads the input file. +// ----------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include "readFile.hh" + +using namespace std; +const int MAXSIZE = 200000; +const float missing = 0.75; + +// reads the file and genrates the expression matrix and +// retrieves gene names and experiment names. +readFile::readFile(char *fileName,int orfL, int descL) { + FILE *from=fopen(fileName,"r"); + char findName[5]; + int isName=0; + int lineLen = orfL+descL+MAXSIZE; + char *buffer = new char[lineLen]; + char geneVal[MAXSIZE]; + char **lines,**temp; + int i, j, k,num, len,numT,place; + char *tok, *newtok; + int curLines = 100; // initial guess for number of genes + int nlines=0; // actual number of lines + int numMiss,removeGenes = 0; + int redI = 0; + lines = new char*[curLines]; + for(i=0;i (int)ceil(missing*expNum) || (numMiss + 1) == expNum) { // too many missing values + removeGenes++; + redI++; + } + } + for(i=0;i