Skip to content
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

Support "m-to-n" compensation, wherein the linear compensation model is overdetermined (more channels than fluorophores) #345

Open
JS3xton opened this issue Nov 18, 2020 · 0 comments

Comments

@JS3xton
Copy link
Contributor

JS3xton commented Nov 18, 2020

In #340, @castillohair and I considered compensating multicolor data with an overdetermined linear model (i.e., using more channels than fluorophores in the spillover matrix), dubbed "m-to-n" compensation by @castillohair. We decided, however, to wait for evidence that m-to-n compensation is superior to the more canonical "n-to-n" compensation, where the linear model is well-determined (i.e., same number of channels as fluorophores).

Hypothesized benefits:

  • We suspect both approaches would behave very similarly, but m-to-n compensation would be more robust when relying on weaker signals from outlier channels.
  • M-to-n compensation would also facilitate the compensation of many channels simultaneously. Currently, compensating multiple channels to the same fluorophore, for example, requires the construction of multiple different spillover matrices (which may yield slightly inconsistent results).

Code changes required:

  • Remove the requirement that the number of channels equals the number of fluorophores.
  • Replace np.linalg.solve() with np.linalg.lstsq() in the compensation function. np.linalg.lstsq() automatically calculates a deterministic least-squares solution if the system is overdetermined and solves for the exact solution if the system is well-determined.

To move forward, we need multicolor data sets with significant crosstalk and appropriate single-fluorophore controls that we can use to compare m-to-n and n-to-n compensation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant