[BioC] Gene-Metabolite correlation network

Sean Davis sdavis2 at mail.nih.gov
Sat Mar 24 23:35:04 CET 2012


On Sat, Mar 24, 2012 at 6:07 PM, pankaj borah
<pankajborah2k3 at yahoo.co.in> wrote:
> Dear Prof. Björn Usadel,
>
>
> I could generate the Adjacency out of the gene metabolite correlation.
>
>> m<-matrix(rnorm(1000),nrow=100,ncol=10,dimnames=list(paste("met",c(1:100))))
>> g<-matrix(rnorm(10000),nrow=1000,ncol=10,dimnames=list(paste("gen",c(1:1000))))
>> cm<-cm <- cor(t(m),t(g))
>> cm<-cor(t(m),t(g))
>> ADJ<-ifelse(c(cm)>0.75,1,0)
>> dim(ADJ)<-dim(cm)
>> str(ADJ)
>  num [1:100, 1:1000] 0 0 0 0 0 0 0 0 0 0 ...

Hi, Pankaj.

I have made a few adjustments to your code and then tried to give you
some guidance on where to go next.

cm = cor(t(m),t(g))
adj = cm>0.75
g = new("graphNEL",nodes=c(colnames(adj),rownames(adj)))
# get the edges from the adj matrix
# The next line returns a two-column matrix with the first
# column being the metabolite entry and the second column
# being the gene entry
edgeMatrix = which(adj,arr.ind=TRUE)
# Each edge reported twice, so get unique entries
edgeMatrix = unique(edgeMatrix)

g = addEdge(from=paste('met',edgeMatrix[,1]),
    to = paste('gen',edgeMatrix[,2]),g)

Now g returns:

A graphNEL graph with undirected edges
Number of Nodes = 1100
Number of Edges = 588

Hopefully, that gets you close to where you want to be.

Sean

> Now need to convert the ADJ to a edge list or sif. I have tried igraph package. But, it can convert square Adjacency matrix to edge list or a graphNEL object. Is there a way that I can convert my non square AM to a graph object or edge list ?
>
> Thanks,
>
> Pankaj
>
>
> ________________________________
>  From: Sean Davis <sdavis2 at mail.nih.gov>
> To: B Usadel <b.usadel at bio1.rwth-aachen.de>
>
>  <bioconductor at r-project.org>
> Sent: Saturday, 3 March 2012 1:23 PM
> Subject: Re: [BioC] Gene-Metabolite correlation network
>
> On Fri, Mar 2, 2012 at 9:35 AM, B Usadel <b.usadel at bio1.rwth-aachen.de> wrote:
>> This would be a crude solution but will do the job
>> m<-matrix(rnorm(1000),nrow=100,ncol=10,dimnames=list(paste("met",c(1:100))))
>> g<-matrix(rnorm(10000),nrow=1000,ncol=10,dimnames=list(paste("gen",c(1:1000))))
>
> cm <- cor(t(m),t(g))
>
> No need for the rbind, I don't think.
>
> Sean
>
>
>> mg<-rbind(m,g)
>> cm<-cor(t(mg))
>>
>> res<-cm[1:100,101:1100]
>>
>> For networks, you can try the GeneNet package using the mixed matrix. Or
>> just use res above with some sensible threshold and then make an
>> adjacency matrix out of it and convert it into a graphNEL object.
>>
>> (This is all assuming Pearson correlation (or derivatives thereof) is
>> the way to go between metabolites and transcripts)
>>
>> Cheers,
>> -björn
>>
>>> Thank you Prof. Björn,
>>>
>>> Yes they are are  10 identical conditions. But two matrices  are of
>>> not the same dimension. A has 1000 genes (rows) and B has 100
>>> metabolites(rows).
>>>
>>> Is there any package available in Bio-conductor or R  for generating
>>> gene -metabolite correlation network ?
>>>
>>> Regards,
>>>
>>> Pankaj2k3
>>>
>
>>> ------------------------------------------------------------------------
>>> *From:* B Usadel <b.usadel at bio1.rwth-aachen.de>
>
>>> *Cc:* "bioconductor at r-project.org" <bioconductor at r-project.org>
>>> *Sent:* Friday, 2 March 2012 4:13 PM
>>> *Subject:* Re: [BioC] Gene-Metabolite correlation network
>>>
>>> Hi Pankaj
>>>
>>> if it is the same 10 conditions, I would merge the matrices.
>>> (Otherwise subset both matrices on the identical conditions)
>>> And then calculate the whole correlation/covariance matrix and extract
>>> the relevant regions, With this small number of genes, it will be done
>>> almost instantaneously.
>>>
>>> Cheers,
>>> björn
>>>> Hi All,
>>>>
>>>> I have two matrices   A and B.
>>>> A contains expression values for 1000 genes in 10 conditions  A[1:1000,1:10]
>>>> B contains metabolic profiles of 100 metabolites in 10 conditions B[1:100,1:10]
>>>>
>>>> Is there a way that I can calculate gene-metabolite correlation OR co-variance  matrix using A and B ?
>>>>
>>>> Thanks
>>>>
>>>> Pankaj2k3
>>>>      [[alternative HTML version deleted]]
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Bioconductor mailing list
>>>> Bioconductor at r-project.org <mailto:Bioconductor at r-project.org>
>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>
>>>
>>> --
>>> Make the (Gabi) primary database better by just taking a short questionaire:
>>> https://www.surveymonkey.com/s/RK3GMPC
>>>
>>> Prof. Dr. Björn Usadel
>>> RWTH Aachen University
>>> Institute for Biology I
>>> Worringer Weg 1
>>> 52056 Aachen
>>>
>>> phone: +49 (0)241 80 26634
>>> fax:   +49 (0)241 80 22637
>>> web:   http://www.usadellab.org
>>> ---
>>>
>>>
>>>
>>
>>
>> --
>> Make the (Gabi) primary database better by just taking a short questionaire:
>> https://www.surveymonkey.com/s/RK3GMPC
>>
>> Prof. Dr. Björn Usadel
>> RWTH Aachen University
>> Institute for Biology I
>> Worringer Weg 1
>> 52056 Aachen
>>
>> Forschungszentrum Jülich
>> IBG-2: Plant Sciences
>> 52425 Jülich
>> Germany
>>
>> phone: +49 (0)241 80 26634
>> fax:   +49 (0)241 80 22637
>> web:   http://www.usadellab.org
>> ---
>>
>>
>>        [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list