Coloring Multiple Nodes In Cytoscape
3
4
Entering edit mode
13.8 years ago
pixie@bioinfo ★ 1.5k

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 • 25k views
ADD COMMENT
6
Entering edit mode
13.8 years ago

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.

ADD COMMENT
2
Entering edit mode

Have you tried "VizMap Discrete Mapping" as suggested by David ? If 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 map them easily. See this http://cytoscape.wodaklab.org/wiki/Cytoscape_User_Manual/Visual_Styles (Try the example in Introduction to the VizMapper User Interface section)

ADD REPLY
1
Entering edit mode

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?

ADD REPLY
3
Entering edit mode
13.8 years ago

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.

ADD COMMENT
1
Entering edit mode

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

ADD REPLY
2
Entering edit mode
13.8 years ago
Sirus ▴ 820

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

ADD COMMENT
1
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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

ADD REPLY
1
Entering edit mode

hey thanks for the info :)

ADD REPLY

Login before adding your answer.

Traffic: 2440 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6