preprocess_spline: Preprocess the input data by fitting cubic splines

Description Usage Arguments Value Author(s) Examples

View source: R/preprocess_spline.R

Description

The data is denoised and/or imputed by fitting cubic splines. This requires a minimum of 4 data points per variables (e.g., proteins). If a degree of freedom (dof) is set to cv, cross validation is performed on each variable to identify the optimal dof for that variable. If dof set to cv.global, the mean of all cross-validated DoFs is used for all variables. Lastly, dof can be set to a fixed numeric value predetermied by the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
preprocess_spline(
  dat,
  timepoints = NULL,
  dof = c("cv", "cv.global"),
  center.dat = TRUE,
  scale.dat = FALSE,
  verbose = FALSE,
  seed = NULL,
  ...
)

Arguments

dat

a time-series data matrix with m biomarkers as rows, over n time points (columns).

timepoints

a vector of time points for columns of dat.

dof

the degree of freedom in spline.smooth. By default, cv performs cross-validation per-variable.

center.dat

a logical specifying to center the input and denoised data. By default, TRUE.

scale.dat

a logical specifying to scale the input and denoised data. By default, FALSE.

verbose

a logical specifying to print the computational progress. By default, FALSE.

seed

a seed for the random number generator.

...

optional arguments.

Value

preprocess_spline returns an imputed data, a denoised and imputed data data, and a vector of degrees of freedom.

Author(s)

Neo Christopher Chung nchchung@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data(cys_optm)
meta <- cys_optm[,1:4]
optm <- log(cys_optm[meta$Select,5:10])
optm <- t(scale(t(optm), scale=TRUE, center=TRUE))
days <- as.numeric(colnames(optm))

preprocessed_optm <- preprocess_spline(optm, timepoints = days, dof="cv")

## End(Not run)

UCLA-BD2K/CV.Signature.TCP documentation built on May 15, 2020, 11:27 p.m.