zqwei / Zebrafish_spinal_cord_development

8 stars 3 forks source link

Change the baseline computation to sliding window #1

Closed zqwei closed 7 years ago

zqwei commented 7 years ago

from Yinan ---


w = 40; // baselineWindowSize
p = 20; //baselinePrc
background = 90;
baseline = nan(nCells, numel(timepoints));
for i = 1:numel(timepoints)
   timeWindow = max(1, i-w+1):min(i+w,numel(timepoints));
baseline(:, i) = prctile(profile_all(:, timeWindow), p, 2);
end
dff = (profile_all - baseline)./(repmat(nanmean(baseline, 2), 1, numel(timepoints))-background);
zqwei commented 7 years ago

@yinan-wan Is minus background a must-do?

yinan-wan commented 7 years ago

I guess not. We use zscored data anyway so minus background is just a factor right?