Neural Event Reconstruction and Detection via Sparsity
version 0.1
- this is first repository of NERDS (published on Nov 13, 2014)
- Dyer, E.L.; Studer, C.; Robinson, J.T.; Baraniuk, R.G., "A robust and efficient method to recover neural events from noisy and corrupted data," Neural Engineering (NER), 6th International IEEE/EMBS Conference, pp.593-596, 2013 [Paper]
Matlab package implementing blind deconvolution method for neural spike recovery from either calcium traces or intracellular recordings of post-synaptic potentials.
- Matlab version >= 2007
- SPGL1 (Solver for large-scale sparse reconstruction) see also at git link (note that we did not include
SPGL1
in NERDS project) so make sure that you installSPGL1
and include in MATLAB path.
In order to download NERDS folder, either download zip file
from the git repository directly or use git
to clone the
repository using the command:
git clone https://github.com/nerdslab/nerds
You also need to install SPGL1
, run spgsetup.m
, and then add to MATLAB path. After that, hover to the folder and run setup_nerds.m
code.
You can run NERDS algorithm by using the function compute_nerds
in main folder
[gen_atom_out, spike_idx, x_hat_out, e_hat_out] = compute_nerds(y, opts)
The input has two arguments:
y
is 1-D calcium signal (either row or column format)opts
is a matlab structure containing parameters described in MATLAB code (if it isn't specified, we will assign default parameters)opts.numTrials
- number of iteration, defaultnumTrials = 10
opts.L
- length of template that we want to estimate, defaultask user
opts.thresh
- thresholding parameter, defaultthresh = 0.1
i.e. we threshold spikes whose amplitude less than 10 % of the maximum coefficient amplitudeopts.wsize
- window size where we apply summation of spikes (peak_sum
) in order to remove small group of low magnitude splikes output from algorithmopts.verbose
- verbose parameter for SPGL1, defaultverbose = false
The output has four arguments:
gen_atom_out
is estimated template where each column contains estimated template of each iterationspike_idx
is cell that contain index that spikes occurx_hat_out
is matrix where each column contains estimated spikes train produced in each iteration (we'll fix amplitude problem soon)e_hat_out
is matrix contains DCT coefficient which can transform back to base-line drift in calcium signal
opts.L
is estimated length of template (called gen_atom
) where you can estimate the length by the following figure:
See the example_synth.m
file for an example from the paper on synthetic data.
See the example_nerds.m
file for an example where we apply NERDS algorithm to real calcium data.
For synthetic example, the code will produce the graphs below. Note that after computing the sparse coefficients, we post-process the coefficients by thresholding the spike train and combining peaks that are close together.
- The calcium and electrophysiology data included in
example_real_data.mat
was collected in Jason MacLean's Lab at the University of Chicago. Check out the following two papers: Runfeldt et. al. and Sadovsky AJ et. al. for more details regarding the experimental methods utilized to acquire these simultaneous recordings.
- The MIT License (MIT) Copyright (c) 2014 Eva Dyer and Christoph Studer