Learn R Programming

RNAseqQC (version 0.2.1)

plot_gene: Plot a gene

Description

Plot a gene

Usage

plot_gene(
  gene,
  dds,
  x_var = NULL,
  color_by = NULL,
  point_alpha = 0.7,
  point_rel_size = 2,
  show_plot = TRUE
)

Value

The function displays the plot and returns invisible the data frame of expression values and colData annotation for the gene.

Arguments

gene

A gene ID or gene name, i.e. an element of rownames(dds) or of rowData(dds)$gene_name

dds

a DESeqDataSet

x_var

Variable to plot on the x-axis. If NULL, then each sample is plotted separately.

color_by

Variable (column in colData(dds)) to color points by.

point_alpha

alpha value of geom_point()

point_rel_size

relative size of geom_point()

show_plot

Whether to show the plot or not

Examples

Run this code
library("DESeq2")
set.seed(1)
dds <- makeExampleDESeqDataSet()
colData(dds)$type <- c("A","A","A","B","B","B")
colData(dds)$patient <- c("1","1","2","2","3","3")
dds <- estimateSizeFactors(dds)
plot_gene("gene1", dds)
plot_gene("gene1", dds, x_var="patient", color_by="type")

Run the code above in your browser using DataLab