plotDotplot: Creating a dotplot

Description Usage Arguments Value Examples

View source: R/visualize.R

Description

Plot a dotplot

Usage

1
2
3
4
5
6
plotDotplot(barycoords, Gdiffexp = rownames(barycoords), Goi = NULL,
  Coi = attr(barycoords, "conditions"), colorby = "diffexp",
  colorvalues = NULL, rmax = 5, showlabels = TRUE,
  sizevalues = stats::setNames(c(0.5, 2), c(FALSE, TRUE)),
  alphavalues = stats::setNames(c(0.8, 0.8), c(FALSE, TRUE)),
  barycoords2 = NULL, baseangle = 0)

Arguments

barycoords

Dataframe containing for every gene its barycentric coordinates, as returned by transformBarycentric

Gdiffexp

Differentially expressed genes

Goi

Genes of interest, a character or numeric vector to plot one set of genes, a named list containing different such vectors to plot multiple gene sets

Coi

Character vector specifying the names of the three biological conditions, used for labelling

colorby

Color by differential expression ("diffexp") or by log fold-change ("z")

colorvalues

Color values, different syntax depending on the colorby parameter:

  • diffexp: Named list with colors. First part of the name denotes whether a gene is differentially expressed ('diffexp' or 'nodiffexp'). The second part denotes the name of the gene set. Genes not within a gene set are denoted by 'all'.
    For example: list(diffexpall="#000000", nodiffexpall="#AAAAAA", nodiffexpgset="#FFAAAA", diffexpgset="#FF0000")

  • z: A character vector of color values, used to generate the color gradient

rmax

Number denoting the maximal radius of the grid. All points outside of the grid will be clipped on the boundaries.

showlabels

Whether to show labels on the grid

sizevalues

Named list with the size of each dot if differentially expressed (TRUE) or not (FALSE)

alphavalues

Named list with the alpha value of each dot if differentially expressed (TRUE) or not (FALSE)

barycoords2

Dataframe containing for every gene a second set of barycentric coordinates, as returned by transformBarycentric. An arrow will be drawn from the coordinates in 'barycoords' to those in 'barycoords2'

baseangle

The angle by which to rotate the whole plot (default to 0)

Value

A ggplot2 plot, which can be used for further customization

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(vandelaar)
Eoi <- limma::avearrays(vandelaar, Biobase::phenoData(vandelaar)$celltype)
Eoi = Eoi[,c("YS_MF", "FL_mono", "BM_mono")]
barycoords = transformBarycentric(Eoi)
plotDotplot(barycoords)

Eoi = matrix(rnorm(1000*3, sd=0.5), 1000, 3, dimnames=list(1:1000, c(1,2,3)))
Eoi[1:100,1] = Eoi[1:100,1] + 1
barycoords = transformBarycentric(Eoi)
Gdiffexp =(1:1000)[barycoords$r > 1]
plotDotplot(barycoords)
plotDotplot(barycoords, Gdiffexp)
plotDotplot(barycoords, Gdiffexp, 1:100)
plotDotplot(barycoords, Gdiffexp, list(a=1:100, b=sample(100:1000, 50)))

saeyslab/triwise documentation built on May 25, 2017, 11:31 p.m.