# Load the predefined B matrices of the package
B_mats <- GeRnika::B_mats
B_real <- B_mats[[2]]$B_real
B_alg1 <- B_mats[[2]]$B_alg1
# Generate the tags for the genes of
# the phyogenetic tree
tags <- LETTERS[1:nrow(B_real)]
# Instantiate two \code{Phylotree} class objects on
# the basis of the B matrices
phylotree_real <- B_to_phylotree(
B = B_real,
labels = tags)
phylotree_alg1 <- B_to_phylotree(
B = B_alg1,
labels = tags)
# Create the consensus tree between phylotree_real
# and phylotree_alg1
consensus <- combine_trees(
phylotree_1 = phylotree_real,
phylotree_2 = phylotree_alg1)
# Render the consensus tree
DiagrammeR::render_graph(consensus)
# Load another palette
palette_1 <- GeRnika::palettes$Lancet
# Create the consensus tree between phylotree_real
# and phylotree_alg1 using tags and another palette
consensus_tag <- combine_trees(
phylotree_1 = phylotree_real,
phylotree_2 = phylotree_alg1,
palette = palette_1,
labels = TRUE)
# Render the consensus tree using tags and the
# selected palette
DiagrammeR::render_graph(consensus_tag)
Run the code above in your browser using DataLab