Estimate cyclic trends of gene expression levels using training data.

cycle_npreg_insample(
  Y,
  theta,
  ncores = 2,
  polyorder = 2,
  method.trend = c("trendfilter", "loess", "bspline")
)

Arguments

Y

A matrix (gene by sample) of normalized and transformed gene expression values.

theta

A vector of angles.

ncores

We use the doParallel package for parallel computing.

polyorder

We estimate cyclic trends of gene expression levels using nonparamtric trend filtering.

method.trend

How to estimate cyclic trend of gene expression values. We offer three options: method.trend = "trendfilter", uses fit_trendfilter, method.trend = "loess" uses fit_loess), and method.trend = "bsplines" uses fit_bspline. We found that "trendfilter" provided the best fits in our experiments. However, trend-filtering may require more computational effort since it uses cross-validation, so for fast results we recommend using "bspline".

Value

A list with four elements:

Y

The gene expression marix.

theta

Vector of angles or cell cycle phases.

sigma_est

Estimated standard error of the cyclic trend for each gene.

funs_est

A list of functions for approximating the cyclic trends of gene express levels for each gene.

See also

cycle_npreg_mstep for estimating cyclic functions given inferred phases from cycle_npreg_loglik, and cycle_npreg_outsample for predicting cell cycle phase using parameters learned from cycle_npreg_insample.

Examples

# See \code{help(cycle_npreg_outsample)} for an example.