rankPlot: Rankplot for given column.

Description Usage Arguments Value Examples

View source: R/plot.R

Description

Rankplot for given column.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rankPlot(
  data,
  order_col = "log2FoldChange",
  midpoint = 0,
  saveplot = NULL,
  label = NULL,
  alpha = 0.5,
  colorvector = c("green", "yellow", "red"),
  width = 13.5,
  height = 15,
  ...
)

Arguments

data

A dataframe with effective row names.

order_col

Specify which column would be used for plot. Default "log2FoldChange".

midpoint

Specify the midpoint for color show. Default 0.

saveplot

Save plot to given file "a.pdf", "b.png".

label

Label points. Accept a number to get top x points to label (both directions). Or a vector matched with rownames of dataframe to label specified points. Or a named vector to label specified points with new names.

alpha

Transparency value.

colorvector

A vector with length 2 to speicfy low and high colors. Or a vector with length 3 to specify low, middle and high colors. Default c("green","yellow","red").

width

Picture width in "cm".

height

Picture height in "cm".

...

Additional parameters given to pheatmap like "width", "height", .etc.

Value

A ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
a <- data.frame(log2FoldChange=rnorm(1000), row.names=paste0("YSX",1:1000))

## Raw plot

rankPlot(a)

## Label top 10

rankPlot(a, label=10)

## Label specified points

rankPlot(a, label=c("YSX1","YSX2","YSX10"))

## Label specified points with new names

b <- c("A","B","C")
names(b) <- c("YSX1","YSX2","YSX10")
rankPlot(a, label=b)

Tong-Chen/YSX documentation built on Jan. 25, 2021, 2:49 a.m.