R Under development (unstable) (2022-04-07 r82109) -- "Unsuffered Consequences" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "FastLZeroSpikeInference" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('FastLZeroSpikeInference') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("FastLZeroSpikeInference") > ### * FastLZeroSpikeInference > > flush(stderr()); flush(stdout()) > > ### Name: FastLZeroSpikeInference > ### Title: FastLZeroSpikeInference: FastLZeroSpikeInference: A package for > ### estimating spike times from calcium imaging data using an L0 penalty > ### Aliases: FastLZeroSpikeInference FastLZeroSpikeInference-package > > ### ** Examples > > > sim <- simulate_ar1(n = 500, gam = 0.95, poisMean = 0.009, sd = 0.05, seed = 1) > plot(sim) > > ## Fits for a single tuning parameter > > # AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) Output: Number of spikes 2 Settings: Data length 500 Model type ar1 Gamma 0.95 Lambda 1 > > # compute fitted values from prev. fit > fit <- estimate_calcium(fit) > plot(fit) > > # or > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, estimate_calcium = TRUE) > plot(fit) > > # Constrained AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, + estimate_calcium = TRUE) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, estimate_calcium = TRUE) Output: Number of spikes 2 Settings: Data length 500 Model type ar1-pos-constrained Gamma 0.95 Lambda 1 > plot(fit) > > > > > cleanEx() > nameEx("estimate_calcium") > ### * estimate_calcium > > flush(stderr()); flush(stdout()) > > ### Name: estimate_calcium > ### Title: Estimate underlying calcium concentration based on estimated > ### spikes > ### Aliases: estimate_calcium > > ### ** Examples > > > sim <- simulate_ar1(n = 500, gam = 0.95, poisMean = 0.009, sd = 0.05, seed = 1) > plot(sim) > > ## Fits for a single tuning parameter > > # AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) Output: Number of spikes 2 Settings: Data length 500 Model type ar1 Gamma 0.95 Lambda 1 > > # compute fitted values from prev. fit > fit <- estimate_calcium(fit) > plot(fit) > > # or > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, estimate_calcium = TRUE) > plot(fit) > > # Constrained AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, + estimate_calcium = TRUE) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, estimate_calcium = TRUE) Output: Number of spikes 2 Settings: Data length 500 Model type ar1-pos-constrained Gamma 0.95 Lambda 1 > plot(fit) > > > > > cleanEx() > nameEx("estimate_spike_paths") > ### * estimate_spike_paths > > flush(stderr()); flush(stdout()) > > ### Name: estimate_spike_paths > ### Title: Estimate spike train, underlying calcium concentration, and > ### changepoints based on a fluorescence trace. Automatic tuning > ### parameter selection within a range of values [lambda_min, lambda_max] > ### Aliases: estimate_spike_paths > > ### ** Examples > > > sim <- simulate_ar1(n = 500, gam = 0.95, poisMean = 0.009, sd = 0.05, seed = 1) > plot(sim) > > ## Fits for tuning parameters between [0.1, 10] > fits <- estimate_spike_paths(dat = sim$fl, gam = 0.95, lambda_min = 0.1, lambda_max = 10) ARFPOP.cpp:163:7: runtime error: load of value 45, which is not a valid value for type 'bool' #0 0x7fedba6fa295 in ARFPOP(double*, int, double, double, double*, int*, double*, int*, bool*, int*, bool*, double) /data/gannet/ripley/R/packages/tests-clang-SAN/FastLZeroSpikeInference/src/ARFPOP.cpp:163:7 #1 0x7fedba70b7ba in ARFPOP_interface(double*, int*, double*, double*, double*, int*, double*, int*, bool*, int*, bool*, double*) /data/gannet/ripley/R/packages/tests-clang-SAN/FastLZeroSpikeInference/src/interface.cpp:15:3 #2 0x743872 in do_dotCode /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c #3 0x8427a5 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7136:14 #4 0x82d14e in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8 #5 0x8959c3 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #6 0x89166f in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16 #7 0x8520df in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7104:12 #8 0x82d14e in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8 #9 0x8959c3 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #10 0x89166f in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16 #11 0x82db88 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:871:12 #12 0x8a1ac1 in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2991:8 #13 0x82d538 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:823:12 #14 0x95c7d6 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264:2 #15 0x95fd30 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:316:11 #16 0x95fb39 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1137:5 #17 0x95fe72 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1144:5 #18 0x4f30ba in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29:5 #19 0x7fedca265b74 in __libc_start_main (/lib64/libc.so.6+0x27b74) (BuildId: 08df60634339b221bb854d4e10b7278cafde70c4) #20 0x43231d in _start (/data/gannet/ripley/R/R-clang-SAN/bin/exec/R+0x43231d) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ARFPOP.cpp:163:7 in > print(fits) Output: Number of tuning values used 3 Settings: Data length 500 Model type ar1 Gamma 0.95 > plot(fits) > print(fits$path_fits[[1]]) Call: estimate_spikes(dat = dat, gam = gam, lambda = lambda_min, constraint = constraint, estimate_calcium = EPS) Output: Number of spikes 2 Settings: Data length 500 Model type ar1 Gamma 0.95 Lambda 0.1 > plot(fits$path_fits[[1]]) > > ## Fits for a single tuning parameter > > # AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) Output: Number of spikes 2 Settings: Data length 500 Model type ar1 Gamma 0.95 Lambda 1 > > # compute fitted values from prev. fit > fit <- estimate_calcium(fit) > plot(fit) > > # or > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, estimate_calcium = TRUE) > plot(fit) > > # Constrained AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, + estimate_calcium = TRUE) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, estimate_calcium = TRUE) Output: Number of spikes 2 Settings: Data length 500 Model type ar1-pos-constrained Gamma 0.95 Lambda 1 > plot(fit) > > > > > cleanEx() > nameEx("estimate_spikes") > ### * estimate_spikes > > flush(stderr()); flush(stdout()) > > ### Name: estimate_spikes > ### Title: Estimate spike train, underlying calcium concentration, and > ### changepoints based on a fluorescence trace. > ### Aliases: estimate_spikes > > ### ** Examples > > > sim <- simulate_ar1(n = 500, gam = 0.95, poisMean = 0.009, sd = 0.05, seed = 1) > plot(sim) > > ## Fits for a single tuning parameter > > # AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1) Output: Number of spikes 2 Settings: Data length 500 Model type ar1 Gamma 0.95 Lambda 1 > > # compute fitted values from prev. fit > fit <- estimate_calcium(fit) > plot(fit) > > # or > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, estimate_calcium = TRUE) > plot(fit) > > # Constrained AR(1) model > fit <- estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, + estimate_calcium = TRUE) > print(fit) Call: estimate_spikes(dat = sim$fl, gam = 0.95, lambda = 1, constraint = TRUE, estimate_calcium = TRUE) Output: Number of spikes 2 Settings: Data length 500 Model type ar1-pos-constrained Gamma 0.95 Lambda 1 > plot(fit) > > > > > cleanEx() > nameEx("plot.simdata") > ### * plot.simdata > > flush(stderr()); flush(stdout()) > > ### Name: plot.simdata > ### Title: Plot simulated data > ### Aliases: plot.simdata > > ### ** Examples > > > sim <- simulate_ar1(n = 500, gam = 0.998, poisMean = 0.009, sd = 0.05, seed = 1) > plot(sim) > > > > > cleanEx() > nameEx("simulate_ar1") > ### * simulate_ar1 > > flush(stderr()); flush(stdout()) > > ### Name: simulate_ar1 > ### Title: Simulate fluorescence trace based on simple AR(1) generative > ### model > ### Aliases: simulate_ar1 > > ### ** Examples > > sim <- simulate_ar1(n = 500, gam = 0.998, poisMean = 0.009, sd = 0.05, seed = 1) > plot(sim) > > > > ### *