294c36492d0ae4bac9ae450eade47fe33c4860d8
max
  Fri May 16 09:22:07 2025 -0700
improving error message when gene is not found in matrix

diff --git src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
index c543433..fbea65c 100644
--- src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
+++ src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
@@ -9390,32 +9390,34 @@
             }
             htmls.push("</tr>");
         }
 
         htmls.push("</tbody>");
         htmls.push("</table>");
 
         // sub function ----
         function onMarkerGeneClick(ev) {
             /* user clicks onto a gene in the table of the marker gene dialog window */
             var geneIdOrSym = ev.target.getAttribute("data-gene");
 
             // old marker tables do not contain the geneIds. For these we need to resolve the symbol to an ID
             if (!db.isAtacMode() && db.geneOffsets[geneIdOrSym]===undefined) {
                 var geneIds = db.findGenesExact(geneIdOrSym);
+                if (geneIds.length===0)
+                    alert("Symbol "+geneIdOrSym+" is not in the expression matrix. This can happen when markers were calculated before the matrix was filtered or if the authors added invalid markers. Internal error. Please contact us at cells@ucsc.edu");
                 if (geneIds.length!==1)
-                    alert("symbol "+geneIdOrSym+" resolves to more than one geneId. Internal error? Please contact us at cells@ucsc.edu");
+                    alert("Symbol "+geneIdOrSym+" resolves to more than one geneId. Internal error? Please contact us at cells@ucsc.edu");
                 geneIdOrSym = geneIds[0];
             }
 
             $(".ui-dialog").remove(); // close marker dialog box
             if (selectOnClick) {
                 clusterField = db.conf.labelField;
                 var queryList = [{'m':clusterField, 'eq':clusterName}];
                 findCellsMatchingQueryList(queryList, function(cellIds) {
                         renderer.selectSet(cellIds);
                         //changeUrl({'select':JSON.stringify(queryList)});
                 });
             }
 
             // the marker table historically only contains symbols (this was a mistake)
             // colorByLocus will automatically resolve them to IDs.