[BioC] Network plot

Sole Acha, Xavi x.sole at iconcologia.net
Thu Jul 1 10:45:58 CEST 2010


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]]



More information about the Bioconductor mailing list