ScatterView: Scatter plot

View source: R/ScatterView.R

ScatterViewR Documentation

Scatter plot

Description

Scatter plot supporting groups.

Usage

ScatterView(
  data,
  x = "x",
  y = "y",
  label = 0,
  model = c("none", "ninesquare", "volcano", "rank")[1],
  x_cut = NULL,
  y_cut = NULL,
  slope = 1,
  intercept = NULL,
  auto_cut = FALSE,
  auto_cut_x = auto_cut,
  auto_cut_y = auto_cut,
  auto_cut_diag = auto_cut,
  groups = NULL,
  group_col = NULL,
  groupnames = NULL,
  label.top = TRUE,
  top = 0,
  toplabels = NULL,
  display_cut = FALSE,
  color = NULL,
  shape = 16,
  size = 1,
  alpha = 0.6,
  main = NULL,
  xlab = x,
  ylab = y,
  legend.position = "none",
  ...
)

Arguments

data

Data frame.

x

A character, specifying the x-axis.

y

A character, specifying the y-axis.

label

An integer or a character specifying the column used as the label, default value is 0 (row names).

model

One of "none" (default), "ninesquare", "volcano", and "rank".

x_cut

An one or two-length numeric vector, specifying the cutoff used for x-axis.

y_cut

An one or two-length numeric vector, specifying the cutoff used for y-axis.

slope

A numberic value indicating slope of the diagonal cutoff.

intercept

A numberic value indicating intercept of the diagonal cutoff.

auto_cut

Boolean or numeric, specifying how many standard deviation will be used as cutoff.

auto_cut_x

Boolean or numeric, specifying how many standard deviation will be used as cutoff on x-axis.

auto_cut_y

Boolean or numeric, specifying how many standard deviation will be used as cutoff on y-axis

auto_cut_diag

Boolean or numeric, specifying how many standard deviation will be used as cutoff on diagonal.

groups

A character vector specifying groups. Optional groups include "top", "mid", "bottom", "left", "center", "right", "topleft", "topcenter", "topright", "midleft", "midcenter", "midright", "bottomleft", "bottomcenter", "bottomright".

group_col

A vector of colors for specified groups.

groupnames

A vector of group names to show on the legend.

label.top

Boolean, specifying whether label top hits.

top

Integer, specifying the number of top terms in the groups to be labeled.

toplabels

Character vector, specifying terms to be labeled.

display_cut

Boolean, indicating whether display the dashed line of cutoffs.

color

A character, specifying the column name of color in the data frame.

shape

A character, specifying the column name of shape in the data frame.

size

A character, specifying the column name of size in the data frame.

alpha

A numeric, specifying the transparency of the dots.

main

Title of the figure.

xlab

Title of x-axis

ylab

Title of y-axis.

legend.position

Position of legend, "none", "right", "top", "bottom", or a two-length vector indicating the position.

...

Other available parameters in function 'geom_text_repel'.

Value

An object created by ggplot, which can be assigned and further customized.

Author(s)

Wubing Zhang

Examples

file3 = file.path(system.file("extdata", package = "MAGeCKFlute"),
"testdata/mle.gene_summary.txt")
dd = ReadBeta(file3)
ScatterView(dd, x = "Pmel1_Ctrl", y = "Pmel1", label = "Gene",
auto_cut = 1, groups = "topright", top = 5, display_cut = TRUE)
ScatterView(dd, x = "Pmel1_Ctrl", y = "Pmel1", label = "Gene",
auto_cut = 2, model = "ninesquare", top = 5, display_cut = TRUE)


WubingZhang/MAGeCKFlute documentation built on Jan. 27, 2024, 2:43 p.m.