Network plot
2
0
Entering edit mode
@hernando-martinez-4124
Last seen 10.2 years ago
Hi list, I am working with a network, in a table form like this: Gene1 Gene5 0.76 Gene1 Gene79 0.89 Gene2 Gene8 0.97 ... Basically, each row represents two genes that interact, and their pearson correlation coefficient (from 0.7 to 1). What I want to get is a plot representing how the number of nodes and edges (separately) decrease when the pearson correlation cut off increases (from 0.7 to 1). What I have in mind is creating a loop and generate values for the plot, but I have never done anything similar in R and I am not quite sure how to do it or it that would work. Any ideas? Help is much appreciated, thanks, -- Hernando Martínez Vergara [[alternative HTML version deleted]]
Network Network • 1.2k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Thu, Jul 1, 2010 at 4:18 AM, Hernando Martínez <hernybiotec@gmail.com>wrote: > Hi list, > I am working with a network, in a table form like this: > > Gene1 Gene5 0.76 > Gene1 Gene79 0.89 > Gene2 Gene8 0.97 > ... > > Basically, each row represents two genes that interact, and their pearson > correlation coefficient (from 0.7 to 1). > What I want to get is a plot representing how the number of nodes and edges > (separately) decrease when the pearson correlation cut off increases (from > 0.7 to 1). > What I have in mind is creating a loop and generate values for the plot, > but > I have never done anything similar in R and I am not quite sure how to do > it > or it that would work. > Any ideas? Help is much appreciated, thanks, > > Hi, Hernando. You might want to look at the ecdf function given the problem you describe. Sean [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
@sole-acha-xavi-4144
Last seen 10.2 years ago
You just need to build a matrix with two rows (one for nodes and one for edges), and as many columns as correlations cutoffs you want (e.g. if you have 0.7, 0.8, 0.9 and 1 it will have 4 columns). Then you just need to do a barplot for that matrix. As an example, if you have 4 correlation cutoffs: a<-matrix(8:1,2,4) #Matrix with number of nodes and edges for each PCC barplot(a,beside=TRUE,names.arg=c("0.7","0.8","0.9","1"),xlab="PCC threshold",ylab="Network parameters",col=c("blue","gray")) legend("topright",legend=c("nodes","edges"),fill=c("blue","gray")) To build the matrix there are some alternatives, and certainly one of them is a loop. Besides that, this is more an R question than a Bioconductor one, so maybe you should consider posting this to the R list. Best, Xavi. -----Mensaje original----- De: bioconductor-bounces at stat.math.ethz.ch [mailto:bioconductor- bounces at stat.math.ethz.ch] En nombre de Hernando Mart?nez Enviado el: jueves, 01 de julio de 2010 10:19 Para: Bioconductor at stat.math.ethz.ch Asunto: [BioC] Network plot Hi list, I am working with a network, in a table form like this: Gene1 Gene5 0.76 Gene1 Gene79 0.89 Gene2 Gene8 0.97 ... Basically, each row represents two genes that interact, and their pearson correlation coefficient (from 0.7 to 1). What I want to get is a plot representing how the number of nodes and edges (separately) decrease when the pearson correlation cut off increases (from 0.7 to 1). What I have in mind is creating a loop and generate values for the plot, but I have never done anything similar in R and I am not quite sure how to do it or it that would work. Any ideas? Help is much appreciated, thanks, -- Hernando Mart?nez Vergara [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

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