best_tau {detrendr} | R Documentation |
Find the best tau parameter for exponential smoothing detrending.
Description
Use Nolan's algorithm to find the ideal tau parameter for exponential smoothing detrending.
Usage
best_tau(img, cutoff = 0.05, parallel = FALSE, purpose = c("FCS", "FFS"))
Arguments
img |
A 4-dimensional array in the style of an
ijtiff_img (indexed by |
cutoff |
In exponential filtering detrending, for the weighted
average, every point gets a weight. This can slow down the computation
massively. However, many of the weights will be approximately zero. With
cutoff, we say that any point with weight less than or equal to |
parallel |
Would you like to use multiple cores to speed up this
function? If so, set the number of cores here, or to use all available
cores, use |
purpose |
What type of calculation do you intend to perform on the
detrended image? If it is an FFS (fluorescence fluctuation spectroscopy)
calculation (like number and brightness), choose 'FFS'. If it is an FCS
(fluorescence correlation spectroscopy) calculation (like cross-correlated
number and brightness or autocorrelation), choose 'FCS'. The difference is
that if |
Value
If no detrend is necessary, this function returns NA
. If a detrend
is required, this function returns a natural number which is the ideal
tau
parameter for exponential smoothing detrending. If there are multiple
channels, the function returns a vector, one tau
parameter for each
channel.
References
Rory Nolan, Luis A. J. Alvarez, Jonathan Elegheert, Maro Iliopoulou, G. Maria Jakobsdottir, Marina Rodriguez-Muñoz, A. Radu Aricescu, Sergi Padilla-Parra; nandb—number and brightness in R with a novel automatic detrending algorithm, Bioinformatics, https://doi.org/10.1093/bioinformatics/btx434.
Examples
## Not run:
## These examples are not run on CRAN because they take too long.
## You can still try them for yourself.
img <- ijtiff::read_tif(system.file("extdata", "bleached.tif",
package = "detrendr"
))[, , 1, ]
best_tau(img, parallel = 2)
## End(Not run)