Learn R Programming

glmmSeq (version 0.0.1)

glmmSeq: Glmm for sequencing results

Description

Glmm for sequencing results

Usage

glmmSeq(
  modelFormula,
  countdata,
  metadata,
  id,
  dispersion,
  sizeFactors = NULL,
  reducedFormula = "",
  modelData = NULL,
  control = glmerControl(optimizer = "bobyqa"),
  cores = 1,
  removeDuplicatedMeasures = FALSE,
  removeSingles = FALSE,
  zeroCount = 0.125,
  verbose = TRUE,
  ...
)

Arguments

modelFormula

the model formula. For more information of formula structure see lme4::glmer()

countdata

the sequencing count data

metadata

a data frame of sample information

id

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

dispersion

a numeric vector of gene dispersion

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

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)

zeroCount

numerical value to offset zeroes for the purpose of log (default=0.125)

verbose

Logical whether to display messaging (default=TRUE)

...

Other parameters to pass to lme4::glmer()

Value

Returns a GlmmSeq object with results for gene-wise general linear mixed models

Examples

Run this code
# NOT RUN {
data(PEAC_minimal_load)

disp <- apply(tpm, 1, function(x){
(var(x, na.rm=TRUE)-mean(x, na.rm=TRUE))/(mean(x, na.rm=TRUE)**2)
})

MS4A1glmm <- glmmSeq(~ Timepoint * EULAR_6m + (1 | PATID),
                     id = 'PATID',
                     countdata = tpm['MS4A1', ],
                     metadata = metadata,
                     dispersion = disp['MS4A1'],
                     verbose=FALSE)

names(attributes(MS4A1glmm))
# }

Run the code above in your browser using DataLab