plot_gene_pair: Scatter plot of two gene expressions

Description Usage Arguments Value Examples

View source: R/plotting.R

Description

Plots the expression of two genes for visual assessment of association.

Usage

1
2
plot_gene_pair(x_list, geneA, geneB, method = "loess", se_alpha = 0.1,
  do_facet_wrap = FALSE, scales = "fixed")

Arguments

x_list

A named list containing one or more n by p gene expression profiles, one for each group or subpopulation under consideration.

geneA

The name of the first gene to plot. Must be either a character string matching a column name in each matrix of x_list or an integer to index the columns.

geneB

The name of the second gene to plot. Must be either a character string matching a column name in each matrix of x_list or an integer to index the columns.

method

Charater string either "lm" or "loess" used for plotting. For no line, set method = NULL.

se_alpha

Sets transparancy of confidence interval around association trend line. Set to 0 to remove the confidence interval.

do_facet_wrap

If TRUE, the groups are plotted in seperate graphs.

scales

Only used if do_facet_wrap is TRUE. See ggplot2::facet_wrap for details.

Value

Returns the generated plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(reference)
rnaseq <- reference$rnaseq
genes <- colnames(rnaseq)
plot_gene_pair(rnaseq, genes[1], genes[2])
# Suppose we had multiple data frames.
control <- rnaseq[1:100, 1:10]
treatment1 <- rnaseq[101:200, 1:10]
treatment2 <- rnaseq[201:250, 1:10]
plot_gene_pair(list(ctrl = control, trt1 = treatment1, trt2 = treatment2),
               genes[1], genes[2], method = NA)
plot_gene_pair(list(ctrl = control, trt = treatment1),
               genes[1], genes[2], do_facet_wrap = TRUE, method = "lm")

tgrimes/SeqNet documentation built on Sept. 1, 2020, 7:50 a.m.