Closed adampavlinek closed 4 months ago
Hi, if the pipeline didn't crash with an error, then it may be to do with the size of the file / long processing time (the warning can occur when there are electrodes with very similar activity, but is not unusual). How long is your recording and sampling rate? And how much RAM do you have on your computer? Was it stuck on the first file? I will suggest running it again (perhaps skipping straight to step 2, since the spike detection is already done) and see if the error still occurs. Let me know how it goes!
Hi so I am trying a computer with more RAM, but I am now encountering an error prior to spike detection:
Unrecognized function or variable 'option'.
Error in MEApipeline (line 197) batchDetectSpikes(rawData, savePath, option, ExpName, Params);
Hi, sorry for the delay! This should be fixed now
Hi, just want to update you that I found a few more related bugs and fixed those as well, so please get the latest version, thanks!
Hi I'm getting the following errors during spike detection, not sure if this is because I set something wrong?:
Error using butter>butterImpl The cutoff frequencies must be within the interval of (0,1).
Error in butter (line 59) [varargout{1:nargout}] = butterImpl(n,Wn,varargin{:});
Error in detectSpikesCWT (line 93) [b, a] = butter(filterOrder, wn);
Error in batchDetectSpikes (line 271) detectSpikesCWT(trace,fs,wid,actual_wname,L,nScales, ...
Error in MEApipeline (line 197) batchDetectSpikes(rawData, savePath, option, ExpName, Params);
Hi, sorry for the delay! This should be fixed in this commit made yesterday: 1fed13af7889b948b463f4e0c3afbfee141145d6, let me know how it goes!
Hi, this fixed it and spike detection runs fully. I am however getting an error before step 2B:
Unrecognized function or variable 'eGrp'.
Error in PlotEphysStats (line 136) VNe = strcat(eGrp,'.',eDiv,'.',eMet);
Error in MEApipeline (line 333) PlotEphysStats(ExpName,Params,HomeDir, oneFigureHandle)
Ah interesting, did you have a column named "Genotype" in your .csv file?
Ah yes but I left the column blank, should I fill it in/delete it?
You should fill it with "WT" (meaning wild-type) or any combination of letters that make sense to you. Thanks! (In a future update we will make it so if you leave it blank this will be done for you automatically)
Thank you I fixed this but am getting a different error now at the same step, not sure if this is something I need to configure? :
Error using matlab.internal.math.validateOrEstimateBW Expected Bandwidth to be positive.
Error in mvksdensity>apply_censoring_get_bandwidth (line 309) u = matlab.internal.math.validateOrEstimateBW(errPrefix, ty, u, d, bounds);
Error in mvksdensity (line 112) [ty,~,weight,u,foldpoint,maxp] = apply_censoring_get_bandwidth(cens,yData,ty,ymax,weight,u,d, [L U]);
Error in ksdensity (line 235) [fout,xout,u,plottype] = mvksdensity(yData,xi,varargin{:});
Error in HalfViolinPlot (line 59) [f,xi] = ksdensity(data, 'Bandwidth',bandwidth);
Error in PlotEphysStats (line 319) eval(['HalfViolinPlot(PlotDat,xt(d),cDiv' num2str(d) ', Params.kdeHeight, Params.kdeWidthForOnePoint)']);
Error in MEApipeline (line 333) PlotEphysStats(ExpName,Params,HomeDir, oneFigureHandle)
Hi, this see to be caused by a rare case where the bandwidth estimation fails because there are too few datapoints / the data is somehow a bit weird, I just pushed a fix to that, see if that helps :)
Hi,
I'm still getting the same errors. Could it be something to do with me using a 24w plate layout that has fewer electrodes?
Hmm strange, I don't think they are related, can you enter debug mode in line 319 of PlotEphysStats and tell me what are the values of the variables: PlotDat, xt(d), cDiv, num2str(d), Params.kdeHeight, and Params.kdeWidthForOnePoint? Thanks!
Hi the values are: K>> dbstack
In PlotEphysStats (line 319) In MEApipeline (line 333) K>> PlotDat PlotDat = 16 K>> xt(d) ans = 1 K>> cDiv Unrecognized function or variable 'cDiv'. K>> num2str(d) ans = '1' K>> Params.kdeHeight ans = 0.3000 K>> Params.kdeWidthForOnePoint ans = 0
Hi, which version of matlab are you using? I suspect that the bandwidth parameter must be strictly positive in newer version, but not in older versions (I am testing the code on Matlab 2021b), I just pushed some code to make the bandwidth always positive, can you see if it works now?
Thanks that worked! I'm using Matlab R2023b.
Hello,
The analysis pipeline runs fine until step 2A, where it successfully generates one raster plot and then gets stuck and matlab stops responding, with Figure 2 electrode heatmap shown.
Not sure if this is relevant but I also get this warning: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.409245e-16.