This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Coloring Multiple Nodes In Cytoscape

I have to use Cytoscape on a regular basis. One problem I face often is that I have to color the nodes individually.

It is not possible to select multiple nodes and color them at one go. Are there any plugins available for this purpose or is there a way around this problem?

Kindly let me know if there are any other network biology software which can support this kind of thing ...

cytoscape visualization network

3 answers

It's probably a bug (at least in the Mac build) that if you select a set of nodes and then use Visual Mapping Bypass to change node color, only one node actually changes color. When I want to color nodes to reflect some attribute, I usually create a separate Node Attributes file and then use the VizMap to color nodes based on that attribute. This works for discrete values ("upregulated", "downregulated") as well as continuous variables. However, if you want to do this after the network is already loaded, you could do the following:

First, create a new attribute called "color" (or whatever you want to call it). You can do this by clicking the icon on the data panel, second from the left.

Now, for each set of nodes:

1) Select the set of nodes you want to color

2) Click the Attribute Batch editor button (right side of the data panel)

3) Set your color attribute to a value, e.g. "red".

Finally, set a VizMap Discrete Mapping for the Node Color property using the color attribute. This lets you assign all of the nodes with the attribute "color" value "red" to be appear red. This is cumbersome for more than a few colors, and I think using a node attributes file is simpler and more reproducible, but it does work for on-the-fly editing. Note that you can change any node attribute this way, not just node color.

Thanx for ur suggestion.... For the first set of nodes ...this is working out. But as soon as I am selecting the second set of nodes...the first set of nodes which I had previously colored goes back to the old color.....am I missing out any step?

As suggested David: you could try "VizMap Discrete Mapping" to give different colors for differenct set of nodes. You can ascribe a mapping value to your set of nodes (say "Col_1" for first set of nodes and second set as "Col_2") you can give specific colors. See this manual (Try the example in Introduction to the VizMapper User Interface section)AFAIK, this is not exactly an issue. You need to use a VizMap and give a color based on attributes.

If you want to try other network biology software for visualization : you could try Gephi Pajek or BioLayout Express 3D.

Thanx so much ...I could finnaly get it :)

Hi, there is also an other faster way; for me I generally use R to do it. you can use the igraphlibrary and do as following:

  1. Open your graph file using the read.graph() function.
  2. To color a node you can do V(g)$fill<- YourColor
  3. Save the graph (I like the gml format).

It is faster if you have a big number of nodes to color. especially for clustering. I tried this with Gephi I think it should work with Cytoscape

I don't think this solves the problem given that the poster wants to use Cytoscape, but thanks for posting that library.

Yeah, right, I wanted to give the poster an automated way to do it, because I am imagining that the dataset used is big.

Log in to answer this question.