plot_tree_pa | R Documentation |
Plots a phylogeny alongside a presence/absence matrix of user selected genes.
plot_tree_pa(
tree,
pa,
genes = colnames(pa),
align = TRUE,
order = TRUE,
plot_titles = c("phylogeny", "gene presence/absence"),
text_size = 14,
label_genes = TRUE,
label_tips = TRUE,
cols = NULL
)
tree |
a phylogeny in 'phylo' format |
pa |
binary presence/absence matrix |
genes |
a vector of gene to include in the plot. Must be a subset of colnames(pa) |
align |
whether or not to align the tips of the phylogeny with the presence/absence matrix using dotted lines |
order |
whether to order the genes based upon their presence/absence pattern |
plot_titles |
the subplot titles (default=c('phylogeny', 'gene presence/absence')) |
text_size |
adjusts the size of text in the plot |
label_genes |
whether to print the gene labels in the presence/absence matrix |
label_tips |
whether to print the tree tip labels |
cols |
colours for the gene presence/absence matrix. These will be recycled if #genes > #colours. |
a patchwork object plotting the phylogeny alongside the gene presence/absence matrix
sim <- simulate_pan(rate=1e-3)
genes <- colnames(sim$pa)[which(apply(sim$pa, 2, sd)>0.2)]
plot_tree_pa(sim$tree, sim$pa, genes=genes,
label_genes=FALSE, label_tips=FALSE, cols='black')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.