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.
susieR
data-set¶library(susieR)
dat = readRDS(system.file("data", "N2finemapping.rds", package = "susieR"))
X = dat$X
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()
%preview /tmp/2.png
%get X --from R
X.shape
%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()
data.plot_xcorr("/tmp/1.png", size = 40)
%preview /tmp/1.png
library(susieR)
dat = readRDS('~/liter_data_108_summarize_ld_1_lm_less_2.rds')$data
X = dat$X
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()
%preview /tmp/2.png
%get X --from R
X.shape
%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()
data.plot_xcorr("/tmp/1.png", size = 40)
%preview /tmp/1.png