Summary of some results from simulation studies for a group meeting demonstration.
%cd ~/GIT/github/mnm-twas/dsc/finemap_output
%preview finemap_output_comparisons.png --width 90%
%cd ~/GIT/github/mnm-twas/dsc/mthess_500
%preview PIP_comparison_0228.roc.pdf -s png --dpi 100
dat = readRDS('PIP_comparison_0228.pips_meta.rds')
dat = dat[,c(4,6)]
colnames(dat) = c('method', 'time')
library(ggplot2)
library(cowplot)
# Basic violin plot
p = ggplot(dat, aes(x=method, y=time)) +
geom_violin(trim=FALSE, fill="gray")+
labs(title="",x="method", y = "time elapsed (seconds)")+
geom_boxplot(width=0.1)+
theme_cowplot()
print(p)
%cd ~/GIT/software/mvsusieR/inst/prototypes/
result_file = 'small_data_100_mixture01_1_oracle_generator_1_mnm_mixture01_1.rds'
meta_file = 'small_data_100_mixture01_1.pkl'
X_file = 'small_data_100.rds'
dat = readRDS(result_file)$result
rownames(dat$coef) = NULL
meta = dscrutils::read_dsc(meta_file)
Y = meta$Y
X = readRDS(X_file)$X
Per SNP per condition, for a comparison.
univariate_res = lapply(1:ncol(Y), function(i) susieR:::univariate_regression(X,Y[,i]))
dat$bhat = do.call(cbind, lapply(1:ncol(Y), function(i) univariate_res[[i]]$betahat))
dat$shat = do.call(cbind, lapply(1:ncol(Y), function(i) univariate_res[[i]]$sebetahat))
truth = meta$meta$true_coef
true_variable = unique(which(truth!=0,arr.ind=T)[,1])
cbind(true_variable, truth[true_variable,])
pdf('susie_plot_demo.pdf', width=10, height=5)
susieR::susie_plot(dat,y='PIP', main = 'Default SuSiE plot for cross-condition PIP', xlab = 'SNP positions', add_legend = T, b=as.integer(apply(truth, 1, sum) != 0))
dev.off()
%preview susie_plot_demo.pdf -s png --dpi 100
p = mvsusieR::mvsusie_plot(dat)
pdf('bubble_demo.pdf', width = p$width, height = p$height)
print(p$plot)
dev.off()
%preview bubble_demo.pdf -s png --dpi 100
p = mvsusieR::mvsusie_plot(dat, cs_only=F)
pdf('bubble_demo_full.pdf', width = p$width, height = p$height)
print(p$plot)
dev.off()
%preview bubble_demo_z_full.pdf -s png --dpi 100
p = mvsusieR::mvsusie_plot(dat, original_sumstat = TRUE)
pdf('bubble_demo_z.pdf', width = p$width, height = p$height)
print(p$plot)
dev.off()
%preview bubble_demo_z.pdf -s png --dpi 100
p = mvsusieR::mvsusie_plot(dat, original_sumstat = TRUE, cs_only = FALSE)
pdf('bubble_demo_z_full.pdf', width = p$width, height = p$height)
print(p$plot)
dev.off()
%preview bubble_demo_z_full.pdf -s png --dpi 100