plot_genes: Plot boxplots and dotplots for genes and variables of...

View source: R/plot_genes.R

plot_genesR Documentation

Plot boxplots and dotplots for genes and variables of interest

Description

Plot boxplots and dotplots for genes and variables of interest

Usage

plot_genes(
  dat = NULL,
  counts = NULL,
  meta = NULL,
  genes = NULL,
  fdr = NULL,
  libraryID = "libID",
  geneID = "ensembl_gene_id",
  subset_genes = NULL,
  variables,
  colorID = NULL,
  processors = NULL,
  subset.genes = NULL
)

Arguments

dat

DGEList or EList object with expression data (counts, E), sample metadata (samples, targets), and gene annotation (genes)

counts

If dat not provided. Data frame of gene expression. Genes are rows, samples are columns. geneID must be rownames or first column

meta

If dat not provided. Data frame of sample meta data with samples as rows.

genes

Optional if dat not provided. Data frame of gene annotation with genes as rows.

fdr

Optional. Model results output by kmFit( ). Used to label significant differences

libraryID

Character string of variable name to use when combining expression and sample data

geneID

Character string of variable name to use when combining expression and gene data

subset_genes

Optional. Character vector of genes to plot. Must match names in geneID column. If not provided, all genes are plotted.

variables

Character vector of variable names to include in plot. Variables can be character, factor, or numeric. One two-variable interaction term allowed

colorID

Optional. Character string for variable to color point by

processors

Numeric processors to run in parallel. Default is 2 less than the total available

subset.genes

Deprecated form of subset_genes

Value

List of ggplot objects

Examples

#Data from kimma
example.voom <- kimma::example.voom

subset_genes <- c("ENSG00000250479","ENSG00000250510","ENSG00000255823")

plot_genes(dat = example.voom, fdr = example.model$lmerel,
     subset_genes = subset_genes, geneID="geneName",
     variables = c("virus*asthma", "lib.size"), colorID = "virus")

BIGslu/BIGpicture documentation built on Oct. 14, 2024, 9:30 p.m.