[Cytoscape] Two Mappings For Node Fill Colour
2
0
Entering edit mode
11.2 years ago
enricoferrero ▴ 910

Hi,

In Cytoscape, is it possible to have a double mapping of a visual property?

For example, say I have a network of transcription factors and their targets. I want the nodes to be coloured by category (discrete mapping: transcription factor=blue, target=red), AND by their connectivity (continuous mapping: shades of red and blues based on the number of edges).

It looks like a fairly basic thing to me but I can't find a way to do it! Thanks,

cytoscape mapping • 6.4k views
ADD COMMENT
1
Entering edit mode
11.2 years ago
Leandro Lima ▴ 970

Hi rent0n.

I think it is not possible directly. But you can do this indirectly, merging the two fields you want.

For example (if your fields are discrete):

node     cancertype     expressed
node1    breast          yes
node2    prostate        no
node3    breast          no
node4    prostate        yes
node5    prostate        no

Merged fields:

node     cancertype_expressed
node1    breast_yes
node2    prostate_no
node3    breast_no
node4    prostate_yes
node5    prostate_no

In your case, I think it is better to change another property (for example, "node size" or "node border color")

ADD COMMENT
0
Entering edit mode

Yes, I eventually reached the same conclusion. You propose an interesting workaround, which unfortunately is not applicable in my case. The best I could do was mapping my categorical variable to a discrete node fill colour and then map the degree (number of edges) to node transparency.

ADD REPLY
0
Entering edit mode
11.2 years ago
Sudeep ★ 1.7k

For node coloring, an easy thing to do would be upload a node attribute list, which has node ids as first column and and category(TF/target) as second column. something like

id category
1 TF
3 target

Then under the VizMapper tab you can set the color as you said. You can follow the same approach for edge coloring, and more details are here

ADD COMMENT
0
Entering edit mode

Yes, I know about setting attributes and mapping attributes to visual properties. I want to know if I can map two attributes to the same property. Is my question unclear?

ADD REPLY
0
Entering edit mode

"I want to know if I can map two attributes to the same property."

Do you mean whether you can color a node by more than one property ?

ADD REPLY
0
Entering edit mode

Yes, but I think the answer is no.

ADD REPLY
1
Entering edit mode

Are you familiar with cytoscape plugin multicolorednodes ? but I am not sure if you can mix variable types (in your case categorical (TF/target) and numerical (degree)) in this plugin

ADD REPLY
0
Entering edit mode

Thanks, that could probably work, it's a shame is not for Cytoscape 3.0.

ADD REPLY

Login before adding your answer.

Traffic: 1649 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