# \donttest{
# Standard ancestral state reconstruction example with various aesthetics
# process file
file <- system.file("extdata",
"comp_method_disc/ase_freeK.tree",
package="RevGadgets")
example <- processAncStates(file,
state_labels = c("1" = "Awesome",
"2" = "Beautiful",
"3" = "Cool!"))
# have states vary by color and indicate state pp with size (default)
plotAncStatesMAP(t = example)
# have states vary by color and indicate state pp with size ,
# and add a timeline
plotAncStatesMAP(t = example, timeline = TRUE)
# have states vary by color and symbol, label nodes with pp of states
plotAncStatesMAP(t = example, node_shape_as = "state",
node_size = 4, node_shape = c(15, 17,20),
node_size_as = NULL, node_labels_as = "state_posterior")
# black and white figure - state as symbols and state pp with text
plotAncStatesMAP(t = example, node_color_as = NULL,
node_shape_as = "state", node_shape = c(15, 17,20),
node_size_as = NULL, node_size = 4,
node_labels_as = "state_posterior",
node_color = "grey", state_transparency = 1)
# default with circular tree
plotAncStatesMAP(t = example, tree_layout = "circular")
# Chromosome evolution example
# process file
file <- system.file("extdata",
"chromo/ChromEvol_simple_final.tree",
package="RevGadgets")
chromo_example <- processAncStates(file, labels_as_numbers = TRUE)
# plot
plotAncStatesMAP(t = chromo_example, node_color_as = "state_posterior",
node_size_as = "state", node_color = colFun(2),
tip_labels_offset = 0.005, node_labels_as = "state",
node_labels_offset = 0, tip_labels_states = TRUE,
tip_labels_states_offset = 0, tip_states = FALSE)
# DEC example (cladogenetic)
# process file
file <- system.file("extdata", "dec/simple.ase.tre", package="RevGadgets")
labs <- c("1" = "K", "2" = "O", "3" = "M", "4" = "H", "5" = "KO",
"6" = "KM", "7" = "OM", "8" = "KH", "9" = "OH", "10" = "MH", "11" = "KOM",
"12" = "KOH", "13" = "KMH", "14" = "OMH", "15" = "KOMH")
dec_example <- processAncStates(file, state_labels = labs)
# plot
plotAncStatesMAP(t = dec_example,
cladogenetic = TRUE,
tip_labels_offset = 0.5)
# }
Run the code above in your browser using DataLab