ezXYScatter.2: XYScatter plot

View source: R/plots.R

ezXYScatter.2R Documentation

XYScatter plot

Description

Plot the interactive XYScatter plot or XYScatter plot with labelled genes.

Usage

  ezXYScatter.2(xVec, yVec, absentColor = "gray", shrink = FALSE, 
                xlim = range(xVec, yVec, na.rm = TRUE), 
                ylim = xlim, isPresent = NULL, names = NULL, types = NULL, 
                colors = rainbow(ncol(types)), main = NULL, 
                xlab = NULL, ylab = NULL, labelGenes = NULL,
                mode = c("plotly", "ggplot2"))

Arguments

xVec

numeric(n): the group means of one group.

yVec

numeric(n): the group means of another group.

absentColor

character(1): the colour for absent genes.

shrink

boolean(1): shrink the group means or not.

xlim

numeric(2): the range of xaxis.

ylim

numeric(2): the range of yaxis.

isPresent

boolean(n): the genes are expressed or not.

names

character(n): the gene names.

types

data.frame of boolean: indices for each type per column.

colors

colors for the types.

main

character(1): the title.

xlab, ylab

character(1): the xlab and ylab.

labelGenes

character(n): subset of names to label.

mode

generate interactive plot with ‘plotly’ or static plot with ‘ggplot2’. To label the genes, only ‘ggplot2’ is supported.

Value

A plotly or ggplot2 object.

Author(s)

Ge Tan

See Also

ezVolcano

Examples

  sampleValues <- c(0.28, 0.87, 31.70, 361.18)
  refValues <- c(0.27, 0.60, 28.81, 364.13)
  isPresent <- c(TRUE, TRUE, FALSE, TRUE)
  types <- data.frame(Significants=c(TRUE, FALSE, FALSE, TRUE),
	                    ZincFingers=c(TRUE, FALSE, FALSE, FALSE))
  names <- c("SALL1", "PAX6", "IRX3", "MEIS1")
  xlab <- "A"
  ylab <- "B"
  main="Comparison of average expression"
  
  p_plotly <- ezXYScatter.2(xVec=refValues, yVec=sampleValues,
                            isPresent=isPresent, 
                            types=types, names=names,
                            xlab=xlab, ylab=ylab,
                            main="Comparison of average expression",
                            labelGenes=c("SALL1", "IRX3"),
                            mode="plotly")

  p_ggplot2 <- ezXYScatter.2(xVec=refValues, yVec=sampleValues,
                             isPresent=isPresent, 
                             types=types, names=names,
                             xlab=xlab, ylab=ylab,
                             main="Comparison of average expression",
                             labelGenes=c("SALL1", "IRX3"),
                             mode="ggplot2")

uzh/ezRun documentation built on April 24, 2024, 4:01 p.m.