RCy3 Cytoscape package question
1
1
Entering edit mode
hanna226613 ▴ 10
@hanna226613-22653
Last seen 4.9 years ago

Hi I tried to visualize a network using RCy3

But I am struggling in one of the functions of RCy3 'setNodeBorderColorMapping' that depending on the value of certain column I wanted to give different node colors. For example, I wanted to have green color for the p-value <0.05 group and white color for the rests (green/white) only 2 colors).

However, when I put the below command, the color is somehow gradually changed (eg green->light green towards white etc) which I don't want... I also tried to change mapping.type ='d' to fix this instead of continuous type but it didnt work as well. Did I miss something here? How can I fix this problem?

setNodeBorderColorMapping(table.column= 'adjustedpvalue', table.column.values = c('adjustedpvalue'<0.05, 'adjusted_pvalue' >0.05), colors=c('#006633','#FFFFFF'), mapping.type = 'c')

rcy3 • 1.1k views
ADD COMMENT
0
Entering edit mode

my guess is that you change from mapping.type = 'c' to mapping.type = 'd'.

(char) continuous, discrete or passthrough (c,d,p); default is continuous.

ADD REPLY
0
Entering edit mode
alex.pico ▴ 30
@alexpico-15339
Last seen 10 weeks ago
United States

table.column.values only takes a vector of numerical values when doing continuous mapping. Think of the values as anchor points. In fact, they match 1:1 with the anchor points you would set in the Cytoscape gradient editor GUI. So, you can not insert arbitrary logic into this parameter.

To achieve the effect you want, you have two options: (1) define a new variable where you've processed the logic to a simple "sig" or "not sig" list of values. Then you could use discrete mapping to map a color to each, or (2) define a step function gradient: table.column.values = c(0, 0.05), colors=('#006633','#006633'), default.color='#FFFFFF'. This would make all the values less than 0.05 green and everything else would default to white. These two approaches match exatcly what you'd do in the Cytoscape GUI. We'd tried to design it such that if you knew how to do it in Cytoscape, then it would be intuitive in RCy3 as well.

ADD COMMENT

Login before adding your answer.

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