mixedcirc_rrbs_voom_mixed: Transform RRBS data for linear mixed modelling (experimental)

mixedcirc_rrbs_voom_mixedR Documentation

Transform RRBS data for linear mixed modelling (experimental)

Description

This function is used to derive weights for RRBS data using linear mixed modelling.

Usage

mixedcirc_rrbs_voom_mixed(
  counts,
  formula,
  data,
  lib.size = NULL,
  chunk.size = 100,
  span = 0.5,
  plot = FALSE,
  save.plot = FALSE,
  quiet = FALSE,
  BPPARAM = bpparam(),
  ignore_missing = FALSE,
  ...
)

Arguments

counts

a class of methylBaseDB

formula

specifies variables for the linear (mixed) model. Must only specify covariates, e.g.: ~ a + b + (1|c). Formulas with only fixed effects also work, and fit() is run.

data

data.frame with columns corresponding to formula

lib.size

numeric vector containing total library sizes for each sample. This will be estimated based on RRBS data

chunk.size

the number of chunk to retrieve from the data at the same time

span

width of the lowess smoothing window as a proportion.

plot

logical, should a plot of the mean-variance trend be displayed?

save.plot

logical, should the coordinates and line of the plot be saved in the output?

quiet

suppress message, default FALSE

BPPARAM

parameters for parallel evaluation

ignore_missing

if TRUE, the missing values will be left as they are. Otherwise, they will be imputed by zero. Default: False

...

other arguments are passed to lmer

Details

In order to run this function correctly, one has to create an experimental design desired for rhythm analysis. The way that the regression is formulated for RRBS data is ~0+ replicate_id+ group:scaler + group:in:scaler + group:out:scaler this means that 'data' must contain replicate_id, scaler, in and out. 'replicate_id' is a factor showing identity of each unique replicate. 'scaler' is a numeric which is one (1) for methylated and zero (0) for unmethylated data 'in' is cos(2 * pi * time / period) 'out' is sin(2 * pi * time / period) 'group' is an optional (if differential rhythm analysis is done) two level factor that shows the grouping of the samples. If constructed correctly, the output of the function will be a list of two elemens (methylBaseDB) which can be used to extract the transformed methylated/unmethylated as well as the weights. The reason for this function is to solve the problem with high memory demand of RRBS data. If you have just a few loci, use can use 'voomWithDreamWeights' or 'voom' essentially using the same setup. By default NAs are imputed by zero. However if ignore_missing, the missing values are ignores. The later is not according to voom recommendation. Use at your own risk!

Value

A two element list each of which is methylBaseDB (same dimentions). * E: log2 transformed expression * W: weights


PayamEmami/mixedcirc documentation built on Jan. 15, 2025, 5:36 p.m.