struct lfs *lfsLoadAll(char *fileName) /* Load all lfs from a tab-separated file. * Dispose of this with lfsFreeList(). */ { struct lfs *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[11]; while (lineFileRow(lf, row)) { el = lfsLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; }
struct bed *convertLfsToBed (struct lineFile *lf) /* Read in lfs file contents. Convert to bed struct and store as a list */ { struct lfs *el = NULL; char *row[11]; struct bed *lfBedList = NULL; char *chrom, *name; unsigned int chromStart, chromEnd; int i; while (lineFileRow(lf, row)) { el = lfsLoad(row); if (el != NULL) /* add each linked feature to list */ lfBedList = addLfToList(el, lfBedList); } if (lfBedList == NULL) errAbort("Bed list is null.\n"); return lfBedList; }