8d551f7d3103d3972b7314e27caa2b32d7aa8df8
max
Thu Oct 23 09:17:05 2025 -0700
dont show color pickers when the field has too many values, small perf improvement, for dev-whole-brain-hqm&meta=Initial_Class_markers_level_2, brittney
diff --git src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
index 5706a1d..3d75a5c 100644
--- src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
+++ src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
@@ -76,52 +76,55 @@
// width of a single gene cell in the meta gene bar tables
//var gGeneCellWidth = 66;
// height of the trace viewer at the bottom of the screen
var traceHeight = 100;
// height of bottom gene bar
var geneBarHeight = 100;
var geneBarMargin = 5;
// color for missing value when coloring by expression value
//var cNullColor = "CCCCCC";
//const cNullColor = "DDDDDD";
//const cNullColor = "95DFFF"; //= light blue, also tried e1f6ff
//const cNullColor = "e1f6ff"; //= light blue
const cNullColor = "AFEFFF"; //= light blue
- const nanColor = "DDDDDD"; // light grey
+ //const nanColor = "DDDDDD"; // light grey
const cDefGradPalette = "magma"; // default legend gradient palette for gene expression
// this is a special palette, tol-sq with the first entry being a light blue, so 0 stands out a bit more
const cDefGradPaletteHeat = "magma"; // default legend gradient palette for the heatmap
const cDefQualPalette = "rainbow"; // default legend palette for categorical values
var datasetGradPalette = cDefGradPalette;
var datasetQualPalette = cDefQualPalette;
const exprBinCount = 10; //number of expression bins for genes
// has to match cbData.js.exprBinCount - TODO - share the constant between these two files
var HIDELABELSNAME = "Hide labels";
var SHOWLABELSNAME = "Show labels";
var METABOXTITLE = "By Annotation";
// maximum number of distinct values that one can color on
- const MAXCOLORCOUNT = 1500;
+ const MAXCOLORCOUNT = 7000;
const MAXLABELCOUNT = 500;
+ // after this number of rows in the legend, no more color pickers are shown
+ const MAXCOLPICK = 300;
+
// histograms show only the top X values and summarize the rest into "other"
var HISTOCOUNT = 12;
// the sparkline is a bit shorter
var SPARKHISTOCOUNT = 12;
// links to various external databases
var dbLinks = {
"HPO" : "https://hpo.jax.org/app/browse/gene/", // entrez ID
"OMIM" : "https://omim.org/entry/", // OMIM ID
"COSMIC" : "http://cancer.sanger.ac.uk/cosmic/gene/analysis?ln=", // gene symbol
"SFARI" : "https://gene.sfari.org/database/human-gene/", // gene symbol
"BrainSpLMD" : "http://www.brainspan.org/lcm/search?exact_match=true&search_type=gene&search_term=", // entrez
"BrainSpMouseDev" : "http://developingmouse.brain-map.org/gene/show/", // internal Brainspan ID
"Eurexp" : "http://www.eurexpress.org/ee/databases/assay.jsp?assayID=", // internal ID
"LMD" : "http://www.brainspan.org/lcm/search?exact_match=true&search_type=gene&search_term=" // entrez
@@ -620,30 +623,31 @@
$( "#tabLink2" ).hide();
$( "#pane3" ).hide();
$( "#tabLink3" ).hide();
}
var tabIdx = 0;
if (openTab==="images")
tabIdx=3;
$("#tpOpenDialogTabs").tabs("refresh").tabs("option", "active", tabIdx);
if (openTab==="images")
$("#tabLinkImg").click();
}
let descLabels = {
"paper_url":"Publication",
"other_url" : "Website",
+ "hubUrl" : "UCSC Genome Browser",
"geo_series" : "NCBI GEO Series", // = CIRM tagsV5
"sra" : "NCBI Short Read Archive",
"pmid" : "PubMed Abstract",
"pmcid" : "PubMed Fulltext",
"sra_study" : "NCBI Short-Read Archive",
"ega_study" : "European Genotype-Phenot. Archive Study",
"ega_dataset" : "European Genotype-Phenot. Archive Dataset",
"bioproject" : "NCBI Bioproject",
"dbgap" : "NCBI DbGaP",
"biorxiv_url" : "BioRxiv preprint",
"doi" : "Publication Fulltext",
"cbDoi" : "Data Citation DOI",
"cap_project" : "Cell Annotation Platform",
"arrayexpress" : "ArrayExpress",
"ena_project" : "European Nucleotide Archive",
@@ -688,30 +692,35 @@
// for 99% of the cases, it'll be a string though
let urls = desc[key];
if (!(urls instanceof Array))
urls = [urls];
let frags = []; // html fragments, one per identifier
for (let url of urls) {
url = url.toString(); // in case it's an integer or float
let urlLabel = url;
let spcPos = url.indexOf(" ");
if (spcPos!==-1) {
urlLabel = url.slice(spcPos+1);
url = url.slice(0,spcPos);
}
+ if (key==="hubUrl") {
+ url = makeHubUrl(null);
+ urlLabel = "Connect Track Hub";
+ }
+
if (!url.startsWith("http"))
url = descUrls[key]+url;
let parts = []
parts.push("");
parts.push(urlLabel);
parts.push("");
let htmlLine = parts.join("");
frags.push(htmlLine);
}
htmls.push(frags.join(", "));
htmls.push("
");
}
@@ -998,30 +1007,31 @@
if (desc.lab) {
htmls.push("Lab: "+desc.lab);
htmls.push("
");
}
if (desc.institution) {
htmls.push("Institution: "+desc.institution);
htmls.push("
");
}
htmlAddLink(htmls, desc, "cbDoi");
htmlAddLink(htmls, desc, "biorxiv_url");
htmlAddLink(htmls, desc, "paper_url");
htmlAddLink(htmls, desc, "other_url");
+ htmlAddLink(htmls, db.conf, "hubUrl");
htmlAddLink(htmls, desc, "geo_series");
htmlAddLink(htmls, desc, "pmid");
htmlAddLink(htmls, desc, "dbgap");
htmlAddLink(htmls, desc, "sra_study");
htmlAddLink(htmls, desc, "bioproject");
htmlAddLink(htmls, desc, "sra");
htmlAddLink(htmls, desc, "doi");
htmlAddLink(htmls, desc, "cap_project");
htmlAddLink(htmls, desc, "arrayexpress");
htmlAddLink(htmls, desc, "cirm_dataset");
htmlAddLink(htmls, desc, "ega_study");
htmlAddLink(htmls, desc, "ega_dataset");
htmlAddLink(htmls, desc, "ena_project");
htmlAddLink(htmls, desc, "hca_dcp");
@@ -1077,30 +1087,31 @@
console.log(datasetInfo);
if ( datasetInfo.atacSearch) {
htmls.push("ATAC-seq search gene models: " + datasetInfo.atacSearch);
htmls.push("
");
}
htmls.push("Dataset classification: ");
buildClassification(htmls, datasetInfo, "body_parts", "Organs", true);
buildClassification(htmls, datasetInfo, "diseases", "Diseases", true);
buildClassification(htmls, datasetInfo, "organisms", "Organism", true);
buildClassification(htmls, datasetInfo, "life_stages", "Life Stage", true);
buildClassification(htmls, datasetInfo, "domains", "Scientific Domain", true);
buildClassification(htmls, datasetInfo, "sources", "Source Database", false);
+ buildClassification(htmls, datasetInfo, "assay", "Assay", false);
htmls.push("
If you use the Cell Browser of this dataset, please cite the " + "original publication and " + "" + "Speir et al. 2021. Feedback? Email us at cells@ucsc.edu."+ "
"); htmls.push("Cell Browser dataset ID: "+datasetInfo.name+ "
"); } } $( "#pane1" ).html(htmls.join("")); @@ -1147,40 +1158,42 @@ var clickClass = "tpDatasetButton"; if (dataset.isCollection) clickClass = "tpCollectionButton"; if (dataset.name===selName || (selName===undefined && i===0)) { clickClass += " active"; selIdx = i; } let bodyPartStr = getFacetString(dataset, "body_parts"); let disStr = getFacetString(dataset, "diseases"); let orgStr = getFacetString(dataset, "organisms"); let projStr = getFacetString(dataset, "projects"); let domStr = getFacetString(dataset, "domains"); let lifeStr = getFacetString(dataset, "life_stages"); + let assayStr = getFacetString(dataset, "assays"); let sourceStr = getFacetString(dataset, "sources"); var line = ""; // bootstrap seems to remove the id htmls.push(line); if (!dataset.isSummary) htmls.push(''); if (dataset.sampleCount!==undefined) { var countDesc = prettyNumber(dataset.sampleCount); htmls.push(""+countDesc+""); } if (dataset.datasetCount!==undefined) { htmls.push(""+dataset.datasetCount+" datasets"); } @@ -1378,30 +1391,32 @@ function onFilterChange(ev) { /* called when user changes a filter: updates list of datasets shown */ var filtNames = $(this).val(); var param = null; if (this.id==="tpBodyCombo") param = "bp"; else if (this.id=="tpDisCombo") param = "dis"; else if (this.id=="tpOrgCombo") param = "org"; else if (this.id=="tpProjCombo") param = "proj"; else if (this.id=="tpDomCombo") param = "dom"; + else if (this.id=="tpAssayCombo") + param = "assay"; else if (this.id=="tpStageCombo") param = "stage"; // change the URL var filtArg = filtNames.join("~"); var urlArgs = {} urlArgs[param] = filtArg; changeUrl(urlArgs); filterDatasetsDom(); } // -- end inline functions gOpenDataset = openDsInfo; var activeIdx = 0; @@ -1422,55 +1437,58 @@ noteLines.push( "The collection '"+openDsInfo.shortLabel+"' contains "+dsCount+" datasets. " +
"Double-click or click 'Open' below.
To move between datasets later in the cell browser, " +
"use the 'Collection' dropdown.