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.
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:
Code changes required:
np.linalg.solve()
withnp.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.