hi
I have a small expression datasets like below
head(data[,1:4])
treatment1 treatment2 control1 control2
1 244906_at 7.694273 6.390339 11.420760
2 244950_at 7.972370 6.144543 10.554545
I inferred a gene regulatory network like so
library(minet)
mim <- build.mim(t(data),estimator="spearman")
net <- aracne(mim)
library(igraph)
I converted network to an graph
g <- graph.adjacency(net,mode="directed",weighted=T)
library(Rgraphviz)
library(RCytoscape)
g.cyto <- igraph.to.graphNEL(g)
g.cyto <- initNodeAttribute(g.cyto, attribute.name='weight', attribute.type='numeric', default.value=0.0) cw = CytoscapeWindow ("met_cluster_net", graph=g.cyto)
but always error
Cytoscape window named 'met_cluster_net' does not exist yet Error! "weight" edge attribute not initialized. You should call: initEdgeAttribute (graph, attribute.name, attribute.type, default.value) where attribute type is one of "char", "integer", or "numeric". example: g <- initEdgeAttribute (g, "edgeType", "char", "molecule") or: g <- initEdgeAttribute (g, "pValue", "numeric", 1.0) 1 uninitialized edge attribute/s
may some on give me some guidelines
thank you
I am not familiar with RCytoscape but the error message is telling you that you need to initialize the edges. It looks like you're calling Cytoscape before doing so. Check the docs and example here.
sorry
if this is my original data
treatment1 treatment2 control1 control2 1 244906_at 7.694273 6.390339 11.420760
2 244950_at 7.972370 6.144543 10.554545 after converting to a graph , how I can add node attributes to graph??