addGraphToGraph(RCytoscape)
addGraphToGraph()所属R语言包:RCytoscape
addGraphToGraph
addGraphToGraph
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given a CytoscapeWindow containing a graph, this method adds new nodes, edges, and their attributes. Thus, it is the way to extend a graph – to merge a new graph with an existing one. A typical use would be to add a second KEGG pathway to a CytoscapeWindow upon discovering that two KEGG pathways overlap, sharing some enzymes and some reactions. No existing attributes are written over.
给予CytoscapeWindow包含图形,这种方法增加了新的节点,边和它们的属性。因此,它是图形的方式来扩大 - 合并与现有的一个新的图形。一个典型的使用将是第二KEGG通路1 CytoscapeWindow添加后,发现两个KEGG通路重叠,共享一些酶和一些反应。任何现有的属性都写了。
用法----------Usage----------
addGraphToGraph(obj, other.graph)
参数----------Arguments----------
参数:obj
a CytoscapeWindowClass object.
CytoscapeWindowClass对象。
参数:other.graph
a graph object.
graph对象。
值----------Value----------
None.
没有。
作者(S)----------Author(s)----------
Paul Shannon
举例----------Examples----------
window.name <- 'demo addGraphToGraph'
cw3 <- new.CytoscapeWindow (window.name, graph=makeSimpleGraph ())
displayGraph (cw3)
redraw (cw3)
layout (cw3)
# create a new graph, which adds two nodes, and edges between them[创建一个新的图形,这增加了两个节点,它们之间的边缘]
# and an existing node, A[和现有的节点,]
g2 <- new("graphNEL", edgemode = "directed")
g2 <- graph::addNode ('A', g2)
g2 <- graph::addNode ('D', g2)
g2 <- graph::addNode ('E', g2)
g2 <- initNodeAttribute (g2, "label", "char", "default node label")
g2 <- initEdgeAttribute (g2, "edgeType", "char", "unspecified")
g2 <- initEdgeAttribute (g2, "probability", "numeric", 0.0)
nodeData (g2, 'D', 'label') <- 'Gene D'
nodeData (g2, 'E', 'label') <- 'Gene E'
g2 <- graph::addEdge ('D', 'E', g2)
g2 <- graph::addEdge ('A', 'E', g2)
edgeData (g2, 'D', 'E', 'probability') <- 0.95
edgeData (g2, 'D', 'E', 'edgeType') <- 'literature'
edgeData (g2, 'A', 'E', 'edgeType') <- 'inferred'
addGraphToGraph (cw3, g2)
redraw (cw3)
layout (cw3)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|