55ae69840a7842ab5b26755435daaad332635914 max Mon Jun 29 05:02:32 2020 -0700 adding noGenomeReason trackDb statement for OMIM and Crispr tracks, refs #25428 diff --git src/hg/hgTables/mainPage.c src/hg/hgTables/mainPage.c index 492e900..ea85714 100644 --- src/hg/hgTables/mainPage.c +++ src/hg/hgTables/mainPage.c @@ -652,39 +652,41 @@ else curTrack = tdb; isMaf = isMafTable(database, curTrack, curTable); } /* Table-specific options */ if (isHicTable(curTable)) hicMainPageConfig(cart, hTrackDbForTrack(database,curTable)); hPrintf("<tr><td><DIV style='background-color: #faf2bb; display:none; opacity:0.9; border: 1px solid #EEE; margin: 2px; padding: 4px' id='snpTablesNote'>" "<b>Note:</b> Most dbSNP tables are huge. Trying to download them through the Table Browser " "usually leads to a timeout.<br> " "Please see our <a href='../FAQ/FAQdownloads.html#snp'>Data Access FAQ</a> " "on how to download dbSNP data.</DIV></td></tr>"); + /* Region line */ { char *regionType; if (cartVarExists(cart, "hgFind.matches")) // coming back from a search regionType = cartUsualString(cart, hgtaRegionType, hgtaRegionTypeRange); else regionType = cartUsualString(cart, hgtaRegionType, hgtaRegionTypeGenome); char *range = cartUsualString(cart, hgtaRange, ""); + if (isPositional) { boolean doEncode = FALSE; if (!trackHubDatabase(database)) doEncode = sqlTableExists(conn, "encodeRegions"); hPrintf("<TR><TD><B>region:</B>\n"); /* If regionType not allowed force it to "genome". */ if ((sameString(regionType, hgtaRegionTypeUserRegions) && userRegionsFileName() == NULL) || (sameString(regionType, hgtaRegionTypeEncode) && !doEncode)) regionType = hgtaRegionTypeGenome; // Is "genome" is not allowed because of tdb 'tableBrowser noGenome'? @@ -717,30 +719,43 @@ jsOnEventById("focus", hgtaRange, jsRadioUpdate(hgtaRegionType, "regionType", "range")); cgiMakeButton(hgtaDoLookupPosition, "lookup"); hPrintf(" "); if (userRegionsFileName() != NULL) { makeRegionButton(hgtaRegionTypeUserRegions, regionType); hPrintf(" defined regions "); cgiMakeButton(hgtaDoSetUserRegions, "change"); hPrintf(" "); cgiMakeButton(hgtaDoClearUserRegions, "clear"); } else cgiMakeButton(hgtaDoSetUserRegions, "define regions"); hPrintf("</TD></TR>\n"); + + printf("noGenome? %d", (int)disableGenome); + if (disableGenome) { // no need to check curTrack for NULL, disableGenome can only be set if curTable is set + hPrintf("<tr><td><DIV style='background-color: #faf2bb; opacity:0.9; border: 1px solid #EEE; margin: 2px; padding: 4px'>"); + char *noGenomeNote = trackDbSettingClosestToHome(curTrack, "noGenomeReason"); + hPrintf("<b>Note:</b> This track is unavailable for genome-wide download. "); + if (noGenomeNote) + hPrintf("Reason: %s", noGenomeNote); + else + hPrintf("Usually, this is due to distribution restrictions of the source database or the size of the track. Please see the track documentation for more details. Contact us if you are still unable to access the data. "); + hPrintf("</DIV></td></tr>"); + } + } else { /* Need to put at least stubs of cgi variables in for JavaScript to work. */ jsTrackingVar("regionType", regionType); cgiMakeHiddenVar(hgtaRange, range); cgiMakeHiddenVar(hgtaRegionType, regionType); } /* Select identifiers line (if applicable). */ if (!isWig && getIdField(database, curTrack, curTable, hti) != NULL) { hPrintf("<TR><TD><B>identifiers (names/accessions):</B>\n"); cgiMakeButton(hgtaDoPasteIdentifiers, "paste list"); hPrintf(" ");