Description Usage Arguments Author(s) Examples
Given an adjacency matrix, converts it into edge list representation. This edge list can be written to a file for easy import into other software such as cytoscape.
Only the upper triangle is returned as it is assumed the matrix is symmetric. The edge list is returned as a data frame with 3 columns: 'From', 'To' and 'Weight'.
1 | getEdgeList(m, rm.zero=TRUE)
|
m |
- An adjacency matrix. |
rm.zero |
- A boolean to indicate whether zero weight edges should be excluded from the edge list. |
Nathan S. Watson-Haigh
1 2 3 4 5 6 7 8 9 10 11 12 | data(PCIT)
m <- m[1:200,1:200] # just use a small subset of the data
el <- getEdgeList(m)
# modify the edge list to include some useful attributes for cytoscape
el$sign[el$Weight<0] <- '-'
el$sign[el$Weight>0] <- '+'
el$Weight <- abs(el$Weight)
# write the edge list stuff to a file suitable for import into cytoscape
write.table(el, file="el.txt", row.names=FALSE, col.names=TRUE, sep="\t",
quote=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.