plotInfReps: Plot inferential replicates for a gene or transcript

Description Usage Arguments Value Examples

View source: R/plots.R

Description

For datasets with inferential replicates, boxplots are drawn for the two groups and potentially grouped by covariates. For datasets with only mean and variance, points and intervals (95 approximation) are drawn.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
plotInfReps(
  y,
  idx,
  x,
  cov = NULL,
  colsDrk = c("dodgerblue", "goldenrod4", "royalblue4", "red3", "purple4", "darkgreen"),
  colsLgt = c("lightblue1", "goldenrod1", "royalblue1", "salmon1", "orchid1",
    "limegreen"),
  xaxis,
  xlab,
  ylim,
  main,
  mainCol,
  legend = FALSE,
  legendPos = "topleft",
  legendTitle = FALSE,
  legendCex = 1,
  useMean = TRUE,
  applySF = FALSE,
  reorder,
  thin
)

Arguments

y

a SummarizedExperiment (see swish)

idx

the name or row number of the gene or transcript

x

the name of the condition variable for splitting and coloring the samples or cells. Also can be a numeric, e.g. pseudotime, in which case, cov can be used to designate groups for coloring

cov

the name of the covariate for adjustment

colsDrk

dark colors for the lines of the boxes

colsLgt

light colors for the inside of the boxes

xaxis

logical, whether to label the sample numbers. default is TRUE if there are less than 30 samples

xlab

the x-axis label

ylim

y limits

main

title

mainCol

name of metadata column to use for title (instead of rowname)

legend

logical, show simple legend (default FALSE)

legendPos

character, position of the legend (default "topleft")

legendTitle

logical, whether to add the name of the grouping variable as a title on the legend (default FALSE)

legendCex

numeric, size of the legend (default 1)

useMean

logical, when inferential replicates are not present, use the mean assay or the counts assay for plotting

applySF

logical, when inferential replicates are not present, should y$sizeFactor be divided out from the mean and interval plots (default FALSE)

reorder

logical, should points within a group defined by condition and covariate be re-ordered by their count value (default is FALSE, except for alevin data)

thin

integer, should the mean and interval lines be drawn thin (the default switches from 0 [not thin] to 1 [thinner] at n=150 cells, and from 1 [thinner] to 2 [thinnest] at n=400 cells)

Value

nothing, a plot is displayed

Examples

1
2
3
4
5
6
y <- makeSimSwishData()
plotInfReps(y, 3, "condition")

y <- makeSimSwishData(n=40)
y$batch <- factor(rep(c(1,2,3,1,2,3),c(5,10,5,5,10,5)))
plotInfReps(y, 3, "condition", "batch")

fishpond documentation built on Nov. 8, 2020, 7:54 p.m.