Question: Coloring Multiple Nodes In Cytoscape
4
gravatar for pixie@bioinfo
8.7 years ago by
pixie@bioinfo1.4k
pixie@bioinfo1.4k wrote:

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 ...

ADD COMMENTlink modified 18 months ago by Biostar ♦♦ 20 • written 8.7 years ago by pixie@bioinfo1.4k
6
gravatar for David Quigley
8.7 years ago by
David Quigley11k
San Francisco
David Quigley11k wrote:

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 COMMENTlink written 8.7 years ago by David Quigley11k
2

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 REPLYlink written 8.7 years ago by Khader Shameer18k
1

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 REPLYlink written 8.7 years ago by pixie@bioinfo1.4k
3
gravatar for Khader Shameer
8.7 years ago by
Manhattan, NY
Khader Shameer18k wrote:

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 COMMENTlink written 8.7 years ago by Khader Shameer18k
1

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

ADD REPLYlink written 8.7 years ago by pixie@bioinfo1.4k
2
gravatar for Sirus
8.6 years ago by
Sirus770
Boston/USA
Sirus770 wrote:

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 COMMENTlink written 8.6 years ago by Sirus770
1

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

ADD REPLYlink written 8.6 years ago by David Quigley11k
1

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 REPLYlink written 8.6 years ago by Sirus770
1

hey thanks for the info :)

ADD REPLYlink written 8.6 years ago by pixie@bioinfo1.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2033 users visited in the last hour