KrishnaswamyLab / MAGIC

MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.
GNU General Public License v2.0
341 stars 97 forks source link

Question to get the squared exponentiated Markov matrix #136

Closed buutrg closed 5 years ago

buutrg commented 6 years ago

Hi, is there any way that I can get the squared Markov exponentiated matrix after I apply magic in R? Thank you.

scottgigante commented 6 years ago

Hi @thanhbuu04 ,

We don't store the exponentiated matrix, but you can retrieve the markov operator and exponentiate it yourself. It is stored as described below.

library(Rmagic)
library(expm)
data <- ...
magic_data <- magic(data)
t <- ... (set according to logging output of MAGIC)
P <- magic_data$operator$diff_op
P_power_t <- P %^% t