plot_gene_pair: Scatter plot of two gene expressions

View source: R/plotting.R

plot_gene_pairR Documentation

Scatter plot of two gene expressions

Description

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

Usage

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 facet_wrap for details.

Value

Returns the generated plot.

Examples


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:50, 1:10]
treatment1 <- rnaseq[51:100, 1:10]
treatment2 <- rnaseq[101:150, 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")


SeqNet documentation built on Oct. 10, 2026, 5:06 p.m.