First, I don't understand what it means by partial correlation matrix. I know correlation matrix, though.
Second, assuming partial correlation matrix is similar to correlation matrix, then how can you refer the connections (edges) between the dots (genes) and how to resolve the directionality?
Third, I am using the R package "parcor". I have read the R manual, some reference papers, but still don't know how to infer a network from the package. Can somebody give a simple tutorial?
Thanks much in advance.
I am working on the network stuff right now. I have a gene expression file like the following
Then I use the following R code:
The problem is that every gene points to itself, i.e. the edges are like the following:
Any ideas?
Thanks a lot!
You forgot to declare the graph as weighted and undirected:
Did as you suggested, and got the following:
There are too many connections -- looks like every gene is connected to every gene. Is there a way to threshold (or validate) a connection?
An edge is created for every non-zero value in the matrix so unless you have a sparse matrix, you get a graph in which each node is connected to most of the others. How to deal with this situation depends on what you want to do with the graph.
You could threshold your similarity values but finding the right threshold may not be easy. The context may suggest a value or you could filter edges based on the p-value or you could use the elbow criterion: plot the values in decreasing order and find the value at which the curve levels off.
How to trim the network, please? I don't see anything in "ridge.net" that is related to trimming, nor in "igraph".
Thanks.
By trimming, do you mean removing edges ? You can do it by setting the corresponding weights to 0 in the adjacency/similarity matrix or using the delete_edges() function in igraph.
Yes, removing the edges. I did set the weights to 0 for most of the edges by setting the weights < threshold value to 0. All vertices still show up on the plot. Guess I need to remove the vertices which have no connections to make the plot clear. Detecting such vertices is conceptually easy but tedious. I am surprised the package "parcor" & "igraph" have so limited number of functions.
Also, the partial correlation matrix can take both + and - numbers. Is there away to reflect the sign on the plot (e.g. using different colors)?
Thanks a lot.