54406b80d5d435970989acff7b22dd6146c6b411 braney Sat Jan 22 15:24:59 2022 -0800 adding chrom alias support to big files diff --git src/hg/hgc/barChartClick.c src/hg/hgc/barChartClick.c index cc58811..e592638 100644 --- src/hg/hgc/barChartClick.c +++ src/hg/hgc/barChartClick.c @@ -13,51 +13,52 @@ #include "asParse.h" #include "hgc.h" #include "trackHub.h" #include "memgfx.h" #include "hgColors.h" #include "fieldedTable.h" #include "barChartBed.h" #include "barChartCategory.h" #include "barChartData.h" #include "barChartSample.h" #include "barChartUi.h" #include "hgConfig.h" #include "facetedBar.h" #include "pipeline.h" +#include "chromAlias.h" #define EXTRA_FIELDS_SIZE 256 struct barChartItemData /* Measured value for a sample and the sample category at a locus. * Used for barChart track details (boxplot) */ { struct barChartItemData *next; /* Next in singly linked list. */ char *sample; /* Sample identifier */ char *category; /* Sample category (from barChartSample table or barChartSampleUrl file) */ double value; /* Measured value (e.g. expression level) */ }; static struct barChartBed *getBarChartFromFile(struct trackDb *tdb, char *file, char *item, char *chrom, int start, int end, struct asObject **retAs, char **extraFieldsRet, int *extraFieldsCountRet) /* Retrieve barChart BED item from big file */ { boolean hasOffsets = TRUE; -struct bbiFile *bbi = bigBedFileOpen(file); +struct bbiFile *bbi = bigBedFileOpenAlias(file, chromAliasGetHash(database)); struct asObject *as = bigBedAsOrDefault(bbi); if (retAs != NULL) *retAs = as; hasOffsets = ( asColumnFind(as, BARCHART_OFFSET_COLUMN) != NULL && asColumnFind(as, BARCHART_LEN_COLUMN) != NULL); struct lm *lm = lmInit(0); struct bigBedInterval *bb, *bbList = bigBedIntervalQuery(bbi, chrom, start, end, 0, lm); for (bb = bbList; bb != NULL; bb = bb->next) { char *rest = cloneString(bb->rest); char startBuf[16], endBuf[16]; char *row[32]; bigBedIntervalToRow(bb, chrom, startBuf, endBuf, row, ArraySize(row)); struct barChartBed *barChart = barChartBedLoadOptionalOffsets(row, hasOffsets);