Exercise: correcting sensitised emission

Goal

By the end of this exercise you should be able to:

  • name the three images of a sensitised-emission measurement and what each contains,
  • estimate the bleed-through d and cross-excitation a from donor-only and acceptor-only controls,
  • compute the corrected sensitised emission F_c and the apparent efficiency E_\text{app} for a pixel or a cell,
  • recognise false FRET from wrong coefficients, a forgotten background or misaligned images,
  • explain why F_c/I_{AA} and F_c/\sqrt{I_{DD}I_{AA}} depend on the donor:acceptor ratio, and E_\text{app} does not,
  • estimate the noise of F_c,
  • (math) derive E_\text{app} from the forward model, invert the mixing matrix, and propagate the noise.

Do the pen-and-paper part first, then the demo.

Background

Idea What it means
I_{DD}, I_{DA}, I_{AA} donor exc./donor filter; donor exc./acceptor filter (FRET channel); acceptor exc./acceptor filter
Bleed-through d donor emission seen in the acceptor filter, per unit of I_{DD}
Cross-excitation a acceptor excited by the donor laser, per unit of I_{AA}
Corrected signal F_c = I_{DA} - d\,I_{DD} - a\,I_{AA}
Controls donor only → d (slope of I_{DA} vs I_{DD}); acceptor only → a (slope of I_{DA} vs I_{AA}); no-FRET → F_c \approx 0
Slope through the origin \sum x y / \sum x^2
Efficiency E_\text{app} = F_c/(F_c + G\,I_{DD}) = f\,E (f: paired fraction of donors)
Noise (Poisson) \sigma_{F_c}^2 \approx I_{DA} + d^2 I_{DD} + a^2 I_{AA}

By hand

B1. Coefficients from controls (background already subtracted). (a) Donor-only pixels (I_{DD}, I_{DA}): (200, 98), (400, 205), (800, 398). Estimate d. (b) Acceptor-only pixels (I_{AA}, I_{DA}): (500, 52), (1000, 99), (1500, 149). Estimate a. (c) Why a slope through the origin, and not an ordinary regression line with an intercept?

B2. A pixel of a cell with both labels: I_{DD} = 400, I_{DA} = 500, I_{AA} = 1000. Use d = 0.5, a = 0.1, G = 2. (a) Compute F_c. (b) Compute E_\text{app}, F_c/I_{AA} and F_c/\sqrt{I_{DD}I_{AA}}. (c) What would the donor intensity be without FRET?

B3. A wrong coefficient. Repeat B2 with d = 0.4 by mistake. Then take a no-FRET pixel with I_{DD} = 1000 (and I_{DA} = 0.5 \cdot 1000 + 0.1\,I_{AA}): what false F_c does d = 0.4 give? How would you notice this in an image of many no-FRET cells?

B4. Noise. Assume Poisson counts (variance = mean). (a) What is the standard deviation of F_c in the pixel of B2? In per cent of F_c? (b) Another pixel has the same I_{DD} and I_{AA}, but I_{DA} = 320. Compute F_c, E_\text{app} and the standard deviation of F_c. (c) How many such pixels must be summed for a 10 % precision on F_c in (b)?

B5. Predict. In a second experiment the acceptor is expressed at twice the level, everything else (donor level, binding, E) unchanged. Which of F_c, F_c/I_{AA}, F_c/\sqrt{I_{DD}I_{AA}} and E_\text{app} change, and by what factor?

B6. For each observation, give the most likely cause: (a) all cells, including the donor-only ones, show a uniform positive E_\text{app}, and so does the background; (b) the cells have a red rim on one side and a blue rim on the other in the F_c image; (c) F_c in the no-FRET cells is negative, more so in brighter cells; (d) cells with very high expression of both labels show FRET although the proteins do not bind.

