Description Usage Arguments Details Value Examples
'make_design_matrix()' creates a model matrix for your DE analysis.
See model.matrix
for further details on what a design
(or model) matrix is. This function prints out the column names so that you
can view what your design matrix variable names are
1 | make_design_matrix(metadata, vars)
|
metadata |
cleaned metadata for RNAseq data |
vars |
a character vector of variables to include in the model these should be case-specific and match the variable names in the metadata |
The order in which you specify your variables will affect which variable is dummy coded as the reference variable.
a 'tbl' of the design matrix. Column names will be formatted as 'paste0(variablename, samplename)'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | make_design_matrix(metadata, "CellType")
make_design_matrix(metadata, c("CellType", "Status"))
# Results in a different design matrix
make_design_matrix(metadata, c("Status", "CellType"))
# In a pipeline
counts <- readr::read_delim("data/GSE60450_Lactation-GenewiseCounts.txt", delim = "\t")
meta <- readr::read_delim("data/SampleInfo_Corrected.txt", delim = "\t") %>%
mutate(FileName = stringr::str_replace(FileName, "\\.", "-"))
my_design <- check_sample_names(counts, c(1,2), meta, FileName) %>%
purrr::pluck("meta") %>%
make_design_matrix(., c("CellType"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.