54406b80d5d435970989acff7b22dd6146c6b411
braney
Sat Jan 22 15:24:59 2022 -0800
adding chrom alias support to big files
diff --git src/hg/hgc/bigBedClick.c src/hg/hgc/bigBedClick.c
index 6801098..c2d4f35 100644
--- src/hg/hgc/bigBedClick.c
+++ src/hg/hgc/bigBedClick.c
@@ -1,30 +1,31 @@
/* Handle details pages for wiggle tracks. */
/* Copyright (C) 2013 The Regents of the University of California
* See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
#include "common.h"
#include "wiggle.h"
#include "cart.h"
#include "hgc.h"
#include "hCommon.h"
#include "hgColors.h"
#include "bigBed.h"
#include "hui.h"
#include "subText.h"
#include "web.h"
+#include "chromAlias.h"
static void bigGenePredLinks(char *track, char *item)
/* output links to genePred driven sequence dumps */
{
printf("
Links to sequence:
\n");
printf("\n");
puts("- \n");
hgcAnchorSomewhere("htcTranslatedPredMRna", item, "translate", seqName);
printf("Translated Protein from genomic DNA\n");
puts("
\n");
puts("- \n");
hgcAnchorSomewhere("htcGeneMrna", item, track, seqName);
printf("Predicted mRNA \n");
puts("
\n");
@@ -349,31 +350,31 @@
off_t offset = atoll(offsetStr);
printCount += seekAndPrintTable(tdb, detailsUrl, offset, extraFields);
}
slPairFreeValsAndList(&detailsUrls);
return printCount;
}
static void bigBedClick(char *fileName, struct trackDb *tdb,
char *item, int start, int end, int bedSize)
/* Handle click in generic bigBed track. */
{
char *chrom = cartString(cart, "c");
/* Open BigWig file and get interval list. */
-struct bbiFile *bbi = bigBedFileOpen(fileName);
+struct bbiFile *bbi = bigBedFileOpenAlias(fileName, chromAliasGetHash(database));
struct lm *lm = lmInit(0);
int ivStart = start, ivEnd = end;
char *itemForUrl = item;
if (start == end)
{
// item is an insertion; expand the search range from 0 bases to 2 so we catch it:
ivStart = max(0, start-1);
ivEnd++;
}
struct bigBedInterval *bbList = bigBedIntervalQuery(bbi, chrom, ivStart, ivEnd, 0, lm);
/* Get bedSize if it's not already defined. */
if (bedSize == 0)
{
bedSize = bbi->definedFieldCount;