Learn R Programming

ToPASeq (version 1.6.0)

preparePathways: Function to prepare pathways for topology-based pathway analysis

Description

Functions transforms pathways from graphite package (stored as Pathway-class) into formats required in the particular topology-based method implemented in this package. It also converts identifiers in the pathways and filters pathways according to several criteria.

Usage

preparePathways(pathways, method, both.directions, genes, maxNodes = 150, minEdges = 0, commonTh = 2, filterSPIA = FALSE, convertTo = "entrez", convertBy = NULL, EdgeAttrs = NULL)

Arguments

pathways
A list of pathways, individual pathways are objcets of class Pathway stored in PathwayList
method
A character, the pathways will be transformed according to the needs of the particular method. Possible values are: "TAPPA", "PRS", "PWEA", "TopologyGSA", "clipper", "DEGraph","SPIA"
both.directions
Logical, indicates how should be the undirected edges directed. If TRUE, an undirected edge is substitued with two directed edges with opposite directions (e.g. A-B becomes A->B and B->A). If FALSE, then an undirected edge is substitued with one directed edge which preserves the order of nodes (e.g. A-B becomes A->B).
genes
Character vector, vector of gene identifiers in the expression data
maxNodes
Numeric, maximal number of nodes. Pathways with more nodes are filtered out.
minEdges
Numeric, minimal number of edges. Pathways with less edges are filtered out.
commonTh
Numeric, threshold for number of nodes present in the data. Pathways with less node-identifiers matching to genes are filtered out.
filterSPIA
Logical, if TRUE applies filter defined in the SPIA method (relates to the calculation of inversion matrix).
convertTo
Character. If "none" no conversion is performed. Otherwise, the function converts node-identifiers in pathways as in graphite. It uses annotation package for the mapping.
convertBy
Named character vector, names of the elemenet must match the node-identifiers and the values are the new identifiers to be replaced. This is a more general option designed for pathways outside graphite.
EdgeAttrs
A list of two tables required for the filter from SPIA method. See makeDefaultEdgeData for the details.

Value

A list of the transformed pathways

See Also

makeDefaultEdgeData

Examples

Run this code
#Creating dummy set of genes
set.seed(123)
pathways<-pathways("hsapiens","kegg")[1:3]
  
genes<-unname(unlist(lapply(pathways[1:3], nodes)))
genes<-sample(genes, length(genes)*0.9)

#Applying the function
paths<-preparePathways(pathways[1:3], "TAPPA", TRUE, genes, maxNodes=65, convertTo="none")
paths


Run the code above in your browser using DataLab