Title: | Render molecular pathways |
---|---|
Description: | build graphs from pathway databases, render them by Rgraphviz. |
Authors: | Li Long <[email protected]> |
Maintainer: | Vince Carey <[email protected]> |
License: | LGPL |
Version: | 1.75.0 |
Built: | 2024-10-30 09:22:23 UTC |
Source: | https://github.com/bioc/pathRender |
a graph to which color attributes have been attached
Objects can be created by calls of the form new("coloredGraph", nodes, edgeL, edgemode)
.
these are graphNEL instances with some additional graphData
nodes
:Object of class "vector"
~~
edgeL
:Object of class "list"
~~
edgeData
:Object of class "attrData"
~~
nodeData
:Object of class "attrData"
~~
renderInfo
:Object of class "renderInfo"
~~
graphData
:Object of class "list"
~~
Class "graphNEL-class"
, directly.
Class "graph-class"
, by class "graphNEL", distance 2.
signature(x = "coloredGraph")
: ...
showClass("coloredGraph") example(randomGraph) nn = nodes(g1) x = runif(length(nn)) names(x) = nn h1 = colorNodes(g1, x, colorRampPalette(brewer.pal(9, "Blues"))(length(nn)), pwayRendAttrs) h1 plot(h1)
showClass("coloredGraph") example(randomGraph) nn = nodes(g1) x = runif(length(nn)) names(x) = nn h1 = colorNodes(g1, x, colorRampPalette(brewer.pal(9, "Blues"))(length(nn)), pwayRendAttrs) h1 plot(h1)
attach node coloring information to a graphNEL instance
colorNodes(g, nodeAss, pal, attgen)
colorNodes(g, nodeAss, pal, attgen)
g |
graphNEL instance |
nodeAss |
color map for nodes: vector with elements evaluating to colors and nodes as element names |
pal |
a palette (use colorRampPalette for color interpolation) |
attgen |
attribute generating function – pwayRendAttrs is prototype |
a graphNEL instance with additional rendering data
Vince Carey <[email protected]>
example(randomGraph) nn = nodes(g1) x = runif(length(nn)) names(x) = nn h1 = colorNodes(g1, x, colorRampPalette(brewer.pal(9, "Blues"))(length(nn)), pwayRendAttrs) h1
example(randomGraph) nn = nodes(g1) x = runif(length(nn)) names(x) = nn h1 = colorNodes(g1, x, colorRampPalette(brewer.pal(9, "Blues"))(length(nn)), pwayRendAttrs) h1
obtain a graph object corresponding to a cMAP pathway
graphcMAP(pname)
graphcMAP(pname)
pname |
character token identifying a KEGG or cMAP pathway |
reuses code from pathRender but emits a
graphNEL-class
instance with some
additional information for rendering
an instance of pwayGraph, which extends graphNEL
Vince Carey <[email protected]>
G1 = graphcMAP("p53pathway") G1 nodes(G1) if (require(Rgraphviz)) plot(G1)
G1 = graphcMAP("p53pathway") G1 nodes(G1) if (require(Rgraphviz)) plot(G1)
plot a gene network, coloring nodes according to relative expression values
plotExGraph(g, es, sampind=1, pal=colorRampPalette(brewer.pal(9, "Blues"))(length(nodes(g))), attgen=pwayRendAttrs)
plotExGraph(g, es, sampind=1, pal=colorRampPalette(brewer.pal(9, "Blues"))(length(nodes(g))), attgen=pwayRendAttrs)
g |
graph representing a gene network |
es |
an ExpressionSet instance |
sampind |
sample to be used to obtain relative expression values |
pal |
palette for coloring the nodes |
attgen |
attribute generating function |
plots a colored network on the current graphics display
as returned by Rgraphviz plot method for graphNEL instances
Vince Carey <[email protected]>
library(graph) data(pancrCaIni) library(ALL) data(ALL) library(hgu95av2.db) collap1 = reduceES( ALL, nodes(pancrCaIni), revmap(hgu95av2SYMBOL), "symbol", mean ) library(RColorBrewer) plotExGraph( pancrCaIni, collap1, 1 )
library(graph) data(pancrCaIni) library(ALL) data(ALL) library(hgu95av2.db) collap1 = reduceES( ALL, nodes(pancrCaIni), revmap(hgu95av2SYMBOL), "symbol", mean ) library(RColorBrewer) plotExGraph( pancrCaIni, collap1, 1 )
extension to graphNEL for pathway rendering
Objects can be created by calls of the form
new("pwayGraph", nodes, edgeL, edgemode)
.
There is a plot method that will work reasonably well if the plotting surface is big enough.
pwaySource
:Object of class "character"
KEGG or BIOCARTA
nodes
:Object of class "vector"
pathway constituents in the native vocabulary
edgeL
:Object of class "list"
constituent
relations in the native vocabulary
edgeData
:Object of class "attrData"
relationship
attributes
nodeData
:Object of class "attrData"
node
attributes
renderInfo
:Object of class "renderInfo"
render info
graphData
:Object of class "list"
this holds
the special rendering attributes for edges and nodes, for nodes it
seems particularly important to have fixedsize = FALSE
Class graphNEL-class
, directly.
Class graph-class
, by class "graphNEL", distance 2.
signature(x = "pwayGraph")
: renders the pathway
Vince Carey <[email protected]>
showClass("pwayGraph") G1 = graphcMAP("stresspathway") G1@graphData$nAttrs$labels[1:10]
showClass("pwayGraph") G1 = graphcMAP("stresspathway") G1@graphData$nAttrs$labels[1:10]
collapse the assay values in an ExpressionSet to a set of specified genes, using a statistic when multiple probes map to a given gene
reduceES(es, annovec, ann2featMap, pdvname="symbol", collapseFun=NULL)
reduceES(es, annovec, ann2featMap, pdvname="symbol", collapseFun=NULL)
es |
ExpressionSet instance |
annovec |
genes to retain |
ann2featMap |
either an AnnDbBimap from AnnotationDbi (typically constructed with revmap(), or a named vector mapping from symbols to probe set IDs |
pdvname |
featureData variable name to be used to hold the annotations of variables kept |
collapseFun |
statistical function for collapsing data across probes mapping to the same gene |
An ExpressionSet instance limited to genes in annovec, condensed if necessary using collapseFun to get one number per gene from multiple probes
Vince Carey <[email protected]>
library(ALL) data(ALL) library(hgu95av2.db) rr = revmap(hgu95av2SYMBOL) exprs(reduceES(ALL[,1:3], c("BCL2", "CPNE1"), rr, "sym", mean))
library(ALL) data(ALL) library(hgu95av2.db) rr = revmap(hgu95av2SYMBOL) exprs(reduceES(ALL[,1:3], c("BCL2", "CPNE1"), rr, "sym", mean))
Build graphs based on pathway or interaction data from cMAP database, render them using Rgraphviz.
rendercMAPPathway(pname, ino=0)
rendercMAPPathway(pname, ino=0)
pname |
name of the pathway to render |
ino |
index of the interaction in the given pathway to render |
For a given pathway in cMAP database, we build a subgraph for each interaction in the pathway, join them together to form the graph for the complete pathway. The subgraphs for interactions and the graph for the pathway include info for rendering, such as labels/shapes/fillcolors for nodes, colors/styles/weights for edges. If user specifies an index of interaction, only the interaction is rendered. Otherwise, the complete pathway is rendered.
None. A graphical output is presented.
Li Long <[email protected]>
rendercMAPPathway("plateletapppathway") rendercMAPPathway("plateletapppathway", 5) rendercMAPPathway("hsa00601") rendercMAPPathway("hsa00601", 10)
rendercMAPPathway("plateletapppathway") rendercMAPPathway("plateletapppathway", 5) rendercMAPPathway("hsa00601") rendercMAPPathway("hsa00601", 10)