bc20671bb19cc948bda2c36063601ac5edc4d514 angie Tue Feb 15 10:57:59 2011 -0800 Fixing bug found while playing w/hgTables for Code Review #2840(not caused by Brian's changes): BAM tracks can have separate BAM files per chromosome, in which case the db table has an extra column seqName, so bigWigFileName() won't return the correct fileName for those tracks. Share bigWigFileName's logic for detecting custom track or hub track, and use bamFile.h's bamFileNameFromTable() for database tables. diff --git src/hg/hgTables/hgTables.h src/hg/hgTables/hgTables.h index 705ba64..d7af6be 100644 --- src/hg/hgTables/hgTables.h +++ src/hg/hgTables/hgTables.h @@ -727,30 +727,34 @@ void doOutWigData(struct trackDb *track, char *table, struct sqlConnection *conn); /* Return wiggle data in variableStep format. */ void doSummaryStatsWiggle(struct sqlConnection *conn); /* Put up page showing summary stats for wiggle track. */ void wigShowFilter(struct sqlConnection *conn); /* print out wiggle data value filter */ /* ----------- BigWig business in bigWig.c -------------------- */ boolean isBigWigTable(char *table); /* Return TRUE if table is bedGraph in current database's trackDb. */ +char *bigFileNameFromCtOrHub(char *table, struct sqlConnection *conn); +/* If table is a custom track or hub track, return the bigDataUrl setting; + * otherwise return NULL. Do a freeMem on returned string when done. */ + char *bigWigFileName(char *table, struct sqlConnection *conn); /* Return file name associated with bigWig. This handles differences whether it's * a custom or built-in track. Do a freeMem on returned string when done. */ int bigWigOutRegion(char *table, struct sqlConnection *conn, struct region *region, int maxOut, enum wigOutputType wigOutType); /* Write out bigWig for region, doing intersecting and filtering as need be. */ void doSummaryStatsBigWig(struct sqlConnection *conn); /* Put up page showing summary stats for bigWig track. */ /* ----------- BigBed business in bigBed.c -------------------- */ boolean isBigBed(char *database, char *table, struct trackDb *parent, @@ -788,34 +792,30 @@ struct slName *asColNames(struct asObject *as); /* Get list of column names. */ struct sqlFieldType *sqlFieldTypesFromAs(struct asObject *as); /* Convert asObject to list of sqlFieldTypes */ /* BAM stuff from bam.c */ struct asObject *bamAsObj(); /* Return asObject describing fields of BAM */ boolean isBamTable(char *table); /* Return TRUE if table corresponds to a BAM file. */ -char *bamFileName(char *table, struct sqlConnection *conn); -/* Return file name associated with BAM. This handles differences whether it's - * a custom or built-in track. Do a freeMem on returned string when done. */ - struct slName *bamGetFields(char *table); /* Get fields of bam as simple name list. */ struct sqlFieldType *bamListFieldsAndTypes(); /* Get fields of bigBed as list of sqlFieldType. */ struct hTableInfo *bamToHti(char *table); /* Get standard fields of BAM into hti structure. */ void showSchemaBam(char *table); /* Show schema on bam. */ void bamTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f); /* Print out selected fields from BAM. If fields is NULL, then print out all fields. */