9ba1f19df30d17211ebd94e05d6feb398ebc56a9 hiram Mon Dec 9 09:33:28 2024 -0800 updated per comments from QA refs #32596 diff --git src/hg/js/assemblySearch.js src/hg/js/assemblySearch.js index b6737fd..5d32896 100644 --- src/hg/js/assemblySearch.js +++ src/hg/js/assemblySearch.js @@ -1,21 +1,21 @@ // global variables: /* jshint esnext: true */ var debug = false; -var measureTiming = true; +var measureTiming = false; var urlParams; var query = ""; var maxItemsOutput = 500; var asmIdText = null; // adjust default here and in assemblySearch.html var browserExist = "mayExist"; var betterCommonName = null; var comment = null; var stateObject = {}; // maintain page state var requestSubmitButton = null; var completedAsmId = new Map(); // keep track of requests completed // so they won't be repeated var maxLength = 1024; // limit all incoming strings to this length // This function is called on DOMContentLoaded as the initialization @@ -253,33 +253,33 @@ } } document.getElementById("measureTiming").style.display = "none"; }); // refresh the thead columns in the specified table function headerRefresh(tableHead) { // clear existing content tableHead.innerHTML = ''; // re-populate header row - the sortable system added a class to // the last sorted column, need to rebuild the headerRow to get the // header back to pristine condition for the next sort var headerRow = '<tr>'; let circleQuestion = '<svg width="24" height="24"> <circle cx="12" cy="12" r="10" fill="#4444ff" /> <text x="50%" y="50%" text-anchor="middle" fill="white" font-size="13px" font-family="Verdana" dy=".3em">?</text>?</svg>'; headerRow += '<th><div class=tooltip>view/<br>request ⓘ<span onclick="event.stopPropagation()" class="tooltiptext"><b>view</b> opens the genome browser for an existing assembly, <b>request</b> opens an assembly request form.</span></div></th>'; - headerRow += '<th><div class="tooltip">English common name ⓘ<span onclick="event.stopPropagation()" class="tooltiptext">English common name</span></div></th>'; - headerRow += '<th><div class="tooltip">Scientific name ⓘ<span onclick="event.stopPropagation()" class="tooltiptext">Binomial scientific name</span></div></th>'; - headerRow += '<th><div class="tooltip">NCBI Assembly ⓘ<span onclick="event.stopPropagation()" class="tooltiptext">Links to NCBI resource record<br>or UCSC downloads for local UCSC assemblies</span></div></th>'; + headerRow += '<th><div class="tooltip">English common name ⓘ<span onclick="event.stopPropagation()" class="tooltiptext">English common name. This field may also include a unique identifier and the year the assembly was released.</span></div></th>'; + headerRow += '<th><div class="tooltip">Scientific name ⓘ<span onclick="event.stopPropagation()" class="tooltiptext">The Scientific name is the standardized, Latin-based designation used in biological taxonomy to formally classify and identify a species. Obtained from NCBI taxonomy.</span></div></th>'; + headerRow += '<th><div class="tooltip">NCBI Assembly ⓘ<span onclick="event.stopPropagation()" class="tooltiptext">The GC accession number for the assembly, if available, links to the corresponding NCBI resource record or UCSC download options for local UCSC assemblies.</span></div></th>'; headerRow += '<th><div class="tooltip">Year ⓘ<span onclick="event.stopPropagation()" class="tooltiptextright">Year assembly was released.</span></div></th>'; headerRow += '<th><div class="tooltip"><em>GenArk</em> clade ⓘ<span onclick="event.stopPropagation()" class="tooltiptextright">Clade specification as found in the <a href="https://hgdownload.soe.ucsc.edu/hubs/index.html" target=_blank>GenArk</a> system, this is not a strict taxonomy category, merely a division of assemblies into several categories.</span></div></th>'; headerRow += '<th><div class="tooltip">Description ⓘ<span onclick="event.stopPropagation()" class="tooltiptextright">Description may include other names, the <b>taxId</b>, year of assembly release and assembly center.</span></div></th>'; headerRow += '<th><div class="tooltip">Status ⓘ<span onclick="event.stopPropagation()" class="tooltiptextright">When specified, status will show the <b>Assembly status</b> the <b>RefSeq category</b> and the <b>Assembly level</b>.</span></div></th>'; headerRow += '</tr>'; tableHead.innerHTML = headerRow; } // call with visible true to make visible, false to hide function advancedSearchVisible(visible) { var advancedSearchButton = document.getElementById("advancedSearchButton"); var searchOptions = document.getElementById("advancedSearchOptions"); if (visible) { searchOptions.style.display = "flex"; advancedSearchButton.textContent = "Hide search options"; @@ -416,64 +416,62 @@ } else { browserUrl = "<a href='/cgi-bin/hgTracks?db=" + id + "' target=_blank>view</a>"; asmInfoUrl = "<a href='https://hgdownload.soe.ucsc.edu/goldenPath/" + id + "/bigZips/' target=_blank>" + id + "</a>"; } dataRow += "<th>" + browserUrl + "</th>"; } else { dataRow += "<th><button type=button' onclick='asmOpenModal(this)' name=" + id + ">request</button></th>"; } dataRow += "<td>" + genomicEntries[id].commonName + "</td>"; dataRow += "<td>" + genomicEntries[id].scientificName + "</td>"; dataRow += "<th>" + asmInfoUrl + "</th>"; dataRow += "<td>" + genomicEntries[id].year + "</td>"; dataRow += "<td>" + genomicEntries[id].clade + "</td>"; dataRow += "<td>" + genomicEntries[id].description + "</td>"; var status = "<td>"; - var hardSpace = " "; + var breakSpace = ""; // first one does not need the break if (genomicEntries[id].versionStatus) { - status += " " + genomicEntries[id].versionStatus; - hardSpace = ""; + status += breakSpace + genomicEntries[id].versionStatus; + breakSpace = "<br>"; // subsequent words will have the break } if (genomicEntries[id].refSeqCategory) { - status += " " + genomicEntries[id].refSeqCategory; - hardSpace = ""; + status += breakSpace + genomicEntries[id].refSeqCategory; + breakSpace = "<br>"; // subsequent words will have the break } if (genomicEntries[id].assemblyLevel) { - status += " " + genomicEntries[id].assemblyLevel; - hardSpace = ""; + status += breakSpace + genomicEntries[id].assemblyLevel; } status += "</td>"; -// status += hardSpace + "</td>"; dataRow += status; dataRow += '</tr>'; tableBody.innerHTML += dataRow; } var dataTable = document.getElementById('dataTable'); sorttable.makeSortable(dataTable); var itemCount = parseInt(extraInfo.itemCount, 10); var totalMatchCount = parseInt(extraInfo.totalMatchCount, 10); var availableAssemblies = parseInt(extraInfo.availableAssemblies, 10); - var resultCounts = "<em>results for search string: </em><b>'" + extraInfo.q.trim() + "'</b>, "; + var resultCounts = "<em>Query: </em><b>'" + extraInfo.q.trim() + "'</b>, "; if ( itemCount === totalMatchCount ) { - resultCounts += "<em>showing </em><b>" + itemCount.toLocaleString() + "</b> <em>match results</em>, "; + resultCounts += "<em>Matches </em><b>" + itemCount.toLocaleString() + "</b> <em>assemblies, </em>"; } else { - resultCounts += "<em>showing </em><b>" + itemCount.toLocaleString() + "</b> <em>match results</em> "; - resultCounts += "<em>from </em><b>" + totalMatchCount.toLocaleString() + "</b> <em>total matches,</em> "; + resultCounts += "<em>Matches </em><b>" + totalMatchCount.toLocaleString() + "</b> <em>assemblies, </em> "; + resultCounts += "<em>limited display here of </em><b>" + itemCount.toLocaleString() + "</b> <em>matching assemblies, </em> "; } - resultCounts += "<em>out of </em><b>" + availableAssemblies.toLocaleString() + "</b> <em>total number of assemblies</em>"; + resultCounts += "<em>from a total of </em><b>" + availableAssemblies.toLocaleString() + "</b>."; document.getElementById('resultCounts').innerHTML = resultCounts; if (measureTiming) { var etMs = extraInfo.elapsedTimeMs; var elapsedTime = "<b>" + etMs.toLocaleString() + "</b> <em>milliseconds</em>"; if ( etMs > 1000 ) { var etSec = etMs/1000; elapsedTime = "<b>" + etSec.toFixed(2) + "</b> <em>seconds</em>"; } document.getElementById('elapsedTime').innerHTML = elapsedTime.toLocaleString(); document.getElementById("measureTiming").style.display = "inline"; } else { document.getElementById("measureTiming").style.display = "none"; } document.getElementById('urlCopyLink').style.display = "inline"; } // function populateTableAndInfo(jsonData)