B1. (a) \sum xy = 200\cdot98 + 400\cdot205 + 800\cdot398 = 420\,000; \sum x^2 = 840\,000; d = 0.50. (b) \sum xy = 348\,500, \sum x^2 = 3\,500\,000; a = 0.0996 \approx 0.10. (c) In a single-labelled sample there is nothing in the FRET channel without the dye: zero dye, zero signal. The model is a proportion. An intercept would absorb a background that should have been subtracted, and with noisy data it would trade off against the slope.

B2. (a) F_c = 500 - 0.5\cdot400 - 0.1\cdot1000 = 200. (b) E_\text{app} = 200/(200 + 2\cdot400) = 0.20; F_c/I_{AA} = 0.20; F_c/\sqrt{400\cdot1000} = 200/632.5 = 0.32. (c) I_{DD} + F_c/G = 400 + 100 = 500: FRET quenched the donor by 20 %, consistent with E_\text{app} = 0.20.

B3. F_c = 500 - 160 - 100 = 240, E_\text{app} = 240/1040 = 0.23 instead of 0.20. In the no-FRET pixel, F_c = (0.5 - 0.4)\cdot1000 = 100: false FRET proportional to the donor intensity. In the image, the no-FRET cells light up, the brighter (more donor) the more; F_c plotted against I_{DD} in those cells is a line with slope 0.1 instead of flat.

B4. (a) \sqrt{500 + 0.25\cdot400 + 0.01\cdot1000} = \sqrt{610} = 24.7: 12 % of 200. (b) F_c = 320 - 200 - 100 = 20, E_\text{app} = 20/820 = 0.024, \sigma = \sqrt{320 + 100 + 10} = 20.7: about 100 %. (c) Summing m pixels multiplies F_c by m and \sigma by \sqrt m: relative noise 1.04/\sqrt m \le 0.1 needs m \ge 108 pixels, a small region of about 10 × 11.

B5. F_c: unchanged (it depends on the paired donors). F_c/I_{AA}: halved. F_c/\sqrt{I_{DD}I_{AA}}: × 1/\sqrt2 = 0.71. E_\text{app}: unchanged.

B6. (a) Background (offset) not subtracted: an offset in all three images leaves (1 - d - a) times the offset in F_c, everywhere. (b) The FRET channel is shifted relative to the others (misalignment, e.g. chromatic shift): at one edge I_{DA} is too high, at the other too low. (c) Over-compensation: d (or a) too large. (d) Bystander FRET: at high concentration unbound donors and acceptors are close by chance.

Math questions

B7. (math) Start from the forward model I_{DD} = c_{DD}N_D(1 - fE), I_{AA} = c_{AA}N_A, F_c = G\,c_{DD}N_D\,fE. Show that F_c/(F_c + G\,I_{DD}) = fE, and that the donor signal without FRET is I_{DD} + F_c/G.

B8. (math) Write (I_{DD}, I_{DA}, I_{AA})^\top = L\,(u, F_c, v)^\top, give L and L^{-1}, and verify LL^{-1} = I. What is \det L, and why does that mean this unmixing never amplifies noise the way similar spectra do in lsunmix? (Careful: what does amplify noise here?)

B9. (math) Show that at fixed f and E, F_c/I_{AA} \propto N_D/N_A and F_c/\sqrt{I_{DD}I_{AA}} \propto \sqrt{N_D/N_A}.

B10. (math) (a) For independent Poisson images, derive \operatorname{Var}(F_c). (b) The coefficient d is estimated with standard deviation \sigma_d from an independent control. Show that it adds \sigma_d^2 I_{DD}^2 to the variance of F_c across experiments, and evaluate the total for B2 with \sigma_d = 0.02. (c) Why does averaging over many pixels of one image not reduce this part?

B7. F_c + G I_{DD} = G c_{DD}N_D fE + G c_{DD}N_D(1 - fE) = G c_{DD}N_D, so F_c/(F_c + G I_{DD}) = fE. The donor signal without FRET is c_{DD}N_D = (F_c + G I_{DD})/G = I_{DD} + F_c/G.

