labsyspharm / minerva_analysis

MIT License
26 stars 6 forks source link

Issue when gating against non-selected channel #93

Open thejohnhoffer opened 2 years ago

thejohnhoffer commented 2 years ago

Problem

When I try to activate the centroid rendering (OR-mode / pie-chart), I see an error on this line:

CsvGatingOverlay.js:230 Uncaught TypeError: Cannot read properties of undefined (reading 'color')
    at eval (CsvGatingOverlay.js:230:113)
    at Array.forEach (<anonymous>)
    at eval (CsvGatingOverlay.js:224:36)

Here's what I can figure out:

It seems like the simplest fix would be to add the following conditional check:

if (gatingChannelIndices[i].index in  _this.channel_list.currentChannels) {
 /* then draw the arcs */
}

Replication

Question

However, I'm not sure if there's a logical error. My question would be: Should _this.channel_list.currentChannels contain all active channels?

I wonder if it is related to this FIXME statement:

Retrieve color (FIXME - need to integrate into viewer manager)
thejohnhoffer commented 2 years ago

Ah, my issue stems from attempting to perform gating on a channel that is not selected.

So I've selected "Keratin" for gating on the right, but I didn't view that channel on the left.

It seems the software assumes that I'll only be gating against visible channels! That may be a fine assumption, but perhaps an error message would be nice.