Takes list of charater annotations amd creates an edge matrix comprising two columns: from and to. The list to table conversion can be done using ldply function from plyr package: plyr::ldply(list, rbind).
list2edges(annotated.char.list, col_order_inverse = F)
Character list with ontology annotations.
The default creates the first columns consisting if character IDs and the second columns consisting of ontology annatotaions. The inverse order changes the columns order.
Two-column matrix.
annot_list<-list(`CHAR:1`=c("HAO:0000933", "HAO:0000958"), `CHAR:2`=c("HAO:0000833", "HAO:0000258"))
list2edges(annot_list)
#> [,1] [,2]
#> [1,] "CHAR:1" "HAO:0000933"
#> [2,] "CHAR:1" "HAO:0000958"
#> [3,] "CHAR:2" "HAO:0000833"
#> [4,] "CHAR:2" "HAO:0000258"
# attache plyr package and run
# ldply(annot_list, rbind)