Description Usage Arguments Value Author(s) See Also Examples
Specify how data attributes – for the specified named attribute – are
mapped to node color. There are two modes:'interpolate' and 'lookup'.
In the former, you specify data values ('control points') and colors;
when a node's corresponding data attribute value is exactly that of a
control point, the specified color is used. If the node's data attribute
falls between control points, then the color is interpolated. Note! In
the 'interpolate' mode, you almost always want to provide two additional
colors: one for node data values falling below the minimum control
point, one for node data values falling above the maximum control point.
If you provide an equal number of colors and control.points, the
default.color is used to paint nodes above and below the specified
range. A useful data exploration strategy would be to use
default.color <- '#000000'
causing all extreme nodes to be
painted black.
The 'lookup' mode provides no interpoloation, and is useful when you
have a node attribute with a finite set of discrete values, each of
which you you want to display in a specific color. For example: render
all receptors in yellow, all transcription factors in blue, and all
kinases in dark red.
1 2 | setNodeBorderColorRule(obj, node.attribute.name, control.points, colors, mode,
default.color='#000000', vizmap.style.name = 'default')
|
obj |
a |
node.attribute.name |
the node attribute whose values will determine the color of each node when this rule is applied. |
control.points |
a list of values. In the interpolate mode, a typical choice is the minimum, the maximum, some sensible midpoint. |
colors |
a list of colors, either two more than the number of control points (if mode='interpolate'), in which case the first color is used for all attributes values below the minimum, and the last color is used for those above the maximum. Or, if mode='lookup', the same number of colors as control.points are expected. Colors are expressed as quoted hexadecimal RGB strings, e.g. '#FF0000' or '#FA8800' |
mode |
'interpolate' or 'lookup'. This roughly corresponds to the visual mapping of continuously varying data (i.e., lfc or pValue), versus visual mapping of discrete data (i.e., molecule type, or phosphorylation status). With the interpolation mode, you must specify n+2 colors: adding a 'below' and an 'above' color. In lookup mode, specify exactly as many control.points as colors. If data attribute values are found on the nodes which do not appear inyour list, they will displayed in the default color. |
default.color |
'#000000' (black) by default, to catch your eye. Used primarily in mode=='lookup' and in mode='interpolate' if you fail to specify 'above' and 'below' values. |
vizmap.style.name |
visual style name, defaults to the style 'default'. |
None.
Tanja Muetze, Georgi Kolishovski, Paul Shannon
setNodeShapeRule
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cw <- CytoscapeWindow ('setNodeBorderColorRule.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork (cw, 'force-directed')
control.points <- c (-3.0, 0.0, 3.0) # typical range of log-fold-change ratio values
# paint negative values shades of green, positive values shades of
# red, out-of-range low values are dark green; out-of-range high
# values are dark red
colors <- c ("#00AA00", "#00FF00", "#FFFFFF", "#FF0000", "#AA0000")
setDefaultNodeBorderWidth (cw, 5)
setNodeBorderColorRule (cw, node.attribute.name='lfc', control.points, colors, mode='interpolate')
data.values <- c ("kinase", "transcription factor", "glycoprotein")
colors <- c ("#0000AA", "#FFFF00", "#00AAAA")
setNodeBorderColorRule (cw, node.attribute.name='type', data.values, colors, mode='lookup', default.color='#AA0000')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.