This function creates an igraph graph from one data frames containing the ancestor and offspring information.

goGraph(df)

Arguments

df

A data frame, output of getAncestors

Value

A igraph graph.

Examples

goids <- c("GO:0099536", "GO:0099537", "GO:0007268", "GO:0098916", "GO:0050804")
anc <- getAncestors(goids, onto = "BP")
goGraph(anc)
#> IGRAPH 808a71d DN-- 16 49 -- 
#> + attr: name (v/c)
#> + edges from 808a71d (vertex names):
#>  [1] GO:0007154->GO:0099536 GO:0007267->GO:0099536 GO:0008150->GO:0099536
#>  [4] GO:0009987->GO:0099536 GO:0023052->GO:0099536 GO:0050789->GO:0099536
#>  [7] GO:0065007->GO:0099536 GO:0007154->GO:0099537 GO:0007267->GO:0099537
#> [10] GO:0008150->GO:0099537 GO:0009987->GO:0099537 GO:0023052->GO:0099537
#> [13] GO:0050789->GO:0099537 GO:0065007->GO:0099537 GO:0099536->GO:0099537
#> [16] GO:0007154->GO:0007268 GO:0007267->GO:0007268 GO:0008150->GO:0007268
#> [19] GO:0009987->GO:0007268 GO:0023052->GO:0007268 GO:0050789->GO:0007268
#> [22] GO:0065007->GO:0007268 GO:0098916->GO:0007268 GO:0099536->GO:0007268
#> + ... omitted several edges