onto_plot: Get 'ontology_plot' object

View source: R/graphs.R

onto_plotR Documentation

Get ontology_plot object

Description

A convenience wrapper for the get_ontology_plot function, enabling functions to be passed to generate graphical parameters for terms automatically.

Usage

onto_plot(
  ontology,
  term_sets = NULL,
  frequencies = NULL,
  terms = remove_uninformative_terms(ontology, term_sets),
  edge_attributes = list(color = "#000000", lty = "solid"),
  fillcolor = "powderblue",
  label = simple_labels,
  color = "transparent",
  width = 0.75,
  fontsize = 30,
  style = "filled",
  fixedsize = "true",
  shape = "circle",
  ...
)

Arguments

ontology

ontology_index object

term_sets

List of character vectors of ontological term IDs

frequencies

Numeric vector of term frequencies named by term IDs

terms

Character vector of ontological terms

edge_attributes

List of properties to set for arrows (note, these properties will be used for all arrow).

fillcolor

Character vector of colours to fill nodes corresponding to terms with. Alternatively a function to set the colours of the nodes in the graph based on term_sets.

label

Character vector of labels (or function to set them).

color

Character vector of colours for borders of nodes representing terms (or function to set them).

width

Numeric vector of widths for nodes (of function to set them).

fontsize

Numeric vector of font sizes for the text to be placed in the nodes (or function to set them).

style

Display style for nodes, defaults to "filled".

fixedsize

Character indicating whether nodes should be fixed size, "true", or adjusted to fit around the contained text, "false".

shape

Character vector of shape names for nodes (or function to set them). Defaults to "circle".

...

Other node attributes for dot format.

Value

ontology_plot object.

See Also

get_ontology_plot, write_dot

Examples

library(ontologyIndex)
data(hpo)
hpo_phenotypes <- c(
	A=c("HP:0001382","HP:0004272","HP:0007917","HP:0004912","HP:0001596"),
	B=c("HP:0001382","HP:0004272","HP:0002165","HP:0004800","HP:0004912"),
	C=c("HP:0004800","HP:0001382","HP:0004912","HP:0007917","HP:0008743"),
	D=c("HP:0001257","HP:0001382","HP:0007917","HP:0012623","HP:0002165"),
	E=c("HP:0007917","HP:0004800","HP:0004272","HP:0001596","HP:0002165")
)

onto_plot(
	ontology=hpo,
	term_sets=hpo_phenotypes
)

ontologyPlot documentation built on May 29, 2024, 3:10 a.m.