# NOT RUN {
# Get a phylogeny for a taxonomic rank
surgeons <- fishtree_phylogeny(rank = "Acanthuridae")
# Get a phylogeny for only certain species
genomic_fish <- c("Oryzias latipes", "Tetraodon nigroviridis",
"Gasterosteus aculeatus", "Danio rerio")
fishtree_phylogeny(species = genomic_fish)
# Chronograms may not be ultrametric due to numerical precision issues
# Consider using phytools::force.ultrametric
ape::is.ultrametric(surgeons)
ape::is.ultrametric(surgeons, tol = 0.00001)
# Difference between MRCA trees and regular trees
gobies_mrca <- fishtree_phylogeny(rank = "Gobiidae", type = "chronogram_mrca")
gobies <- fishtree_phylogeny(rank = "Gobiidae", type = "chronogram")
# MRCA trees will have more tips for non-monophyletic groups
length(gobies_mrca$tip.label) > length(gobies$tip.label)
# Drop rogue tips in the MRCA tree
rogue_gobies <- fishtree_rogues("Gobiidae")
pruned_gobies <- ape::drop.tip(gobies_mrca, rogue_gobies)
# Now the trees are identical
setequal(gobies$tip.label, pruned_gobies$tip.label)
# }
Run the code above in your browser using DataLab