e408d52de2f812c4dc407b1865c97c45090dcf16 chmalee Mon Oct 11 16:40:46 2021 -0700 Renaming the trackDb settings extraDetailsTable and extraTableFields to the more descriptive and more accurate detailsStaticTable and detailsDynamicTable. Also rename detailsTabUrls to detailsUrls, luckily that setting has not been documented yet, so a simple rename is possible diff --git src/hg/hgc/bigBedClick.c src/hg/hgc/bigBedClick.c index 3b23db1..7ecffa3 100644 --- src/hg/hgc/bigBedClick.c +++ src/hg/hgc/bigBedClick.c @@ -204,31 +204,31 @@ extFieldMismatchCounts(val); else if (sameWord(name, "_crisprOfftargets")) extFieldCrisprOfftargets(val, extraFields); } static int seekAndPrintTable(struct trackDb *tdb, char *detailsUrl, off_t offset, struct slPair *extraFields) /* seek to 0 at url, get headers, then seek to offset, read tab-sep fields and output * (extraFields are needed for some special field handlers). Return the number of fields * successfully printed. */ { int printCount = 0; // open the URL and get the first line char *headerLine = readOneLineMaybeBgzip(detailsUrl, 0, 0); if (headerLine == NULL) { - printf("Error: Could not open the URL referenced in detailsTabUrls, %s", detailsUrl); + printf("Error: Could not open the URL referenced in detailsUrls, %s", detailsUrl); return printCount; } boolean skipEmptyFields = trackDbSettingOn(tdb, "skipEmptyFields"); // get the headers char *headers[1024]; int headerCount = chopTabs(headerLine, headers); // clone the headers int i; for (i=0; i<headerCount; i++) headers[i] = cloneString(headers[i]); // read a line @@ -281,68 +281,68 @@ } else { printf("<tr><td>%s</td>\n", name); printf("<td>%s</td></tr>\n", val); } printCount++; } printf("</table>\n"); dyStringPrintf(tableLabelsDy, "];\n"); jsInline(dyStringCannibalize(&tableLabelsDy)); return printCount; } struct slPair *parseDetailsTablUrls(struct trackDb *tdb) -/* Parse detailsTabUrls setting string into an slPair list of {offset column name, fileOrUrl} */ +/* Parse detailsUrls setting string into an slPair list of {offset column name, fileOrUrl} */ { -char *detailsUrlsStr = trackDbSetting(tdb, "detailsTabUrls"); +char *detailsUrlsStr = trackDbSetting(tdb, "detailsUrls"); if (!detailsUrlsStr) return NULL; struct slPair *detailsUrls = slPairListFromString(detailsUrlsStr, TRUE); if (!detailsUrls) { - printf("Problem when parsing trackDb setting detailsTabUrls<br>\n"); + printf("Problem when parsing trackDb setting detailsUrls<br>\n"); printf("Expected: a space-separated key=val list, like 'fieldName1=URL1 fieldName2=URL2'<br>\n"); printf("But got: '%s'<br>", detailsUrlsStr); return NULL; } struct slPair *pair; for (pair = detailsUrls; pair != NULL; pair = pair->next) pair->val = hReplaceGbdb(replaceChars(pair->val, "$db", database)); return detailsUrls; } static int printAllExternalExtraFields(struct trackDb *tdb, struct slPair *extraFields) -/* handle the "detailsTabUrls" trackDb setting: +/* handle the "detailsUrls" trackDb setting: * For each field, print a separate html table with all field names and values * from the external tab-sep file. Return the number of fields we successfully printed */ { int printCount = 0; struct slPair *detailsUrls = parseDetailsTablUrls(tdb), *pair; for (pair = detailsUrls; pair != NULL; pair = pair->next) { char *fieldName = pair->name; char *detailsUrl = pair->val; // get extra bigBed field (=the offset) and seek to it void *p = slPairFindVal(extraFields, fieldName); if (p==NULL) { - printf("Error when parsing trackDb detailsTabUrls statement:<br>\n"); + printf("Error when parsing trackDb detailsUrls statement:<br>\n"); printf("Cannot find extra bigBed field with name %s\n", fieldName); return 0; } char *offsetStr = (char*)p; if (offsetStr==NULL || sameWord(offsetStr, "0")) { /* need to show the empty off-targets for crispr tracks */ if (startsWith("crispr", tdb->track)) extFieldCrisprOfftargets(NULL, NULL); // empty or "0" value in bigBed means that the lookup should not be performed continue; } off_t offset = atoll(offsetStr);