0b52ad3ec2c6113bfdd692a58fee812b7dd0a7b2
kent
  Fri Feb 4 20:47:27 2011 -0800
Getting Table Browser to handle BAM files.  This is ready for testing by folks other than me now. Should work for both built-in BAM files and BAM files from track data hubs. I've tested it more though via the hubs. Works mostly by converting bam->sam->array-of-strings and then slotting into the same code bigBed processing uses.
diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c
index 3fee71b..de822c8 100644
--- src/hg/hgTables/schema.c
+++ src/hg/hgTables/schema.c
@@ -585,44 +585,48 @@
 else if (sameWord("pgSnp", type))
     showSchemaWithAutoSqlString(db, table, ct, pgSnpAutoSqlString);
 else
     errAbort("Unrecognized customTrack type %s", type);
 }
 
 static void showSchemaHub(char *db, char *table)
 /* Show schema on a hub track. */
 {
 struct trackDb *tdb = hashMustFindVal(fullTrackAndSubtrackHash, table);
 char *type = cloneFirstWord(tdb->type);
 hPrintf("Binary file of type %s stored at %s<BR>\n",
 	type, trackDbSetting(tdb, "bigDataUrl"));
 if (sameString(type, "bigBed"))
     showSchemaBigBed(table);
+else if (sameString(type, "bam"))
+    showSchemaBam(table);
 }
 
 static void showSchemaWiki(struct trackDb *tdb, char *table)
 /* Show schema for the wikiTrack. */
 {
 hPrintf("<B>User annotations to UCSC genes or genome regions</B><BR>\n");
 showSchemaDb(wikiDbName(), tdb, table);
 }
 
 static void showSchema(char *db, struct trackDb *tdb, char *table)
 /* Show schema to open html page. */
 {
 if (isBigBed(database, table, curTrack, ctLookupName))
     showSchemaBigBed(table);
+else if (isBamTable(table))
+    showSchemaBam(table);
 else if (isCustomTrack(table))
     showSchemaCt(db, table);
 else if (isHubTrack(table))
     showSchemaHub(db, table);
 else if (sameWord(table, WIKI_TRACK_TABLE))
     showSchemaWiki(tdb, table);
 else
     showSchemaDb(db, tdb, table);
 }
 
 void doTableSchema(char *db, char *table, struct sqlConnection *conn)
 /* Show schema around table (which is not described by curTrack). */
 {
 struct trackDb *tdb = NULL;
 char parseBuf[256];