54406b80d5d435970989acff7b22dd6146c6b411 braney Sat Jan 22 15:24:59 2022 -0800 adding chrom alias support to big files diff --git src/hg/hgc/bigRmskClick.c src/hg/hgc/bigRmskClick.c index 54de723..c3f2162 100644 --- src/hg/hgc/bigRmskClick.c +++ src/hg/hgc/bigRmskClick.c @@ -1,29 +1,30 @@ /* bigRmskClick - Click handler for bigRmskTrack. This is based * loosely on the original rmsk click handler inside * of hgc.c. * * Written by Robert Hubley 10/2021 */ /* Copyright (C) 2021 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "hgc.h" #include "rmskAlign.h" #include "hCommon.h" +#include "chromAlias.h" void printAlignmentBR (struct rmskAlign *ra) /* * Print RepeatMasker alignment data stored in RM's cAlign format. * The format is basically a lightly compressed diff format where * the query and subject are merged into one squence line. The * runs of exact matching sequences are interrupted by either * single base substitutions annotated as queryBase "/" subjectBase, * insertions in the subject annotated as "+ACTAT+", or deletions * in the query annotated as "-ACTTTG-". */ { int alignLength = 80; char querySeq[alignLength + 1]; @@ -195,31 +196,31 @@ printf (" \n"); printf (" \n"); } void doBigRmskRepeat (struct trackDb *tdb, char *item) /* Main entry point */ { cartWebStart (cart, database, "%s", tdb->longLabel); char *chrom = cartString(cart, "c"); int start = cartInt(cart, "o"); int end = cartInt(cart, "t"); char *fileName = trackDbSetting(tdb, "bigDataUrl"); /* Open BigWig file and get interval list. */ -struct bbiFile *bbi = bigBedFileOpen(fileName); +struct bbiFile *bbi = bigBedFileOpenAlias(fileName, chromAliasGetHash(database)); struct lm *lm = lmInit(0); struct bigBedInterval *bbList = bigBedIntervalQuery(bbi, chrom, start, end, 0, lm); /* Find particular item in list - matching start, and item if possible. */ boolean found = FALSE; struct bigBedInterval *bb; const char *data_style = "style=\"padding:0px 6px;\""; int bedSize = bbi->fieldCount; char *fields[bedSize]; char startBuf[16], endBuf[16]; for (bb = bbList; bb != NULL; bb = bb->next) { bigBedIntervalToRow(bb, chrom, startBuf, endBuf, fields, bedSize); if ( sameOk(fields[12], item) )