I have a range of values from -0.10100 to 0.28400 (totally 120 continues values). This values represent gene expression of 120 genes. In my network they represent the interacting genes of TGFB1. I'm trying plot my network by using igraph library. I would like to have two effects on my node colors: the first one is to: color my nodes according to the gene expression value in greenred (in green the negative values and in red the positive ones) according to the range of values representing my attributes. Then, I would like to make transparent the redgreen nodes in the range from -0.10100 to 0.04720. Since I'm not an R expert I'm encountering troubles to have so many effects on my network. Can anyone help me please?
My attempts:
tmp1= read.delim("mynet.txt", header= T) g <- graph.data.frame(tmp1, directed=FALSE) V(g)$name [1] "COL6A3" "PDGFRB" "COL3A1" "COL5A1" "LOXL1" .... g GRAPH UN-- 120 120 -- + attr: name (v/c), GEX (v/c), color (v/c) tmp2= read.delim("myattributes.txt", header= T) GENE S2N COL6A3 0.28400 PDGFRB 0.28100 COL3A1 0.26300 ...... ....... V(g)$GEX=as.numeric(tmp2$S2N[match(V(g)$name,tmp2$GENE)]) V(g)$color=V(g)$GEX
Then unfortunately I stopped and I'm not able to continue. Can anyone help me please?
Best