View source: R/phylotree_class.R
plot_proportions | R Documentation |
This function plots a phylogenetic tree with nodes sized and colored according to the proportions of each clone. If a matrix of proportions is provided, multiple phylogenetic trees will be plotted, each corresponding to a row of proportions.
plot_proportions(phylotree, proportions, labels = FALSE)
phylotree |
A |
proportions |
A numeric vector or matrix representing the proportions of each clone in the phylogenetic tree. If a matrix is provided, each row should represent the proportions for a separate tree. |
labels |
A logical value indicating whether to label the nodes with gene tags (if |
A graph representing the phylogenetic tree, with node sizes and colors reflecting clone proportions.
# Create an instance
# composed by 5 subpopulations of clones
# and 4 samples
instance <- create_instance(
n = 5,
m = 4,
k = 1,
selection = "neutral")
# Extract its associated B matrix
B <- instance$B
# Create a new 'Phylotree' object
# on the basis of the B matrix
phylotree <- B_to_phylotree(B = B)
# Generate the tags for the genes of
# the phyogenetic tree
tags <- LETTERS[1:nrow(B)]
# Plot the phylogenetic tree taking
# into account the proportions of the
# previously generated instance
plot_proportions(phylotree, instance$U, labels=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.