B8. L has rows (1, 0, 0), (d, 1, a), (0, 0, 1); L^{-1} rows (1, 0, 0), (-d, 1, -a), (0, 0, 1). Middle row of LL^{-1}: (d\cdot1 + 1\cdot(-d) + a\cdot0,\; 1,\; d\cdot0 + 1\cdot(-a) + a\cdot1) = (0, 1, 0); the other rows are trivially rows of I. \det L = 1 (expand along the first row). The matrix is well conditioned for small d, a, so the inverse itself does not blow up. What amplifies the relative noise is that F_c is small compared with the images it is computed from: its absolute noise is set by I_{DA}, I_{DD}, I_{AA}.

B9. F_c/I_{AA} = G c_{DD}N_D fE/(c_{AA}N_A) = (G c_{DD}fE/c_{AA})\,N_D/N_A. \sqrt{I_{DD}I_{AA}} = \sqrt{c_{DD}c_{AA}N_D N_A(1 - fE)}, so F_c/\sqrt{I_{DD}I_{AA}} = G\sqrt{c_{DD}/c_{AA}}\;fE/\sqrt{1 - fE}\;\sqrt{N_D/N_A}.

B10. (a) F_c is a linear combination with weights 1, -d, -a of independent variables: \operatorname{Var}(F_c) = \operatorname{Var}(I_{DA}) + d^2\operatorname{Var}(I_{DD}) + a^2\operatorname{Var}(I_{AA}) = I_{DA} + d^2 I_{DD} + a^2 I_{AA}. (b) \hat F_c = I_{DA} - \hat d I_{DD} - a I_{AA} with \hat d = d + \delta: an extra term -\delta I_{DD} with variance \sigma_d^2 I_{DD}^2 (independent of the image noise). B2: 610 + (0.02\cdot400)^2 = 610 + 64 = 674, \sigma = 26.0. (c) The same \hat d is used for every pixel: the error -\delta I_{DD} is perfectly correlated across pixels and does not average out; it is a bias for this experiment.

Explore: three images, two controls

A seeded field of eleven cells: donor only (cells 1 and 7), acceptor only (2, 8), free donor + acceptor without FRET (3, 9), a donor–acceptor fusion with efficiency E (4, 6, 10) and “binding” cells where half of the donors are paired at E = 0.4 (5, 11), each with its own expression levels. True values: d = 0.5, a = 0.1, G = 2; background offset 100. Left: the three raw images. Middle: the corrected image (choose F_c, an index, or E_\text{app}; white = 0, red positive, blue negative), with the per-cell value printed on each cell (sums over the cell). Right: the scatter of the current control with your coefficient as a line. Below: a table per cell.

E1. Preset raw FRET channel: everything lights up (d = a = 0). Which cells are bright in F_c? Read the mean F_c of the two donor-only cells. Now press remove bleed-through only: which cells drop to zero, and which still show a signal? Then remove cross-excitation too.

E2. Press measure d, a from the controls. What values do you get? Look at both control scatters (buttons above the scatter). Read E_\text{app} of each class in the readout and compare with the true fE in the table.

E3. Preset d too small: false FRET follows the donor (d = 0.4). Read E_\text{app} of the donor-only and no-FRET classes and of the fusion. Look at the donor-only scatter. Which cells show the most false F_c, and why?

E4. Preset indices change with D:A, E does not: the fusion cells now also express free acceptor (a different amount per cell). Switch between F_c/I_{AA}, F_c/\sqrt{I_{DD}I_{AA}} and E_\text{app} and read the three fusion cells (4, 6, 10) in the table. Which number is the same for all three, and why?

E5. Preset low E, few photons: the difference is noise (E = 0.05, 40 photons). Read the measured d and a, the class values of E_\text{app}, and look at the E_\text{app} image. Can you see FRET in single pixels? In whole cells? Raise the photons to 1000 and compare.

