Learn R Programming

DEGraph (version 1.24.0)

getSignedGraph: Given a graph, builds a signed version of the adjacency matrix taking into account the type of interaction (e.g., activation or inhibition)

Description

Given a graph, builds a signed version of the adjacency matrix taking into account the type of interaction (e.g., activation or inhibition).

Usage

getSignedGraph(graph, positiveInteractionLabels=c("activation", "expression"), negativeInteractionLabels=c("inhibition", "repression"), verbose=FALSE)

Arguments

graph
A graph object.
positiveInteractionLabels
A character vector specifying which interaction labels correspond to positive interactions. Defaults to 'c("activation", "expression")'.
negativeInteractionLabels
A character vector specifying which interaction labels correspond to negative interactions. Defaults to 'c("inhibition", "repression")'.
verbose
If TRUE, extra information is output.

Value

This function returns a squared matrix whose (i,j) entry is:
0
if edges i and j are not connected
1
if edges i and j are connected by a positive interaction
-1
if edges i and j are connected by a negative interaction.
By construction, the absolute value of this matrix is the adjacency matrix of the graph. Edges which cannot interpreted as corresponding to a positive or a negative interaction are marked as not connected.

Examples

Run this code
data("Loi2008_DEGraphVignette")
exprData <- exprLoi2008
rn <- rownames(exprData)

## Retrieve expression levels data for genes from one KEGG pathway
graph <- grListKEGG[[1]]
pname <- attr(graph, "label")
cat(verbose, "Pathway name: ", pname)

sgraph <- getSignedGraph(graph, verbose=TRUE)
print(sgraph)

graphList <- getConnectedComponentList(graph, verbose=TRUE)
print(graphList)

Run the code above in your browser using DataLab