adjmatrix2edgelist: Convert network matrix to edge list

Description Usage Arguments Value Examples

Description

Convert the network matrix to edge list, in which the first column contains the regulators, the second column presents the target genes and edge weights are in the third column.

Usage

1
adjmatrix2edgelist(adjmatrix, cutoff = 0, directed = F, order = T)

Arguments

adjmatrix

a network matrix

cutoff

threshod to cut the edge weights. Only the edges that pass the threshold will be shown in the output results.

directed

logical, if FLASE the adjmatrix is transformed to symmetric matrix and the upper triangular part of the matrix is used to generate the edge list.

order

logical, to order the edgelist according the edge weightes or not.

Value

adjmatrix2edgelist returns a data frame of edge list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
##load data
library(RLowPC)
data(gnwdata)
data.exp<-gnwdata$size100$ts1[,-c(1:3)]
genes<-colnames(data.exp)
##build correlation network
inf.cor<-abs(cor(data.exp))
diag(inf.cor)<-0
##convert matrix to edge list
adjmatrix2edgelist(inf.cor)

wyguo/RLowPC documentation built on May 4, 2019, 12:04 p.m.