struct mahoney *vgLoadMahoneyList(char *fileName) /* Load data from tab-separated file (not whitespace separated) */ { struct mahoney *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[MAHONEY_NUM_COLS]; while (lineFileNextRowTab(lf, row, ArraySize(row))) { el = mahoneyLoad(row); fixPrimers(el); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; }
struct mahoney *mahoneyLoadAllByChar(char *fileName, char chopper) /* Load all mahoney from a chopper separated file. * Dispose of this with mahoneyFreeList(). */ { struct mahoney *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[19]; while (lineFileNextCharRow(lf, chopper, row, ArraySize(row))) { el = mahoneyLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; }
struct mahoney *mahoneyLoadAll(char *fileName) /* Load all mahoney from a whitespace-separated file. * Dispose of this with mahoneyFreeList(). */ { struct mahoney *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[19]; while (lineFileRow(lf, row)) { el = mahoneyLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; }