R/ggnetwork_plot_full.R
ggnetwork_plot_full.Rd
This puts all the functions together from getting the subset of results to creating the final interactive plot.
ggnetwork_plot_full(
filters,
keep_descendants = NULL,
results = load_example_results(),
hpo = HPOExplorer::get_hpo(),
q_threshold = 5e-04,
effect_threshold = 1,
columns = HPOExplorer::list_columns(),
colour_var = "effect",
size_var = "ontLvl_relative",
add_ont_lvl_absolute = TRUE,
add_ont_lvl_relative = TRUE,
method = c("ggnetwork", "visnetwork"),
interactive = TRUE,
verbose = TRUE,
...
)
A named list, where each element in the list is the name of a column in the data, and the vector within each element represents the values to include in the final data.
Terms whose descendants should be kept
(including themselves).
Set to NULL
(default) to skip this filtering step.
The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results
Human Phenotype Ontology object, loaded from get_ontology.
The q value threshold to subset the results
by.
The minimum fold change in specific expression
to subset the results
by.
A named vector of columns in phenos
to add to the hoverdata via add_hoverboxes.
The column from phenos that you wish to map to node colour.
Column to scale node size by.
Add the absolute ontology level of each HPO term. See get_ontology_levels for more details.
Add the relative ontology level of each HPO term. See get_ontology_levels for more details.
Method to construct plot with.
Make the plot interactive.
Print messages.
Arguments passed on to HPOExplorer::make_network_plot
phenos
A data.table containing HPO IDs and other metadata.
label_var
Column containing the label for each node in a graph (e.g. "hpo_name").
show_plot
Show the plot.
hoverbox_column
Name of the new hoverbox column to add.
preferred_palettes
Preferred palettes to use for each column.
A named list of outputs, including a interactive network plot of the selected subset of results from RD EWCE analysis.
res <- ggnetwork_plot_full(filters = list(CellType = "Microglia"))
#> ggnetwork_plot_full
#> Subsetting results by q_threshold and effect.
#> Selected CellType :
#> - Microglia
#> Filtered 'CellType' : 1,228 / 1,230 rows dropped.
#> 2 associations remain after filtering.
#> 2 associations remain after filtering.
#> Adding HPO names.
#> Translating ontology terms to names.
#> Aggregating results by group_var='hpo_name'/'hpo_id'
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Getting absolute ontology level for 19,025 IDs.
#> Getting relative ontology level for 19,025 IDs.
#> Translating ontology terms to ids.
#> Adding term definitions.
#> Adding hoverboxes to data.table.
#> Making phenotype network object.
#> Translating ontology terms to ids.
#> Converted ontology to: tbl_graph
#> Removing isolated nodes.
#> Loading required namespace: ggnetwork
#> Registered S3 method overwritten by 'ggnetwork':
#> method from
#> fortify.igraph ggtree
#> Converting graph to ggnetwork.
#> Creating ggnetwork plot.