E6. Preset one pixel shift: edges, then forgot the background. Describe what each does to the corrected image and to the class values. Why does forgetting the background also spoil the measured coefficients?

E1. Raw: every cell except the acceptor-only ones is bright; the donor-only cells have mean F_c = 157 and 88 per pixel (their bleed-through). Removing bleed-through (d = 0.5): the donor-only cells drop to about 0; the acceptor-only (17, 20) and no-FRET cells (18, 22) still show cross-excitation, and the fusion cells show 158–243. With a = 0.1 too: all controls are about 0, fusion cells 135–208, binding cells 72 and 56 (they differ by expression, not by FRET).

E2. d = 0.499, a = 0.098. Both scatters are straight lines through the origin with the fitted line on top of the cloud. Class E_\text{app}: donor only 0.000, no FRET 0.001, fusion 0.303 (true 0.30), binding 0.199 (true 0.5\cdot0.4 = 0.20). In the table the individual cells agree with the truth to about ±0.005.

E3. Donor only 0.047, no FRET 0.047, fusion 0.326, binding 0.229. The line in the donor-only scatter lies below the cloud. The false F_c = 0.1\,I_{DD} is largest in the cells with the most donor: cell 1 (mean I_{DD} 313, false F_c 32 per pixel) more than cell 7 (177, 17).

E4. F_c/I_{AA}: 0.539, 0.235, 0.480; F_c/\sqrt{I_{DD}I_{AA}}: 0.684, 0.452, 0.646; E_\text{app}: 0.303 in all three. The extra free acceptor raises I_{AA} (the table’s \Sigma I_{AA}/\Sigma I_{DD} goes from 1.44 to 1.61, 3.69 and 1.81) without changing which donors are paired, so F_c and E_\text{app} stay; the indices divide by the acceptor amount.

E5. d = 0.486, a = 0.097 (noisier controls). Class E_\text{app}: fusion 0.055 (true 0.05), donor only 0.006, no FRET 0.006, binding 0.204. In the image single fusion pixels scatter by about ±0.08 around 0.06: the map is speckle, the fusion cells are hardly distinguishable from the no-FRET cells by eye, while the per-cell sums separate them. At 1000 photons the pixel noise is about 5 times smaller.

E6. Shift: the fusion cells get a red rim on one side and a blue rim on the other (I_{DA} is displaced by one pixel); the class values change only a little (fusion 0.29) because the rims cancel when summed over a cell, but pixel values (and anything thresholded on them) are wrong. Forgot the background: the controls’ slopes are pulled up by the offset (d = 0.635, a = 0.411), and then every class is wrong (donor only −0.058, no FRET −0.190, fusion 0.08). An offset is a component that is the same in all three images; it is not proportional to any dye, so a slope through the origin cannot describe it.

Code

Write the algorithms of this unit yourself, in Rust. Setup, and how to run and check your code: coding exercises: getting started. Your code goes in fret/src/sensitised_emission/exercise.rs. The images are photon counts with the background already subtracted.

C1. slope_through_origin(x, y, mask) = \sum xy / \sum x^2 over the mask: d from a donor-only sample (x = I_{DD}, y = I_{DA}), a from an acceptor-only sample (x = I_{AA}). The check is B1.

C2. corrected_fret(idd, ida, iaa, d, a) and fc_noise(idd, ida, iaa, d, a): at every pixel F_c = I_{DA} - d\,I_{DD} - a\,I_{AA}, and its photon noise \sqrt{I_{DA} + d^2 I_{DD} + a^2 I_{AA}}. The checks are B2(a), B3 and B4(a, b).

C3. e_app(fc, idd, g): E_\text{app} = F_c/(F_c + G\,I_{DD}) at every pixel (0 where the denominator is not positive). The checks are B2(b) and B3.

C4. per_cell(fc, idd, iaa, labels, g): the values of every cell from sums over its pixels:

