Julie-Fabre / bombcell

Automated quality control, curation and neuron classification of spike-sorted electrophysiology data
GNU General Public License v3.0
115 stars 28 forks source link

which raw file to extract rawWaveformsFull from and what metrics were based on rawWaveformsFull #167

Open chongtianyifa opened 1 week ago

chongtianyifa commented 1 week ago

Hi,

I am not certain which raw file was expected by bombcell to get rawWaveformsFull. I guess very raw (without any preprocessing) file is not correct as noise were not removed. temp_wh.dat output by kilosort is better but not correct for calculating amplitude since it was whitened. Maybe using whitening_mat_inv.npy to unwhiten the trace stored in temp_wh.dat is correct, just like phy did. But this is not implemented in bombcell.

My relevant concern is what metrics were based on the rawWaveformsFull. I guess only signalToNoiseRatio and rawAmplitude were calculated from rawWaveformsFull.

update: if choosing the .bin raw file, the calculated amplitude is actually twice of real amplitude. It might be caused by this code in readSpikeGLXMetaFile.m: Vrange = 2 * str2num(filetext(startIndexvMax+1:endIndex-1)) * 1e6. Instead, it should be Vrange = str2num(filetext(startIndexvMax+1:endIndex-1)) * 1e6.

Please let me know how to load the raw file.

Julie-Fabre commented 4 days ago

Hi,

Thanks for your message and sorry for our late reply! Bombcell uses your raw .bin or .dat file (unwhitened - the output of your spikesorter). The best thing is to take this file and (1) align the channels to each other (see here: https://billkarsh.github.io/SpikeGLX/help/catgt_tshift/catgt_tshift/) and (2) perform common average referencing (see here too: https://billkarsh.github.io/SpikeGLX/help/catgt_tshift/catgt_tshift/). We will integrate these two features directly into bonbcell in the future , as options. For now, you can either (1) perform this yourself, (2) just use the raw data directly (this will not have a large effect)