Description Usage Arguments Value Examples
get_evogram
Collect information to plot dendrogram
1 2 3 4 5 |
size_df |
Dataframe in a wide format, where each row corrsponds to a single clone, and the columns are the sizes of that clone at each timepoint |
clones |
Array containing the clone ids. The index of each clone must correspond to the same index of the row in |
parents |
Array containing the ids of the parent of each clone in the |
fill_value |
Array containing information that can be used to color each clone. If NULL (the default), each clone is assigned a color. If values are a clone attribute, e.g. fitness, then the colors are assigned according to those values. The user can also provide custom colors in 3 ways: 1) hexcode; 2) rgb values as a string, with each value being a the intensity of the color channel, each separated by commas, e.g. "255, 10, 128"; 3) Any of the named in colors in R, which can be found with |
fill_range |
Array containing the minimum and maximum values to set the range of colors. If NULL (the default), the range is determined directly from |
time_pt |
Timepoint with which the dendrgram should be drawn |
clone_cmap |
Colormap to use for the clones. For a list of available colormaps, see https://github.com/bhaskarvk/colormap. |
threshold |
The minimum frequency of clones to be plotted. Clones with with a frequency below this value will not be plotted |
data_type |
String defining what kind of information is in size_df. If "size", then the values in |
fill_gaps_in_size |
Boolean defining whether or not missing sizes should be filled in |
test_links |
Make sure clone does not have the same id as it's parent. If true, it can cause infinite recursion. |
link_type |
Defines the shape of the edges berween nodes: "straight" draws straight lines between parents and childrend, while "elbow" draws a step from parent to child |
rescale_after_thresholding |
Boolean determining if frequencies should be rescaled after thresholding, so that frequencies are based on what was above the threshold. |
shuffle_colors |
Boolean determining if colors should be shuffled before being assigned to each clone. Only applies when fill_value = NULL |
List containing two dataframes: "dendro_pos" contains the positions of the nodes, "links" contains the positions of the edges between nodes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | data("example.easy.wide")
### Split dataframe into clone info and size info using fact timepoint column names can be converted to numeric values
time_col_idx <- suppressWarnings(which(! is.na(as.numeric(colnames(example.easy.wide)))))
attribute_col_idx <- suppressWarnings(which(is.na(as.numeric(colnames(example.easy.wide)))))
size_df <- example.easy.wide[, time_col_idx]
parents <- example.easy.wide$parent
clones <- example.easy.wide$clone
tree_info <- get_evogram(size_df, parents = parents, clones = clones)
tree_pos <- tree_info$dendro_pos
elbow_links <- tree_info$links
tree_p <- plot_evogram(tree_pos, elbow_links)
### Can also plot with straight links
tree_info <- get_evogram(size_df, parents = parents, clones = clones, link_type = "straight")
tree_pos <- tree_info$dendro_pos
straight_links <- tree_info$links
tree_straight_p <- plot_evogram(tree_pos, straight_links)
### Can also set nodes to be colored by attribute
data("example.easy.wide.with.attributes")
### Split dataframe into clone info and size info using fact timepoint column names can be converted to numeric values
time_col_idx <- suppressWarnings(which(! is.na(as.numeric(colnames(example.easy.wide.with.attributes)))))
attribute_col_idx <- suppressWarnings(which(is.na(as.numeric(colnames(example.easy.wide.with.attributes)))))
attr_size_df <- example.easy.wide.with.attributes[, time_col_idx]
attr_parents <- example.easy.wide.with.attributes$parent
attr_clones <- example.easy.wide.with.attributes$clone
fitness <- example.easy.wide.with.attributes$fitness
attribute_dendro_df <- get_evogram(attr_size_df, attr_clones, attr_parents, fill_value = fitness)
attribute_tree_pos <- attribute_dendro_df$dendro_pos
attribute_elbow_links <- attribute_dendro_df$links
attribute_tree_elbow_p <- plot_evogram(attribute_tree_pos, attribute_elbow_links, scale_by_node_size = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.