370394fc362cce1b14f32e1a9d548fd5654063a0 markd Tue Aug 23 09:59:15 2016 -0700 Account for bin column when loading estOrientInfo data. Add function to read selected PSLs from a table into memory. diff --git src/hg/lib/estOrientInfo.c src/hg/lib/estOrientInfo.c index 17e5cb5..b6edf03 100644 --- src/hg/lib/estOrientInfo.c +++ src/hg/lib/estOrientInfo.c @@ -105,33 +105,34 @@ struct estOrientInfo *estOrientInfoLoadWhere(struct sqlConnection *conn, char *table, char *where) /* Load all estOrientInfo from table that satisfy where clause. The * where clause may be NULL in which case whole table is loaded * Dispose of this with estOrientInfoFreeList(). */ { struct estOrientInfo *list = NULL, *el; struct dyString *query = dyStringNew(256); struct sqlResult *sr; char **row; sqlDyStringPrintf(query, "select * from %s", table); if (where != NULL) dyStringPrintf(query, " where %s", where); sr = sqlGetResult(conn, query->string); +int off = sqlFieldColumn(sr, "bin") + 1; // offset of data while ((row = sqlNextRow(sr)) != NULL) { - el = estOrientInfoLoad(row); + el = estOrientInfoLoad(row+off); slAddHead(&list, el); } slReverse(&list); sqlFreeResult(&sr); dyStringFree(&query); return list; } struct estOrientInfo *estOrientInfoCommaIn(char **pS, struct estOrientInfo *ret) /* Create a estOrientInfo out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new estOrientInfo */ { char *s = *pS;