sp_vennDiagram2: Generating venDiagram plot

Description Usage Arguments Value Examples

Description

Generating venDiagram plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
sp_vennDiagram2(
  data,
  supplyNumbers = FALSE,
  header = TRUE,
  title = "",
  item_variable = NULL,
  set_variable = NULL,
  set_variable_order = NULL,
  color_for_circumference = "transparent",
  numVector = c(),
  labelVector = c(),
  manual_color_vector = c("dodgerblue", "goldenrod1", "darkorange1", "seagreen3",
    "orchid3"),
  alpha = 0.5,
  label_size = NULL,
  margin = NULL,
  filename = NULL,
  debug = FALSE,
  saveppt = FALSE,
  ...
)

Arguments

data

Data file (the first column is the name of genes or other things one want to compare, the second column is set name of each items, tab separated).

supplyNumbers

If you have the size of each set and the number overlaps between or among each set, please give TRUE here.

header

a logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: header is set to TRUE if and only if the first row contains one fewer field than the number of columns.

title

Title for the picture.

item_variable

Specify the column containing all items (one of column names of data).

set_variable

Specify the column containing set names (one of column names of data).

set_variable_order

Specify which sets to be plotted and their order (one of column names of data). (normally whole or a subset of unique values of column set_variable with order specified)

numVector

List of numbers for venn plot(used when supplyNumbers is true). For two-set venn, the format is "100, 110, 50" represents (length_a, length_b, a_b_overlap). For three-set venn, the format is "100, 110, 90, 50, 40, 40, 20" represents (length_a, length_b, length_c, a_b_overlap, b_c_overlap, a_c_overlap, a_b_c_overlap). For four-set venn, the format is "100, 110, 90, 50, 40, 40, 20" represents (length_a, length_b, length_c, a_b_overlap, a_c_overlap, a_d_overlap, b_c_overlap, b_d_overlap, c_d_overlap, abc_overlap, abd_overlap, acd_overlap, bcd_overlap, abcd_overlap).

labelVector

List of label for venn plot(used when supplyNumbers is true). Format: c('a', 'b')" for two-set and c('a', 'b', 'c') for three-set.

manual_color_vector

Color for each area. Ussally the number of colors should be equal to the number of labels (however the program will make them equal). If you manually set colors for 4-way venn diagram, the first color will be given to the leftmost set, the second will be given to the rightmost set, the third will be given to second leftmost and the forth will be given to the second rightmost. Colors like c('red', 'blue', '#6181BD') (number of colors not matter) or a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" "Set2" "Set3" "Blues" "BuGn" "BuPu" "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" (check http://www.sthda.com/english/wiki/colors-in-r for more).

alpha

Color transparency (0-1). 0: opaque; 1: transparent.

label_size

Siez of category names. Default system default.

margin

Number giving the amount of whitespace around the diagram in grid units. Default system default

...

Value

A grid object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
vennDiagram_test_data <- data.frame(elements=c("1","2","2","2","3"), sets=c("A","A","B","C","C"))
sp_vennDiagram(data = vennDiagram_test_data, label1 = "A",label2 = "B", label3 = "C")



sp_vennDiagram( supplyNumbers = TRUE,  numVector=c (120, 110, 50), labelVector=c('a','b'))



## Not run:
vennDiagram_data = "vennDiagram.data"
sp_vennDiagram2(data = vennDiagram_data, item_variable = "Gene", set_variable = "Sample",
set_variable_order = c("Set1","Set2","Set3", "Set4"))
## End(Not run)

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