Learn R Programming

ToPASeq (version 1.6.0)

AdjacencyMatrix2Pathway: Function to coerce an adjacency matrix to a Pathway

Description

The function coerces an adjacency matrix to a Pathway. Two types of matrices are allowed. The first one, where 1 denotes an edge between two nodes and 0 otherwise. This matrix is coerced into a simply pathway were type of all edges is set to "process". The second type of adjacency matrix contains: 1 for an activation, -1 for an inhibition and 0 otherwise (=no edge between two nodes). In this case, activations are set to "process(activation)" and inhibition to "process(inhibition)". The symetricity of the matrix is used to decide between directed and undirected graph. Symmetric matrix is expected for undirected graph and only the lower triangle of the matrix is used to extract the edges of the graph.

Usage

AdjacencyMatrix2Pathway(adjmat, name = "pathway", ident = "unknown", database = "unknown", species = "unknown", date = NULL)

Arguments

adjmat
An adjacency matrix describing the pathway topology
name
A character, name of the pathway. Defaults to "pathway"
ident
A character, type of the identificators, e.g "gene symbol"
database
A character, the name of the database the topology comes from
species
A character, the species to which the topology belong
date
A date, the date the topology was created

Value

An object of class Pathway, id is the same as title - name of the pathway

Examples

Run this code
genes<-paste("gene", 1:10, sep="")
adjmat<-matrix(sample(c(0,0,0,0,1), 100, TRUE),10,10, dimnames=list(genes,genes))
p<-AdjacencyMatrix2Pathway(adjmat)
head(edges(p))

adjmat<-matrix(sample(c(0,0,0,0,1,-1), 100, TRUE),10,10, dimnames=list(genes,genes))
p<-AdjacencyMatrix2Pathway(adjmat)
head(edges(p))

Run the code above in your browser using DataLab