4c9ae67ea6e03ec3069cea012398793046e9ff2a giardine Tue Sep 21 15:00:29 2010 -0700 Adds new track type bedDetail to custom and resident tracks, also adds pgSnp (personal genome SNPs) as custom track type. bedDetail is bed4 to bed12, with 2 extra fields for an ID and description for hgc clicks. diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c index 35cb1dc..6b566f0 100644 --- src/hg/hgTables/schema.c +++ src/hg/hgTables/schema.c @@ -21,6 +21,8 @@ #include "hgTables.h" #include "wikiTrack.h" #include "makeItemsItem.h" +#include "bedDetail.h" +#include "pgSnp.h" static char const rcsid[] = "$Id: schema.c,v 1.66 2010/06/07 16:53:10 angie Exp $"; @@ -552,6 +554,52 @@ hFreeConn(&conn); } +static void showSchemaBedDetail(char *db, char *trackId, struct customTrack *ct) +/* Show schema on bedDetail format custom track. */ +{ +struct asObject *asObj = asParseText(bedDetailAutoSqlString); +struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH); +char *table = ct->dbTableName; + +hPrintf("Genome Database: %s ", db); +hPrintf("Track ID: %s ", trackId); +hPrintf("MySQL table: %s", table); +hPrintf("    Row Count: "); +printLongWithCommas(stdout, sqlTableSize(conn, table)); +hPrintf("
\n"); +if (asObj != NULL) + hPrintf("Format description: %s
", asObj->comment); +describeFields(CUSTOM_TRASH, table, asObj, conn); + +webNewSection("Sample Rows"); +printSampleRows(10, conn, ct->dbTableName); +printTrackHtml(ct->tdb); +hFreeConn(&conn); +} + +static void showSchemaPgSnp(char *db, char *trackId, struct customTrack *ct) +/* Show schema on pgSnp format custom track. */ +{ +struct asObject *asObj = asParseText(pgSnpAutoSqlString); +struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH); +char *table = ct->dbTableName; + +hPrintf("Genome Database: %s ", db); +hPrintf("Track ID: %s ", trackId); +hPrintf("MySQL table: %s", table); +hPrintf("    Row Count: "); +printLongWithCommas(stdout, sqlTableSize(conn, table)); +hPrintf("
\n"); +if (asObj != NULL) + hPrintf("Format description: %s
", asObj->comment); +describeFields(CUSTOM_TRASH, table, asObj, conn); + +webNewSection("Sample Rows"); +printSampleRows(10, conn, ct->dbTableName); +printTrackHtml(ct->tdb); +hFreeConn(&conn); +} + static void showSchemaCt(char *db, char *table) /* Show schema on custom track. */ { @@ -569,6 +617,10 @@ showSchemaCtArray(table, ct); else if (startsWithWord("makeItems", type)) showSchemaMakeItems(db, table, ct); +else if (sameWord("bedDetail", type)) + showSchemaBedDetail(db, table, ct); +else if (sameWord("pgSnp", type)) + showSchemaPgSnp(db, table, ct); else errAbort("Unrecognized customTrack type %s", type); }