MASC: Mixed effect modeling

Description Usage Arguments Value Examples

View source: R/MASC.R

Description

MASC was imported from https://github.com/immunogenomics/masc. Performs mixed-effect modeling.

Usage

1
2
3
4
5
6
7
8
MASC(
  dataset,
  cluster,
  contrast,
  random_effects = NULL,
  fixed_effects = NULL,
  verbose = FALSE
)

Arguments

dataset

data frame of covariate, cell type, clustering or disease information

cluster

celltypes returned by Signac or cluster identities

contrast

Typically disease

random_effects

User specified random effect variables in dataset

fixed_effects

User specific fixed effects in dataset

verbose

If TRUE, algorithm reports outputs

Value

mixed effect model results

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Load metadata
file.dir = "https://kleintools.hms.harvard.edu/tools/client_datasets/"
file = "AMP_Phase1_SLE_Apr2019/FullDataset_v1/categorical_coloring_data.json"
download.file(paste0(file.dir, file, "?raw=true"), destfile = "categorical_coloring_data.json")
d = rjson::fromJSON(file='categorical_coloring_data.json')
d = data.frame(sapply(d, function(x) x$label_list))

# run MASC
x = d$CellStates # optionally use clusters or cell types
d$Disease = factor(d$Disease) # the contrast term must be encoded as a factor
Q = MASC(d, cluster = x, contrast = 'Disease', random_effects = c( "Tissue", "Plate", "Sample"))

## End(Not run)

SignacX documentation built on Nov. 18, 2021, 5:07 p.m.