deseq: Conduct a differential expression analysis using...

Description Usage Arguments Value See Also Examples

View source: R/differential-expression.R

Description

This function is designed to ingest data in the form output by functions like get_bw_data().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
deseq(
  data,
  condition,
  batch = NULL,
  genes = NULL,
  shrink = FALSE,
  padj_method = stats::p.adjust.methods[1],
  quick = FALSE,
  n_cores = 1,
  quiet = FALSE
)

Arguments

data

A data frame where rows are samples and columns are genes and metadata.

condition

A string. The name of the column in data which contains the condition on which the differential expression is premised. This column should be logical or a factor with two levels. The first level (or FALSE) is the baseline and the second level (or TRUE) is the disease/treatment.

batch

A string. The name of the column in data specifying the batches that you'd like the model to account for. A common choice is a cohort column.

genes

A character vector. The column names that contain the genes for the differential expression. If NULL, any genes in data found in mirmisc::get_gene_names() are used.

shrink

A flag. If FALSE (the default), DESeq2::results() will be used. Otherwise, DESeq2::lfcShrink() will be used.

padj_method

A string. The method of adjusting the p-values for multiple hypothesis testing. Must be one of stats::p.adjust.methods().

quick

A flag. If TRUE, the base_med, case_med, base_mean and case_mean columns are omitted from the return and the lack of need to calculate these medians offers a small speedup.

n_cores

The number of cores for parallel processing.

quiet

A flag. Suppresses messages.

Value

A tibble with 8 columns:

See Also

Other differential expression methods: cor_de(), edger()

Examples

1
2
3
4
5
6
bwms_data <- get_combined_cohort_data(
  c("bw", "ms"),
  gene_predicate = ~ stats::median(.) > 0
) %>%
  dplyr::filter(!is.na(meta_pre_eclampsia))
deseq(bwms_data, "meta_pre_eclampsia", batch = "cohort")

mirvie/mirmodels documentation built on Jan. 14, 2022, 11:12 a.m.