bahanonu / ciatah

CIAtah (pronounced cheetah): a software package for calcium imaging analysis of one- and two-photon imaging datasets. Documentation: https://git.io/ciatah_docs. Formerly known as calciumImagingAnalysis (ciapkg).
https://git.io/ciatah_docs
MIT License
83 stars 22 forks source link

PCA traces have negative values #129

Open NataliaFavila opened 1 year ago

NataliaFavila commented 1 year ago

Hi Biafra,

We are wondering what exactly are we getting in the traces from the PCA-ICA analysis? Looking at the traces stored in the PCA-ICA output.mat file we noticed some have negative values. So we are wondering whether these are raw traces or dff?

Thank you! Natalia

bahanonu commented 1 year ago

@NataliaFavila Could you either provide the PCA-ICA mat-files or detail the parameters you used when running PCA-ICA? image

The values for PCA-ICA depend in part on the movies and whether the values were transformed to estimated movie units (e.g. dF/F) or as S.D. (e.g. see https://github.com/bahanonu/ciatah/issues/107#issuecomment-1194163259 or below from Fig. 2c-d from original Mukamel paper).

image

Depending on the activity of cells in the movie, there can be true negative values (e.g. inhibition after a stimulus) or negative values around zero due to noise (experimental or biological) fluctuations after dF/F calculation (e.g. if you calculated the ROI-based traces, would also see negative values). If you send a snippet of the raw movie, I can check to see which of these it likely is.

NataliaFavila commented 1 year ago

thank you so much for the explanation, I have now run the ROI based traces which were non-negative (as we were expecting), so now it all makes sense. Thank you!

bahanonu commented 1 year ago

Sounds good! As a quick note, be careful about using the ROI-based traces for downstream analysis, as depending on the imaging modality, density of cells, background activity, etc. they can contain significant cross-talk compared to traces from other methods (e.g. PCA-ICA, EXTRACT, CNMF(e), etc.).