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.
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,
2 answers
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")
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
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?
"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 ?
Yes, but I think the answer is no.
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
Thanks, that could probably work, it's a shame is not for Cytoscape 3.0.
Log in to answer this question.