Multivariate Bayesian variable selection regression

Make LD heatmap for demonstration data-sets

For given data-set of $X$ matrices I hereby plot the heatmap for LD. This is to make a demonstrative figure for the SuSiE manuscript.

Try on a default susieR data-set

In [2]:
library(susieR)
dat = readRDS(system.file("data", "N2finemapping.rds", package = "susieR"))
X = dat$X
In [3]:
r = 1
z_score = susieR:::calc_z(dat$X, dat$Y[,r])
b = dat$true_coef[,r]
b[which(b!=0)] = 1
png('/tmp/2.png', 12, 6, units = 'in', res = 500)
par(mfrow=c(1,2))
susie_pplot(z_score, dtype='z', b=b, main = 'Per-feature regression p-values')
dev.off()
png: 2
In [4]:
%preview /tmp/2.png
%preview /tmp/2.png
> /tmp/2.png (150.7 KiB):
In [2]:
%get X --from R
X.shape
Loading required package: feather
Out[2]:
(574, 1002)
In [51]:
%reload_ext autoreload
%autoreload 2
import sys
sys.path.append('/home/gaow/GIT/github/mvarbvs/dsc/modules')
from lib_regression_simulator import RegressionData
data = RegressionData(X=X)
In [52]:
data.set_xcorr()
In [60]:
data.plot_xcorr("/tmp/1.png", size = 40)
Plotting figure /tmp/1.png for 1002 markers (default limit set to 5000) ...
Saving figure /tmp/1.png ...
In [61]:
%preview /tmp/1.png
%preview /tmp/1.png
> /tmp/1.png (2.5 MiB):

Try on a simpler case

In [24]:
library(susieR)
dat = readRDS('~/liter_data_108_summarize_ld_1_lm_less_2.rds')$data
X = dat$X
In [22]:
r = 1
z_score = susieR:::calc_z(dat$X, dat$Y[,r])
b = dat$true_coef[,r]
b[which(b!=0)] = 1
png('/tmp/2.png', 12, 6, units = 'in', res = 500)
par(mfrow=c(1,2))
susie_pplot(z_score, dtype='z', b=b, main = 'Per-feature regression p-values')
dev.off()
png: 2
In [23]:
%preview /tmp/2.png
%preview /tmp/2.png
> /tmp/2.png (132.5 KiB):
In [25]:
%get X --from R
X.shape
Loading required package: feather
Out[25]:
(574, 1002)
In [26]:
%reload_ext autoreload
%autoreload 2
import sys
sys.path.append('/home/gaow/GIT/github/mvarbvs/dsc/modules')
from lib_regression_simulator import RegressionData
data = RegressionData(X=X)
data.set_xcorr()
In [27]:
data.plot_xcorr("/tmp/1.png", size = 40)
Plotting figure /tmp/1.png for 1002 markers (default limit set to 5000) ...
Saving figure /tmp/1.png ...
In [28]:
%preview /tmp/1.png
%preview /tmp/1.png
> /tmp/1.png (2.4 MiB):
In [ ]:


Copyright © 2016-2020 Gao Wang et al at Stephens Lab, University of Chicago