852fd481e68ca3d3feaf29e1da20e1b49304f9ce angie Fri Mar 14 10:03:48 2014 -0700 Fixing problem with hgVai code not recognizing a genePred whoseasObject was derived from sql field info. Unfortunately, when a sql field's type is longblob, we don't know whether its autoSql definition was a list (like exonStarts[exonCount]) or just an lstring. To play it safe, we call it an lstring which works fine for feeding data through the annoGrator system. However, when comparing a sql-derived asObj with lstring to the real autoSql-derived asObj, asCompareObjs will see different types for the same field and return false. So for the purposes of recognizing a genePred, we need to simply compare column names. diff --git src/inc/asParse.h src/inc/asParse.h index d87ab3b..140de20 100644 --- src/inc/asParse.h +++ src/inc/asParse.h @@ -123,30 +123,29 @@ struct asColumn *asColumnFind(struct asObject *as, char *name); /* Return column of given name from object, or NULL if not found. */ int asColumnFindIx(struct asColumn *list, char *name); /* Return index of first element of asColumn list that matches name. * Return -1 if not found. */ boolean asCompareObjs(char *name1, struct asObject *as1, char *name2, struct asObject *as2, int numColumnsToCheck, int *retNumColumnsSame, boolean abortOnDifference); /* Compare as-objects as1 and as2 making sure several important fields show they are the same name and type. * If difference found, print it to stderr. If abortOnDifference, errAbort. * Othewise, return TRUE if the objects columns match through the first numColumnsToCheck fields. * If retNumColumnsSame is not NULL, then it will be set to the number of contiguous matching columns. */ -INLINE boolean asObjectsMatchFirstN(struct asObject *as1, struct asObject *as2, int n) -/* Return TRUE if as1 has the same first n columns as as2. */ -{ -return asCompareObjs(as1->name, as1, as2->name, as2, n, NULL, FALSE); -} - INLINE boolean asObjectsMatch(struct asObject *as1, struct asObject *as2) { int colCount = slCount(as1->columnList); if (slCount(as2->columnList) != colCount) return FALSE; return asCompareObjs(as1->name, as1, as2->name, as2, colCount, NULL, FALSE); } +boolean asColumnNamesMatchFirstN(struct asObject *as1, struct asObject *as2, int n); +/* Compare only the column names of as1 and as2, not types because if an asObj has been + * created from sql type info, longblobs are cast to lstrings but in the proper autoSql + * might be lists instead (e.g. longblob in sql, uint exonStarts[exonCount] in autoSql. */ + #endif /* ASPARSE_H */