Question: R: Efficiently calculate double summation of product
0
gravatar for learnBioinformatics
4.3 years ago by
United States
learnBioinformatics40 wrote:

Hello everyone,

I have a drug-target matrix A (5000 rows(target) * 6000 columns (drugs)), in which each element is a_ij, The second matrix is S, which is 6000 * 6000 matrix (drug-drug similarity matrix), where each element is s_lk. I would like to calculate the following formula: m_ij = sum(k=1..m, l=1..m) (a_il*a_jk*s_lk), [i.e., https://www.dropbox.com/s/5nw7ha5j8pkgcr9/sum.pdf?dl=0] which should a 5000 * 5000 matrix. Here m_ij will be used to calculate the target-target similarity as described in Bioinformatics Journal <<Drug-target interaction prediction through domain-tuned network-based inference>>

What is the efficient way to calculate such summation of product?

Can you give me a tip to calculate such formula, or some course to give a presentation to deal with such formula efficiently.

 

Thanks.

 

 

matrices R • 2.8k views
ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by learnBioinformatics40
1

If I am not wrong, the method described in the paper is available as an R package DT-Hybrid.

ADD REPLYlink modified 4.3 years ago • written 4.3 years ago by komal.rathi3.4k

Thanks. Yes, I got it.

ADD REPLYlink written 4.3 years ago by learnBioinformatics40

While we have many R experts here, I think this question is a better fit for stack overflow. If you were to provide some context on how this pertains to bioinformatics, this question might belong better here.

ADD REPLYlink written 4.3 years ago by RamRS20k

Thanks RamRS. I have revised my poster and added the bioinformatics information.

ADD REPLYlink written 4.3 years ago by learnBioinformatics40

Thank you for adding details. I'm not great with R and your question needs some expert insight so I guess we'll have to wait for some of them to take a look at it :)

ADD REPLYlink modified 4.3 years ago • written 4.3 years ago by RamRS20k

Thank you RamRS. I am also working on it. 

ADD REPLYlink written 4.3 years ago by learnBioinformatics40

are either of the matrices sparse?

ADD REPLYlink written 4.3 years ago by russhh4.2k

Matrice A is sparse and Matrice S is similarity matrix, which is not sparse.

ADD REPLYlink written 4.3 years ago by learnBioinformatics40
0
gravatar for learnBioinformatics
4.3 years ago by
United States
learnBioinformatics40 wrote:

This answer should be: A %*% S %*% t(A)

ADD COMMENTlink written 4.3 years ago by learnBioinformatics40
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1221 users visited in the last hour