sim.baseline: Create a baseline signal

Description Usage Arguments Value See Also

View source: R/perturbations.R

Description

Create a baseline flow rate or fluorescence signal.

Usage

1
2
3
sim.baseline(N, mu, sigma, transform = NULL, transform_par = 2,
  distort = NULL, distort_par = 100, output = c(1, 2, 3),
  flow_rate_baseline = NULL, verbose = FALSE)

Arguments

N

total number of time points over which events are distributed.

mu

mean of distribution from which values are sampled (independently per each time point).

sigma

standard deviation (see mu).

transform

type of transformation applied to values per each time tick. Can be log, asinh. Defaults to NULL.

transform_par

parameter for non-null transform. For log, this is the base. For asinh, this is b in y := asinh(y/b) where y is the vector of original values.

distort

time-dependent distortion of the baseline values. Can be sin, slope. Defaults to NULL.

distort_par

parameter for non-null distort. For sin, this is a vector of (1) amplitude, (2) period. For slope, this is a in offset := a*x + mu, where x is a vector of time points and offset is added to the original values.

output

specifies type of output. If 1, the function produces a list containing a df slot with data frame of time and values and a params slot containing parameters of the signal: mu, sigma, D (equal to "gauss", since baseline values are sampled from a Gaussian distribution), transform, transform_par, distort, distort_par and rate_adjusted (Boolean, indicated if parameter flow_rate_baseline was used). If 2, only the data frame (df) is returned. If 3, only the value column (without time) of the data frame is returned as numeric vector.

flow_rate_baseline

for simulating fluorescence signal congruent with flow rate signal, as generated by sim.baseline (with possible perturbations). When flow_rate_signal is non-null, this overrides N and events are distributed in the way specified by the flow rate.

verbose

Boolean, indicates whether the total number of events (N) should be printed when flow_rate_baseline is non-null.

Value

See parameter output

See Also

See functions beginning with sim.sample. for examples of usage.


davnovak/qctoy documentation built on Nov. 4, 2019, 9:45 a.m.