916b1db3c50ed46600f8c13acb742cb9dd205f6d
braney
Fri May 27 17:11:10 2016 -0700
support connections to other chroms in longRange display. Also,
longTabix in trackHubs
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 2b6e044..1ab0f38 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -3911,31 +3911,30 @@
static void genericContainerClick(struct sqlConnection *conn, char *containerType,
struct trackDb *tdb, char *item, char *itemForUrl)
/* Print page for container of some sort. */
{
if (sameString(containerType, "multiWig"))
{
errAbort("It's suprising that multiWig container gets to hgc. It should go to hgTrackUi.");
}
else
{
errAbort("Unrecognized container type %s for %s", containerType, tdb->track);
}
}
-
static void doLongTabix(struct trackDb *tdb, char *item)
/* Handle a click on a long range interaction */
{
char *bigDataUrl = hashFindVal(tdb->settingsHash, "bigDataUrl");
struct bedTabixFile *btf = bedTabixFileMayOpen(bigDataUrl, NULL, 0, 0);
char *chromName = cartString(cart, "c");
struct bed *list = bedTabixReadBeds(btf, chromName, winStart, winEnd, bedLoad5);
bedTabixFileClose(btf);
unsigned maxWidth;
struct longRange *longRangeList = parseLongTabix(list, &maxWidth, 0);
struct longRange *longRange, *ourLongRange = NULL;
unsigned itemNum = sqlUnsigned(item);
unsigned count = slCount(longRangeList);
double *doubleArray;
@@ -3955,30 +3954,34 @@
errAbort("cannot find long range item with id %d\n", itemNum);
struct aveStats *as = aveStatsCalc(doubleArray, count);
printf("Item you clicked on:
\n");
printf("Score: %g
\n", ourLongRange->score);
printf("ID: %u
\n", ourLongRange->id);
unsigned padding = (ourLongRange->e - ourLongRange->s) / 10;
int s = ourLongRange->s - padding;
int e = ourLongRange->e + padding;
if (s < 0 )
s = 0;
int chromSize = hChromSize(database, seqName);
if (e > chromSize)
e = chromSize;
+if (differentString(ourLongRange->sChrom, ourLongRange->eChrom))
+ printf("Link to range covered by interaction.
\n",
+ ourLongRange->sChrom, ourLongRange->s - 20, ourLongRange->s + 20);
+else
printf("Link to range covered by interaction.
\n",
ourLongRange->sChrom, s, e);
printf("
Statistics on the scores of all items in window (go to track controls to set minimum score to display):\n");
printf("
Q1 | %f |
median | %f |
Q3 | %f |
average | %f |
min | %f |
max | %f |
count | %d |
total | %f |
standard deviation | %f |