I have used the Pearson correlation method to infer a network of interacting genes from microarray data. And ultimately, I would like to study this network with 'WGCNA'. However as useful as some of the commands in WGCNA seem, I can't find anywhere in the tutorials a command that actually allows me to visualise the networks.... So I instead used the package 'network' to plot and visualise this network.....
Subsequently I'd like to use 'RCyjs' to visualise the networks via javascript and ultimately create a website. Does anyone know if it is possible to jointly use shiny and RCyjs to make a pipeline that can accept microarray data and via these packages, produce a network?? Or should I try to use Django (if that's possible)?
p1<-cor(t(E.rna[1:20,1:20]),use="p") #pearson correlation
plot(as.network.matrix(p1)) #network package
RCyjs(portRange=9047:9057, quiet=TRUE, graph=as.network.matrix(p1)); #RCyjs
Error in validObject(.Object) :
invalid class “RCyjsClass” object: invalid object for slot "graph" in class "RCyjsClass": got class "network", should be or extend class "graph"
RCyjs does not seem to accept networks and instead only takes 'graphs'.... how can I rectify this? If possible could anyone recommend alternate packages?
Hi Paul,
Thanks for the reply
all i'm doing is running a pearsson correlation on a 20x20 matrix as follows:
p1<-cor(t(E.rna[1:20,1:20]),use="p")
Then with the 'network' package and 'graph' package as per your recommendation i tried the following:
graphNEL(as.network.matrix(p1))
But i get the following error:
Error in checkValidNodeName(nodes) :
node names must be character, got: ‘network’
Is this the example you were hoping for... this is the only way that I know how to make a network as of yet
Further Development: I have used the following code to make an RCyjs graph:
rcy <- RCyjs(portRange=9047:9057, quiet=TRUE, graph=igraph.to.graphNEL(graph_from_adjacency_matrix(p1, weighted=T)))
I am yet to check if the graph is congruent with the one that I originally plotted in Rstudio with the package 'Network' (a few recommendations of commands would be much appreciated here). However in the RCyjs graph I can not seem to eliminate the self-interacting nodes.... this seemed to be a default in the network package so I suppose there is an argument in the 'graph_from_adjacency_matrix' command that prevents that from happening??
This removes the self edges implied by the correlation matrix. Make that change before you create the graph.