for every pixel with label l > 0:
    sum_Fc[l] += F_c;  sum_DD[l] += I_DD;  sum_AA[l] += I_AA;  area[l] += 1
for every label l:
    E_app        = sum_Fc / (sum_Fc + G · sum_DD)
    per acceptor = sum_Fc / sum_AA
    symmetric    = sum_Fc / sqrt(sum_DD · sum_AA)

The check is two cells with the pixel of B2, the second with twice the acceptor (B5).

Then cargo run -p fret -- sensitised-emission and open the pictures in out/sensitised-emission/. The program simulates the three images of fields of cells with photon noise (true d = 0.5, a = 0.1, G = 2, about 300 photons per pixel). It measures d and a on a donor-only and an acceptor-only field, then prints a table per cell of a field with five kinds of cells (donor only, acceptor only, no FRET, a fusion with E = 0.3, binding with half the donors paired at E = 0.4): the mean F_c per pixel, the true fE, E_\text{app} and the two indices. It repeats the table with d = 0.4, and with three times as much acceptor in the FRET cells. Pictures: the labels, the FRET channel, F_c (0 = grey) and E_\text{app} (black 0, white 0.4).

C5. Compare the coefficients from the controls with the truth, and E_\text{app} of each kind with the true fE. Why does the table show no E_\text{app} for the acceptor-only cells, and what does e-app.png show there?

C6. With d = 0.4: which cells now show FRET, how much, and does it depend on the cell?

C7. With three times the acceptor: which numbers of the fusion and binding cells change, and by what factor? Compare with B5.

C8. The program prints the mean and sd of the pixel values of E_\text{app} in one fusion cell. How precise is one pixel, and how precise is the cell value?

The model solution is fret/src/sensitised_emission/solution.rs in the download.

C5. d = 0.498 and a = 0.100 (true 0.5 and 0.1). E_\text{app}: fusion 0.298, 0.309, 0.301 (true 0.30); binding 0.203, 0.201, 0.195 (true 0.20); no FRET 0.002 to 0.003; donor only −0.001 to 0.003. An acceptor-only cell has no donor: F_c and I_{DD} are both noise around 0, so their ratio means nothing. In e-app.png those cells are speckled with white pixels (noise divided by noise), while the no-FRET and donor-only cells are black and the FRET cells grey to white.

C6. All cells with donor get a false F_c = 0.098\,I_{DD}: the donor-only cells 25 to 30 photons per pixel, E_\text{app} 0.046 to 0.049; the no-FRET cells 0.049; the fusion cells 0.322 to 0.331 instead of 0.30, the binding cells 0.226 to 0.233 instead of 0.20. In photons per pixel the false signal is largest in the cells with the most donor; as E_\text{app} it is about the same in every cell, because E_\text{app} also divides by the donor.

C7. E_\text{app} does not change (fusion 0.297, 0.309, 0.301). F_c/I_{AA} drops to a third (0.383 → 0.127 in cell 4), F_c/\sqrt{I_{DD}I_{AA}} by about \sqrt3 (0.570 → 0.328, a factor of 1.74). Even with one acceptor level, the indices differ between the three fusion cells (0.31 to 0.53 per acceptor), because each cell has its own donor:acceptor ratio. As B5.

C8. One pixel: 0.298 \pm 0.037 (sd over the 61 pixels of cell 4), about 12 % of the value, as B4 predicts for a pixel with a few hundred photons. The cell value (ratio of sums) is 0.298; its noise is about 0.037/\sqrt{61} \approx 0.005, which matches the spread of the three fusion cells around 0.30.

Where this leads

Sensitised emission needs two coefficients, a calibration factor G and three images per time point, but works in living cells over time. The next unit measures E from the donor alone, before and after destroying the acceptor: no coefficients, one end point. Spectral detectors replace d and a by least-squares unmixing of the whole emission spectrum (lsunmix).