# Load the predefined B matrices of the package
B_mats <- GeRnika::B_mats
B_real <- B_mats[[2]]$B_real
B_opt <- B_mats[[2]]$B_opt
# Generate the tags for the genes of
# the phyogenetic tree
tags <- LETTERS[1:nrow(B_real)]
# Instantiate two Phylotree class objects on
# the basis of the B matrices using tags
phylotree_real <- B_to_phylotree(
B = B_real,
labels = tags)
phylotree_opt <- B_to_phylotree(
B = B_opt,
labels = tags)
# find the set of common subtrees between both
# phylogenetic trees
find_common_subtrees(
phylotree_1 = phylotree_real,
phylotree_2 = phylotree_opt)
# find the set of common subtrees between both
# phylogenetic trees using tags
find_common_subtrees(
phylotree_1 = phylotree_real,
phylotree_2 = phylotree_opt,
labels = TRUE)
Run the code above in your browser using DataLab