Skip to contents

Plot for normalized counts of a single gene, with jittered points superimposed on the boxplot

Usage

ggplotCounts(
  dds,
  gene,
  intgroup = "condition",
  annotation_obj = NULL,
  transform = TRUE,
  labels_repel = TRUE
)

Arguments

dds

A DESeqDataSet object.

gene

A character, specifying the name of the gene to plot

intgroup

Interesting groups: a character vector of names in colData(dds) to use for grouping

annotation_obj

A data.frame object, with row.names as gene identifiers (e.g. ENSEMBL ids) and a column, gene_name, containing e.g. HGNC-based gene symbols. Optional.

transform

Logical value, corresponding whether to have log scale y-axis or not. Defaults to TRUE.

labels_repel

Logical value. Whether to use ggrepel's functions to place labels; defaults to TRUE.

Value

An object created by ggplot

Details

Note: this function relies on the plotCounts function of DESeq2, therefore pseudocounts of 0.5 are added to each point

Examples

library(airway)
#> Error in library(airway): there is no package called ‘airway’
data(airway)
#> Warning: data set ‘airway’ not found
airway
#> Error: object 'airway' not found
dds_airway <- DESeq2::DESeqDataSetFromMatrix(assay(airway),
                                             colData = colData(airway),
                                             design=~cell+dex)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'ncol': error in evaluating the argument 'x' in selecting a method for function 'assay': object 'airway' not found
ggplotCounts(dds_airway,
             gene = "ENSG00000103196", # CRISPLD2 in the original publication
             intgroup = "dex")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'dds_airway' not found