6c6d58a7b4191872e89e195cb0c60893f7883ce4 angie Wed Apr 15 10:25:46 2020 -0700 When comparing column names (e.g. to determine if a data source is genePred or bigGenePred, ignore '_' prefix because that is sometimes prepended to bigBed field names in order to suppress hgc display. Needed for VAI to support wuhCor1 with custom ncbiGene.bb. diff --git src/lib/asParse.c src/lib/asParse.c index 7f38f4b..be68049 100644 --- src/lib/asParse.c +++ src/lib/asParse.c @@ -678,20 +678,27 @@ *retNumColumnsSame = checkCount; return (!differencesFound); } 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. */ { struct asColumn *col1 = as1->columnList, *col2 = as2->columnList; int checkCount = 0; for (col1 = as1->columnList, col2 = as2->columnList; col1 != NULL && col2 != NULL && checkCount < n; col1 = col1->next, col2 = col2->next, ++checkCount) { - if (!sameOk(col1->name, col2->name)) + char *name1 = col1->name; + char *name2 = col2->name; + // Ignore initial _ -- sometimes added to bigBed field names to suppress hgc display. + if (name1 && name1[0] == '_') + name1++; + if (name2 && name2[0] == '_') + name2++; + if (!sameOk(name1, name2)) return FALSE; } return TRUE; }