New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color compensation #238
Comments
I was initially on board with this idea, but upon reflection and after discussions with @thoreusc, I think we have to be careful about autofluorescence and its implications on the reported statistics. Specifically, to expand on your math (
|
Note: What I'm proposing is an implementation of the existing widely-used compensation method, which is based on "average" statistics. If we want to talk about a new technique that deconvolves the true fluorophore distribution and takes into account uncertainties, we should do that in another issue. But we know that @thoreusc has spent a lot of time on this and not arrived at something satisfactory, so it would likely be a complicated rabbit hole. My intention with this is to implement what I think is the biggest omission in FlowCal right now, and I think delaying this until we develop a superior technique is not a good approach.
This is a good point. Higher moments are not corrected by this compensation method, and having the channel name changed to the fluorophore name is misleadingly implying that it is. I'm gonna go with "Compensated [channel_name]" then. |
I'm on board with adding an existing, widely-used compensation method, and I agree that we shouldn't wait (or maybe even hope for) a more sophisticated technique that more appropriately deconvolves out the true fluorophore distribution. I think we need to be precise with that implementation, though, and I think referring to the compensated data as "Compensated [channel name]", both to describe the distribution and its summary statistics, absolves you of any misdirection. I think it needs to be easy to figure out what the compensation formula was from the documentation, though (while widely used, I still consider it to be arbitrary). It might also be nice to allow the user to specify their own compensation function via the Python API, but I may be getting ahead of myself. |
Color compensation is necessary for applications in which multiple fluorophores are used in the same cell (e.g. sfGFP and mCherry). Currently, FlowCal does not perform color compensation automatically. This issue will fix that, and the solution will eventually become part of a relatively major revision. This requires, as far as I can tell right now, the resolution of three aspects: developing the mathematical foundations, programming the API methods, and expanding the Excel UI so that non-programmers can use compensation easily.
The math that I would be using can be found here. It was derived independently, but it is equivalent to http://www.drmr.com/compensation/, plus autofluorescence. It is also equivalent to what it is performed in the TASBE method, as far as I can tell. Roughly, the method requires the calculation of one matrix of spillover coefficients, and a vector of autofluorescence values. These can be calculated using samples with no fluorescence and with strong expression of a single fluorophore.
With regards to the API, I propose the creation of a new module, called
compensation
. This module will contain the functions necessary to calculate the compensation parameters and apply compensation to new samples. Compensation, from an API perspective, should be performed in a similar way to the way MEF is performed:s_compensated = compensate_fxn(s_uncompensated)
. I think it would be cool if the channels names are changed to reflect the fact that the event list now contains fluorophore values instead of channel signals. (e.g. instead of FL1, the channel would be called sfGFP).compensation
moduleget_compensation_fxn()
, which will receive as parameters all the appropriate controls and the channels to compensate.compensation
module will contain any other auxiliary functions that are necessary for compensation.The Excel UI aspect needs more thinking. So far, I think that a new sheet can be included, in which the user can point to all the necessary controls, the names of the channels to compensate, and the names of the fluorophores used. In the Samples sheet, the user can still get statistics on uncompensated values by using the name of the channel (e.g. FL1 Median) or on compensated values, by using a fluorophore's name (e.g. sfGFP Median). A priority in this case should be to preserve FlowCal's current behavior.
The text was updated successfully, but these errors were encountered: