copyVisualStyle(RCytoscape)
copyVisualStyle()所属R语言包:RCytoscape
copyVisualStyle
copyVisualStyle
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Once you have designed a visual style, you may wish to duplicate it, perhaps in preparation for adding further mapping rules. Another scenario arises when style rules have been added to the 'default' style, and you wish to create a Cytoscape session file with your current network and this default style. However, the default style is not saved into a session, only explicitly named styles are. Use this method to achieve this.
一旦你已经设计了一个视觉风格,你不妨重复,也许准备进一步增加的映射规则。另一种情况出现时被添加到“默认”的风格样式规则,你想创建一个与您现有的网络和这个默认样式Cytoscape的会议文件。然而,默认的样式不保存到会话,只有明确命名样式。使用此方法来实现这一目标。
用法----------Usage----------
copyVisualStyle(obj, from.style, to.style)
参数----------Arguments----------
参数:obj
a CytoscapeConnectionClass object or CytoscapeWindow object.
CytoscapeConnectionClass对象或CytoscapeWindow的对象。
参数:from.style
a character string specifying the name of an existing style you wish to copy
character string指定您要复制一个现有的样式的名称
参数:to.style
a character string, the name of an as yet non-existent style
character string,一个尚未风格不存在的名称
值----------Value----------
Nothing.
没有。
作者(S)----------Author(s)----------
Paul Shannon
参见----------See Also----------
getVisualStyleNames setVisualStyle
getVisualStyleNames setVisualStyle
举例----------Examples----------
# create the usual demo graph and Cytoscape window, then[创建平时的演示图和Cytoscape的窗口,然后]
# specify that all the edges should be 5 pixels wide. This affects the 'default' style only[指定所有的边缘应该是5个像素宽。这会影响到“默认”的风格]
# in order to save this style for later use, copy it to a [为了保存供以后使用这种风格,将它复制到]
# new style named 'fatEdgeStyle'[新的风格命名为“fatEdgeStyle”]
# the related method 'setVisualStyle' must be called in order for[为了必须调用相关方法setVisualStyle“]
# the fatEdgestyle to be associated with this window (and saved[与此窗口关联的fatEdgestyle(和保存]
# into the CytoscapeSession file from the Cytoscape application's[到CytoscapeSession从Cytoscape的应用程序的文件]
# File menu)[“文件”菜单上)]
window.name = 'demo.copyVisualStyle'
cw = new.CytoscapeWindow (window.name, graph=makeSimpleGraph ())
setDefaultEdgeLineWidth (cw, 5);
displayGraph (cw)
redraw (cw)
layout (cw)
# create a unique style name, using millisecond precision, so should be unique[创建一个风格独特的名称,使用毫秒精度,所以应该是唯一的]
time.msec = proc.time()[['elapsed']]
new.unique.style.name = paste ('fatEdgeStyle', time.msec, sep='.')
copyVisualStyle (cw, 'default', new.unique.style.name)
new.names = getVisualStyleNames (cw)
setVisualStyle (cw, new.unique.style.name)
# save the session form the Cytoscape application menu. the new[保存会议的形式Cytoscape的应用程序菜单。新]
# style name will be saved along with the network and its attributes[随着网络和它的属性样式的名称将被保存]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|