SpikeInference.Rd
SpikeInference is an R package for quantifying uncertainty (i.e., obtaining valid p-values and confidence intervals) for spikes estimated from calcium imaging data via the penalized algorithm described in Jewell and Witten (2018) and Jewell et al. (2020). Details can be found in our manuscript (Chen et al. 2021). In addition to the manual in R, a detailed tutorial can be found at https://yiqunchen.github.io/SpikeInference/index.html.
Maintainer: Yiqun Chen <yiqunc@uw.edu>
The main functions included in the package are: simulate_ar1
, spike_estimates
, and spike_inference
.
Chen YT, Jewell SW, Witten DM. (2021) Quantifying uncertainty in spikes estimated from calcium imaging data. arXiv:2103.0781 [statME].
Jewell, S. and Witten, D. (2018). Exact spike train inference via l0 optimization. Ann. Appl. Stat., 12(4):2457–2482.
Jewell SW, Hocking TD, Fearnhead P, Witten DM. Fast nonconvex deconvolution of calcium imaging data. Biostatistics. 2020;21(4):709-726. doi:10.1093/biostatistics/kxy083
gam <- 0.98 LAMBDA <- 0.7 sigma <- 0.3 n_length <- 1000 curr_sim <- simulate_ar1(n = n_length, gam = gam, poisMean = 0.01, sd = sigma, seed = 2) curr_fit_spike <- spike_estimates(dat = curr_sim$fl, decay_rate = gam, tuning_parameter = LAMBDA) curr_inference_spike <- spike_inference(dat = curr_sim$fl, decay_rate = gam, tuning_parameter = LAMBDA, window_size = 2, sig2 = sigma*sigma, return_ci = TRUE) ### a summary of the inferential results summary(curr_inference_spike)#> estimated_spikes pvals LCB UCB #> 1 95 0.0026865876 0.3313205 1.5624120 #> 2 237 0.3080037641 -0.9602564 0.9293162 #> 3 369 0.0003211625 0.5423357 1.7345743 #> 4 463 0.0489093674 -0.1322414 1.1940410 #> 5 503 0.0086375856 0.1706250 1.4210234 #> 6 515 0.0007364613 0.4639493 1.6659810 #> 7 538 0.7342421299 -8.5600416 1.0333508 #> 8 561 0.1274106669 -0.5842248 1.2708549 #> 9 571 0.0011170360 0.4546186 1.6866898 #> 10 610 0.0370503683 -0.1092493 1.4964073 #> 11 627 0.0020417663 0.3977844 1.6573791 #> 12 662 0.0046657711 0.2894321 1.5793793 #> 13 781 0.0059471283 0.2203090 1.4564512 #> 14 914 0.0142668035 0.1420499 1.6782515 #> 15 924 0.6120957544 -4.3107861 1.0106799 #> 16 946 0.0011172539 0.4747208 1.7228907