Learn R Programming

glmmSeq (version 0.2.0)

lmmSeq: Linear mixed models for data matrix

Description

Linear mixed models for data matrix

Usage

lmmSeq(
  modelFormula,
  maindata,
  metadata,
  id,
  sizeFactors = NULL,
  reducedFormula = "",
  modelData = NULL,
  designMatrix = NULL,
  control = lmerControl(),
  cores = 1,
  removeDuplicatedMeasures = FALSE,
  removeSingles = FALSE,
  verbose = TRUE,
  returnList = FALSE,
  progress = TRUE,
  ...
)

Value

Returns an S4 class lmmSeq object with results for gene-wise general linear mixed models or a list of results if returnList is TRUE.

Arguments

modelFormula

the model formula. This must be of the form "~ ..." where the structure is assumed to be "gene ~ ...". The formula must include a random effects term. For more information on formula structure for random effects see lme4::lmer()

maindata

data matrix with genes in rows and samples in columns

metadata

a dataframe of sample information with variables in columns and samples in rows

id

Column name in metadata which contains the sample IDs to be used in pairing samples

sizeFactors

size factors (default = NULL). If provided the glmer offset is set to log(sizeFactors). For more information see lme4::glmer()

reducedFormula

Reduced design formula (default = "")

modelData

Expanded design matrix

designMatrix

custom design matrix

control

the glmer control (default = glmerControl(optimizer = "bobyqa")). For more information see lme4::glmerControl().

cores

number of cores to use. Default = 1.

removeDuplicatedMeasures

whether to remove duplicated conditions/repeated measurements for a given time point (default = FALSE).

removeSingles

whether to remove individuals with only one measurement (default = FALSE)

verbose

Logical whether to display messaging (default = TRUE)

returnList

Logical whether to return results as a list or lmmSeq object (default = FALSE).

progress

Logical whether to display a progress bar

...

Other parameters to pass to lme4::glmer()

Examples

Run this code
data(PEAC_minimal_load)
logtpm <- log2(tpm +1)
lmmtest <- lmmSeq(~ Timepoint * EULAR_6m + (1 | PATID),
                     id = "PATID",
                     maindata = logtpm["MS4A1", ],
                     metadata = metadata,
                     verbose = FALSE)
names(attributes(lmmtest))

Run the code above in your browser using DataLab