list2edges: Convert list to edge matrix

View source: R/PARAMO_functions.R

list2edgesR Documentation

Convert list to edge matrix

Description

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).

Usage

list2edges(annotated.char.list, col_order_inverse = F)

Arguments

annotated.char.list

Character list with ontology annotations.

col_order_inverse

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.

Value

Two-column matrix.

Examples

annot_list<-list(`CHAR:1`=c("HAO:0000933", "HAO:0000958"), `CHAR:2`=c("HAO:0000833", "HAO:0000258"))
list2edges(annot_list)
# attache plyr package and run
# ldply(annot_list, rbind)

phenoscape/scate-shortcourse documentation built on Feb. 5, 2023, 12:59 a.m.