ThomasAkam / photometry_preprocessing

Fiber photometry data preprocessing - denoising, photobleaching and motion correction.
GNU General Public License v3.0
19 stars 2 forks source link

df/f #1

Open zwzhang36 opened 1 year ago

zwzhang36 commented 1 year ago

Hi Thomas, when calculating the df/f, people usually use fitted control as the baseline. Why do you use signal with exponential fit here? Is there any specific reason to do so? Thank you!

ThomasAkam commented 1 year ago

Hi @zwzhang36,

Using a linear fit of the control signal as the baseline to compute df/f assumes that bleaching occurs in the control signal with the same timecourse as in the main signal. This may be a reasonable assumption when using isosbestic illumination of the reporter flurophore as the control channel, but in our data where we use a seperate red flurophore (e.g. TdTomato) as the control channel we typically do not see bleaching in the control channel to the same extent or with the same timecourse as in the main channel. Even when using isosbestic illumination as the control channel there is no guarantee that bleaching in the control channel will have the same timecourse as that in the main channel.

This is because multiple sources of fluorescence contribute to the recorded signal; the flurophore(s) themselves, autofluorescence from the patch cord and optics, and autofluorescence from brain tissue. The relative contribution of these to the recorded signal will be different at different excitation and/or emission wavelengths - in general you get much more autofluorescence with short wavelength illumination. Different sources of fluorescence may bleach at different rates, so if the contribution of e.g. autofluorescence and flurophore fluorescence is different in the main and control channel (as is likely to be the case), it is possible the timecourse of bleaching may be different in each channel.

Using a curve fit to the main channel signal as the baseline is a reasonable way to estimate bleaching if the timecourse is different in the main and control channels. It is worth noting though that if the bleaching is primarily driven by decreases in autofluorescence rather than flurophore fluorescence, computing dF/F using the decreasing baseline may artificially increase the amplitude of signals later in the session.

zwzhang36 commented 1 year ago

Hi Thomas,

Thanks for the nice reply! It is very helpful. I still have a question. According to what you said, could I say using a curve fit as the baseline is always better than using the isosbestic illumination? Is there any situation where using the isosbestic illumination is better? Thank you!

Zhewei

ThomasAkam commented 1 year ago

Hi Zhewei.

I would probably not put it quite that strongly as I have not systematically compared these different ways of preprocessing photometry data and don't have a lot of experience working with an isosbestic control channel. I think if the linear fit of the isosbestic channel to the main channel looks good then that approach is probably fine. I don't have enough experience working with an isosbestic control channel to know how often (if at all) this is not the case. In my experience using a double exponential fit to estimate the baseline works well, though again it is worth plotting the fit against the raw data to check that it looks sensible. One potential issue with using a fitted curve to estimate the baseline is that if there are physiological changes to the signal that are monotonically increasing or decreasing slowly across the session, then these will potentially be removed by using a curve fit as the baseline. However, in practice I would probably be wary of interpretting such changes in the signal due to the difficulty of robustly discriminating them from bleaching anyway.

zwzhang36 commented 1 year ago

Hi Thomas,

I got it. Many thanks for the detailed reply. I really appreciate it!

Zhewei