To compare with m&m results I analyze the same data-set using varbvs (varbvsnorm
) and susieR.
I expanded my DSC in src/model_dsc
to include these two new methods.
%cd ../src/model_dsc
./model.dsc -h
See the previous document on m&m for more details on the benchmark at this point.
./model.dsc
Scripts for the DSC can be found here. Specifically look at the fit_varbvs
and fit_susie
modules for the new routines added.
varbvs
¶res = readRDS('mnm_model/fit_varbvs/get_data_1_original_Y_1_init_mnm_1_fit_varbvs_1.rds')
dat = readRDS('mnm_model/init_mnm/get_data_1_original_Y_1_init_mnm_1.rds')
r2 = dat$data$r2
We focus on inferred posterior mean. We plot this quantity in both Thyroid and Lung tissues, annotated by PIP and LD structure.
post_mean = res$posterior$PosteriorMean
pip = 1 - res$posterior$lfdr
%get post_mean pip r2 --from R
import seaborn as sns
import matplotlib.pyplot as plt
def plot_beta(yaxis, zaxis, ld, conf):
xaxis = [x+1 for x in range(len(yaxis))]
cmap = sns.cubehelix_palette(start=2.8, rot=.1, as_cmap=True)
f, ax = plt.subplots(figsize=(18,5))
points = ax.scatter(xaxis, yaxis, c=zaxis, cmap=cmap)
f.colorbar(points, label=conf['zlabel'])
if 'pip_cutoff' in conf:
for idx, item in enumerate(zaxis):
if item > conf['pip_cutoff']:
ax.scatter(xaxis[idx], yaxis[idx], s=80,
facecolors='none', edgecolors='r')
for ii, xx in enumerate(ld[idx,:]):
if xx > conf['ld_cutoff1'] and xx < 1.0:
ax.scatter(xaxis[ii], yaxis[ii],
color='y', marker='+')
for ii, xx in enumerate(ld[idx,:]):
if xx > conf['ld_cutoff2'] and xx < 1.0:
ax.scatter(xaxis[ii], yaxis[ii],
color='g', marker='x')
ax.set_title(conf['title'])
ax.set_ylabel(conf['ylabel'])
plt.gca()
plt.show()
Top signals ($pip > 0.95$) are circled in red, with SNPs in LD with it ($r^2>0.1$) colored in yellow, ($r^2>0.6$) colored in green.
conf = {'title': 'FMO2, Thyroid, varbvs',
'ylabel': 'betahat',
'zlabel': 'PIP (1 - lfdr)',
'pip_cutoff': 0.95,
'ld_cutoff1': 0.1,
'ld_cutoff2': 0.6}
plot_beta(post_mean[:,0], pip[:,0], r2, conf)
conf = {'title': 'FMO2, Lung, varbvs',
'ylabel': 'betahat',
'zlabel': 'PIP (1 - lfdr)',
'pip_cutoff': 0.95,
'ld_cutoff1': 0.1,
'ld_cutoff2': 0.6}
plot_beta(post_mean[:,1], pip[:,1], r2, conf)
susie
¶res = readRDS('mnm_model/fit_susie/get_data_1_original_Y_1_init_mnm_1_fit_susie_1.rds')
post_mean = res$posterior$PosteriorMean
lfsr = res$posterior$lfsr
%get post_mean lfsr --from R
Top signals ($lfsr < 0.05$) are circled in red, with SNPs in LD with it ($r^2>0.1$) colored in yellow, ($r^2>0.6$) colored in green.
conf = {'title': 'FMO2, Thyroid, susie',
'ylabel': 'betahat',
'zlabel': 'PIP (1 - lfsr)',
'pip_cutoff': 0.95,
'ld_cutoff1': 0.1,
'ld_cutoff2': 0.6}
plot_beta(post_mean[:,0], 1 - lfsr[:,0], r2, conf)
conf = {'title': 'FMO2, Lung, varbvs',
'ylabel': 'betahat',
'zlabel': 'PIP (1 - lfsr)',
'pip_cutoff': 0.95,
'ld_cutoff1': 0.1,
'ld_cutoff2': 0.6}
plot_beta(post_mean[:,1], 1 - lfsr[:,1], r2, conf)