dab89c1682e091dfa3780ce95359ebea9f6b7d52 braney Thu May 18 09:49:17 2017 -0700 add licensing info to optimalLeaf library diff --git src/optimalLeaf/readFile.cc src/optimalLeaf/readFile.cc index dc68de6..c2839e3 100644 --- src/optimalLeaf/readFile.cc +++ src/optimalLeaf/readFile.cc @@ -1,199 +1,205 @@ +/* This code provided by Ziv Bar-Joseph with the explicit understanding that + * no licensing is required for it to be used in the UCSC Genome Browser + * as long as reference is made to this paper: + * https://www.ncbi.nlm.nih.gov/pubmed/12801867 + */ + //---------------------------------------------------- // 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