View source: R/treecortreatplot.R
treecortreatplot | R Documentation |
Generate TreeCorTreat plot to summarize and visualize the result.
treecortreatplot(
hierarchy_list,
annotated_df,
response_variable,
separate = T,
num_cancor_components = 1,
color_variable = NULL,
size_variable = NULL,
alpha_variable = NULL,
advanced_list = NULL,
annotate_number = F,
annotate_number_column = NULL,
annotate_number_fontsize = 5,
annotate_number_color = "black",
font_size = 10,
nonleaf_label_pos = 0.6,
nonleaf_point_gap = NULL,
edge_path_type = "link",
plot_type = "balloon",
line_color = "black",
line_type = "solid",
plot = T
)
hierarchy_list |
A hierarchy list by running |
annotated_df |
A data frame contains summary statistic (canonical correlation or number of differential expressed genes, etc) and/or adjusted p-value for each tree node. Can be obtained by running |
response_variable |
A vector of response variables. |
separate |
A TRUE (default) or FALSE indicator, specifying whether response variables are evaluated separately (TRUE) or jointly (FALSE). This should be the same 'separate' parameter specified in |
num_cancor_components |
Number of canonical components to be extracted (by default: 1). Only works when separate = F. |
color_variable |
Set color aesthetics to a variable. This variable should be one of column names in |
size_variable |
Set size aesthetics to a variable. This variable should be one of column names in |
alpha_variable |
Set alpha (transparency) aesthetics to a variable. This variable should be one of column names in |
advanced_list |
A list for more advanced figure configuration. Default is NULL. Users can specify label color or manually specify your own set of mappings from levels in the data to aesthetic values. Names of this list must be one of 'label_info','size_info','color_info', 'alpha_info','palette','plot_layout'.
|
annotate_number |
A TRUE or FALSE (default) indicator, specifying whether to annotate numbers in the plot. |
annotate_number_column |
Specify column names to annotate text |
annotate_number_fontsize |
Specify size of annotated text. Default is 5. |
annotate_number_color |
Specify color of annotated text if |
font_size |
Font size |
nonleaf_label_pos |
A number from 0 to 1, controlling the relative positions of non-leaf labels (default: 0.6). Default tree height between adjacent hierarchy levels is 1. |
nonleaf_point_gap |
Specify the gap between circles in non-leaf (left) part, especially useful when works with multivariate phenotypes. |
edge_path_type |
Specify an edge type, must be one of:
|
plot_type |
Specify a type to display the leaf part, must be one of:
|
line_color |
Specify line color for hierarchical tree structure (default: black). |
line_type |
Specify line type for hierarchical tree structure, can be one of 'solid' (default), 'dashed', 'dotted', 'dotdash', 'longdash' and 'twodash'. |
plot |
Print the plot |
A list of ggplot class objects and annotated data frames (in a long format):
left: a ggplot class object for non-leaf part
right: a ggplot class object for leaf part
combine: full TreeCorTreat plot by combining left and right parts
left_data: annotated data frame for non-leaf part
right_data: annotated data frame for leaf part, including id, xy coordinates, label, response variable(s), aesthetics (size, color, alpha)
Boyang Zhang <bzhang34@jhu.edu>, Hongkai Ji
treecortreatplot(hierarchy_list, annotated_df, response_variable = 'severity', color_variable = 'adjp.sign', size_variable = 'cancor', alpha_variable = 'adjp.sign',nonleaf_label_pos = 0.25,nonleaf_point_gap = 0.15, plot = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.