b622d147b7dbac52dbf3ba26928cd18e02d42bd8 braney Sat Feb 26 12:34:37 2022 -0800 add support for using a bigBed as the chromAlias file diff --git src/hg/hgc/togaClick.c src/hg/hgc/togaClick.c index db78aa9..62b7627 100644 --- src/hg/hgc/togaClick.c +++ src/hg/hgc/togaClick.c @@ -165,31 +165,31 @@ strcpy(suffix, empty); } else { // just start the string 11 characters upstream memmove(suffix, suffix + HLTOGA_BED_PREFIX_LEN, suff_len - HLTOGA_BED_PREFIX_LEN + 1); } } void doHillerLabTOGAGeneBig(char *database, struct trackDb *tdb, char *item, char *table_name) /* Put up TOGA Gene track info. */ { int start = cartInt(cart, "o"); int end = cartInt(cart, "t"); char *chrom = cartString(cart, "c"); char *fileName = bbiNameFromSettingOrTable(tdb, NULL, tdb->table); -struct bbiFile *bbi = bigBedFileOpenAlias(hReplaceGbdb(fileName), chromAliasChromToAliasHash(database)); +struct bbiFile *bbi = bigBedFileOpenAlias(hReplaceGbdb(fileName), chromAliasFindAliases); struct lm *lm = lmInit(0); struct bigBedInterval *bbList = bigBedIntervalQuery(bbi, chrom, start, end, 0, lm); struct bigBedInterval *bb; char *fields[bbi->fieldCount]; for (bb = bbList; bb != NULL; bb = bb->next) { if (!(bb->start == start && bb->end == end)) continue; // our names are unique char *name = cloneFirstWordByDelimiterNoSkip(bb->rest, '\t'); boolean match = (isEmpty(name) && isEmpty(item)) || sameOk(name, item); if (!match) continue; @@ -252,31 +252,31 @@ printf("<h4>Protein sequence</h4><BR>\n"); printf("<a data-toggle=\"collapse\" href=\"#collapseProt\">Show protein alignment</a>\n"); printf("<div id=\"collapseProt\" class=\"panel-collapse collapse\">\n"); printf("<TT>%s</TT><BR>\n", info->prot_alignment); printf("</div>\n<BR><BR>\n"); // show inactivating mutations if required printf("<h4>Inactivating mutations</h4><BR>\n"); printf("<a data-toggle=\"collapse\" href=\"#collapseMuts\">Show inactivating mutations</a>\n"); printf("<div id=\"collapseMuts\" class=\"panel-collapse collapse\">\n"); printf("<table border = \"1\" width = \"640\">\n"); // init table printf("<tr><th>exon</th><th>pos</th><th>m_class</th><th>mut</th><th>is_inact</th><th>mut_id</th>\n"); printf("</tr>\n"); fileName = trackDbSetting(tdb, "inactMutUrl"); -bbi = bigBedFileOpenAlias(hReplaceGbdb(fileName), chromAliasChromToAliasHash(database)); +bbi = bigBedFileOpenAlias(hReplaceGbdb(fileName), chromAliasFindAliases); //struct lm *lm = lmInit(0); bbList = bigBedIntervalQuery(bbi, chrom, start, end, 0, lm); for (bb = bbList; bb != NULL; bb = bb->next) { if (!(bb->start == start && bb->end == end)) continue; // our names are unique char *name = cloneFirstWordByDelimiterNoSkip(bb->rest, '\t'); boolean match = (isEmpty(name) && isEmpty(item)) || sameOk(name, item); if (!match) continue; char startBuf[16], endBuf[16]; bigBedIntervalToRow(bb, chrom, startBuf, endBuf, fields, bbi->fieldCount); @@ -295,31 +295,31 @@ printf("<td>%s</td>\n", info->mut_id); printf("</tr>\n"); togaInactMutFree(&info); } //sqlFreeResult(&sr); printf("</table>\n"); printf("</div>\n<BR>\n"); // show exons data htmlHorizontalLine(); printf("<h4>Exons data</h4><BR>\n"); printf("<a data-toggle=\"collapse\" href=\"#collapseExons\">Show exon sequences and features</a>\n"); printf("<div id=\"collapseExons\" class=\"panel-collapse collapse\">\n"); fileName = trackDbSetting(tdb, "nuclUrl"); -bbi = bigBedFileOpenAlias(hReplaceGbdb(fileName), chromAliasChromToAliasHash(database)); +bbi = bigBedFileOpenAlias(hReplaceGbdb(fileName), chromAliasFindAliases); //struct lm *lm = lmInit(0); bbList = bigBedIntervalQuery(bbi, chrom, start, end, 0, lm); for (bb = bbList; bb != NULL; bb = bb->next) { if (!(bb->start == start && bb->end == end)) continue; // our names are unique char *name = cloneFirstWordByDelimiterNoSkip(bb->rest, '\t'); boolean match = (isEmpty(name) && isEmpty(item)) || sameOk(name, item); if (!match) continue; char startBuf[16], endBuf[16]; bigBedIntervalToRow(bb, chrom, startBuf, endBuf, fields, bbi->fieldCount);