549dcd456f5d557e15426176e487f91246363548 kate Mon Apr 10 17:21:22 2017 -0700 Better integration with bigBed cod. Fixes loading problem and allows labelFields code to operate (not yet tested). refs #18736 diff --git src/hg/inc/barChartBed.h src/hg/inc/barChartBed.h index ffde0f5..24a8a6d 100644 --- src/hg/inc/barChartBed.h +++ src/hg/inc/barChartBed.h @@ -1,29 +1,27 @@ /* barChartBed.h was originally generated by the autoSql program, which also * generated barChartBed.c and barChartBed.sql. This header links the database and * the RAM representation of objects. */ #ifndef BARCHARTBED_H #define BARCHARTBED_H #include "jksql.h" #define BARCHARTBED_NUM_COLS 8 extern char *barChartBedCommaSepFieldNames; -// TODO: add fields for description and unique identifier/name - struct barChartBed /* BED6+ with additional fields for category count and values */ { struct barChartBed *next; /* Next in singly linked list. */ char *chrom; /* Reference sequence chromosome or scaffold */ unsigned chromStart; /* Start position in chromosome */ unsigned chromEnd; /* End position in chromosome */ char *name; /* Item identifier */ unsigned score; /* Score from 0-1000; derived from total median all categories (log-transformed and scaled) */ char strand[2]; /* + or - for strand */ unsigned expCount; /* Number of categories */ float *expScores; /* Comma separated list of category values */ }; struct barChartBed *barChartBedLoadByQuery(struct sqlConnection *conn, char *query); @@ -70,23 +68,28 @@ void barChartBedOutput(struct barChartBed *el, FILE *f, char sep, char lastSep); /* Print out barChartBed. Separate fields with sep. Follow last field with lastSep. */ #define barChartBedTabOut(el,f) barChartBedOutput(el,f,'\t','\n'); /* Print out barChartBed as a line in a tab-separated file. */ #define barChartBedCommaOut(el,f) barChartBedOutput(el,f,',',','); /* Print out barChartBed as a comma separated list including final comma. */ /* -------------------------------- End autoSql Generated Code -------------------------------- */ void barChartBedCreateTable(struct sqlConnection *conn, char *table); /* Create barChart format table of given name. */ -float barChartTotalValue(struct barChartBed *bed); +struct bed *barChartSimpleBedLoad(char **row); +/* Load a bed from row containing barChart bed fields. + * This is reuses autoSql barChartBedLoad, but with a full-size bed. + Dispose of this with bedFree() */ + +float barChartTotalValue(struct bed *bed); /* Return total of all category values */ -float barChartHighestValue(struct barChartBed *bed, int *categIdRet); +float barChartMaxValue(struct bed *bed, int *categIdRet); /* Return value and id of category with highest value for this item */ #endif /* BARCHARTBED_H */