07769f5e62216c125dc90df08dac7a90402c3fa4 markd Mon Jun 22 12:54:40 2015 -0700 add geneId to transmap gene table, with backwards compatibilty for current transmap tracks (RM 14574) diff --git src/hg/lib/transMapInfo.c src/hg/lib/transMapInfo.c index 5f90214..e08c302 100644 --- src/hg/lib/transMapInfo.c +++ src/hg/lib/transMapInfo.c @@ -1,28 +1,29 @@ /* transMapInfo.c was originally generated by the autoSql program, which also * generated transMapInfo.h and transMapInfo.sql. This module links the database and * the RAM representation of objects. */ /* Copyright (C) 2014 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "linefile.h" #include "dystring.h" #include "jksql.h" #include "transMapInfo.h" +char *transMapInfoCommaSepFieldNames = "mappedId,srcDb,srcId,mappingId,chainSubset"; /* definitions for chainSubset column */ static char *values_chainSubset[] = {"unknown", "all", "syn", "rbest", NULL}; static struct hash *valhash_chainSubset = NULL; void transMapInfoStaticLoad(char **row, struct transMapInfo *ret) /* Load a row from transMapInfo table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->mappedId = row[0]; safecpy(ret->srcDb, sizeof(ret->srcDb), row[1]); ret->srcId = row[2]; ret->mappingId = row[3]; ret->chainSubset = sqlEnumParse(row[4], values_chainSubset, &valhash_chainSubset); @@ -145,18 +146,18 @@ if (sep == ',') fputc('"',f); sqlEnumPrint(f, el->chainSubset, values_chainSubset); if (sep == ',') fputc('"',f); fputc(lastSep,f); } /* -------------------------------- End autoSql Generated Code -------------------------------- */ struct transMapInfo *transMapInfoQuery(struct sqlConnection *conn, char *table, char *mappedId) /* load a single transMapInfo object for an mapped id from a table, * or error if not found */ { return sqlQueryObjs(conn, (sqlLoadFunc)transMapInfoLoad, sqlQueryMust|sqlQuerySingle, - "SELECT * FROM %s WHERE mappedId = \"%s\"", - table, mappedId); + "SELECT %-s FROM %s WHERE mappedId = \"%s\"", + transMapInfoCommaSepFieldNames, table, mappedId); }