gganatogram: gganatogram

Description Usage Arguments Examples

View source: R/gganatogram.R

Description

This function plots anatograms of specified tissues, species, and sex .

Usage

1
2
3
gganatogram(data = NULL, outline = TRUE, fillOutline = "lightgray",
  organism = "human", sex = "male", fill = "colour",
  anatogram = NULL, ggplot2_only = FALSE)

Arguments

data

The main data frame consisting of what organs to plot, colours, and values. Default is NULL

outline

logical indicating if the outline of the organism should be plotted

fillOutline

Fill colour of outline. Default is #a6bddb

organism

The organism to be plotted. Currently, only human is accepted.

sex

Sex of the organism

fill

How to fill

anatogram

A list, similar to hgMale_list that will create the outline and has the corresponding organ data.frames in that list

ggplot2_only

If TRUE, will try to use only ggplot2 functionality

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
library(ggplot2)
#First lets just plot the outline. Only male human is possible now
gganatogram(fillOutline='#a6bddb', organism='human',
sex='male', fill="colour")

gganatogram(fillOutline='#a6bddb', organism='human',
sex='female', fill="colour")

gganatogram(fillOutline='#a6bddb', organism='mouse',
sex='Male', fill="colour")


#To add organs, create a data frame with specified tissues


organPlot <- data.frame(organ = c("heart", "leukocyte", "nerve", "brain",
     "liver", "stomach", "colon"),
 type = c("circulation", "circulation",
     "nervous system", "nervous system", "digestion", "digestion",
     "digestion"),
 colour = c("red", "red", "purple", "purple", "orange",
     "orange", "orange"),
 value = c(10, 5, 1, 8, 2, 5, 5),
 stringsAsFactors=FALSE)


gganatogram(data=organPlot, fillOutline='#a6bddb',
 organism='human', sex='male', fill="colour")


#We can also remove the outline
oplot = gganatogram(data=organPlot, outline=FALSE, fillOutline='#a6bddb',
organism='human', sex='male', fill="colour")
oplot

oplot + facet_wrap(~type)

library(dplyr)
organPlot %>%
     dplyr::filter(type %in% 'circulation') %>%
 gganatogram(fillOutline='#a6bddb', organism='human',
 sex='male', fill="colour")

organPlot %>%
     dplyr::filter(type %in% c('circulation', 'nervous system')) %>%
 gganatogram(fillOutline='#a6bddb', organism='human',
 sex='male', fill="value") +
 theme_void() +
 scale_fill_gradient(low = "white", high = "red")


#Use hgMale_key to find all tissues to plot
hgMale_key = gganatogram::hgMale_key
head(hgMale_key)
all_tissues = gganatogram(data=hgMale_key, fillOutline='#a6bddb',
organism='human', sex='male', fill="colour")
all_tissues + theme_void()

all_tissues + theme_void() + facet_wrap(~type, ncol=3)


col_fill = gganatogram(data=hgMale_key, fillOutline='#a6bddb',
organism='human', sex='male', fill="colour")
col_fill
val_fill = gganatogram(data=hgMale_key, fillOutline='#a6bddb',
organism='human', sex='male', fill="value")
val_fill

col_fill +facet_wrap(~type, ncol=3) + theme_void()

neuroconductor-devel-releases/gganatogram documentation built on May 21, 2020, 1:03 p.m.