Multivariate Bayesian variable selection regression

A detailed look at some of the SuSiE fits

In comparison with CAVIAR follow-ups; workflow implemented in this notebook.

In [1]:
%revisions -s -n 10
Revision Author Date Message
cdbdbd5 Gao Wang 2018-07-17 Add DAP example for a selected case
8bb6213 Gao Wang 2018-07-14 Add more illustrative analysis on the bouderline example
bdb6f51 Gao Wang 2018-07-12 Track fit for iterations
ffae903 Gao Wang 2018-07-11 Update examples for new prior specification
e366938 Gao Wang 2018-07-11 Fix prior specification
432639f Gao Wang 2018-07-10 Update documentation
18068e1 Gao Wang 2018-07-10 Remove unused code
c6f7916 Gao Wang 2018-07-10 Add ELBO check
00bb9fb Gao Wang 2018-07-10 Add one more example for CAVIAR comparison
436ef8d Gao Wang 2018-07-10 Improve CAVIAR comparison plot

Conclusions

  1. For these identified disagreement between CAVIAR in Example 1 and 2, if we set estimate_prior_variance=TRUE in susieR::susie we remove the differences.
  2. CAVIAR and DAP are in better agreement using default parameters.

Example 1

In [2]:
%preview /home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/CAVIAR_follow_up/chr11_63987798_63988488_clu_2010.CAVIAR.png
> /home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/CAVIAR_follow_up/chr11_63987798_63988488_clu_2010.CAVIAR.png (237.8 KiB):

We trace back to its input data-set and see what is going on.

In [3]:
ls /home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_*/chr11_63987798_63988488_clu_2010*
/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr11_63987798_63988488_clu_2010.log
/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr11_63987798_63988488_clu_2010.png
/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr11_63987798_63988488_clu_2010.rds
In [4]:
fn = "/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr11_63987798_63988488_clu_2010.rds"
susie = readRDS(fn)
dat = readRDS(susie$input)[[susie$idx]]
saveRDS(dat, "~/chr11_63987798_63988488_clu_2010_data.rds")
In [5]:
top_idx = which.max(abs(dat$z_score))
b = rep(0, length(dat$z_score))
b[top_idx] = 1
In [6]:
dat$pve
0.436326728099557

Fit SuSiE with prior variance set to PVE estimate

In [7]:
library(susieR)
set.seed(1)
fitted = susie(dat$X, dat$y, L=5,
               estimate_residual_variance=TRUE, 
               prior_variance=dat$pve/(1-dat$pve),
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
In [8]:
susie_pplot(pip, res = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)

To plot the fitting process:

In [9]:
susie_iterplot(fitted, 3, 'example_1')
Creating GIF animation ...
Iterplot saved to example_1.gif
In [10]:
%preview example_1.gif
> example_1.gif (240.1 KiB):
In [11]:
fitted$niter
10
In [12]:
fitted$elbo
  1. -Inf
  2. -107.354682043337
  3. -105.412970221029
  4. -104.715406841318
  5. -104.468587792364
  6. -104.291910129717
  7. -104.214736558107
  8. -104.188387163279
  9. -104.180104482203
  10. -104.177504692943
  11. -104.176644955626

However, if I set L=2 as I did for CAVIAR (-c 2), the result is more consistent with CAVIAR.

In [13]:
set.seed(1)
fitted = susie(dat$X, dat$y, L=2,
               estimate_residual_variance=TRUE, 
               prior_variance=dat$pve/(1-dat$pve),
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
susie_pplot(pip, res = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)
In [14]:
fitted$niter
16
In [15]:
fitted$elbo
  1. -Inf
  2. -100.793188239622
  3. -100.203094915129
  4. -100.10844189574
  5. -99.9584291326997
  6. -99.8202084824957
  7. -99.7044842645046
  8. -99.591931198144
  9. -99.4715477837629
  10. -99.3524779689058
  11. -99.2575601639637
  12. -99.1987029253996
  13. -99.1688397400201
  14. -99.1554984168234
  15. -99.149961834711
  16. -99.1477655359316
  17. -99.1469236643338

Takes longer to converge but the ELBO is bigger for L=2.

In [16]:
susie_iterplot(fitted, 3, 'example_1_l2')
Creating GIF animation ...
Iterplot saved to example_1_l2.gif
In [17]:
%preview example_1_l2.gif
> example_1_l2.gif (178.1 KiB):

Analysis with CAVIAR -c 3

In [18]:
%cd ~/tmp/14-Jul-2018
/home/gaow/Documents/TempDir/14-Jul-2018
In [28]:
library(abind)
mm_regression = function(X, Y, Z=NULL) {
  if (!is.null(Z)) {
      Z = as.matrix(Z)
  }
  reg = lapply(seq_len(ncol(Y)), function (i) simplify2array(susieR:::univariate_regression(X, Y[,i], Z)))
  reg = do.call(abind, c(reg, list(along=0)))
  # return array: out[1,,] is betahat, out[2,,] is shat
  return(aperm(reg, c(3,2,1)))
}
sumstats = mm_regression(as.matrix(dat$X), as.matrix(dat$y))
dat$Y = matrix(dat$y, length(dat$y), 1)
saveRDS(list(data=dat, sumstats=sumstats), 'N2.with_sumstats.rds')
In [7]:
export PATH=~/GIT/github/mvarbvs/dsc/modules/linux:$PATH
Rscript ~/GIT/software/susieR/inst/code/caviar.R input=\"N2.with_sumstats.rds\" output=\"N2finemapping.CAVIAR\" args=\"-c\ 3\"
Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Running shell command:
CAVIAR -z /tmp/RtmpwFPjKY/file746d754b0aca.caviar_condition_1.z -l /tmp/RtmpwFPjKY/file746d949df80.ld -o /tmp/RtmpwFPjKY/file746d754b0aca.caviar_condition_1 -c 3
@-------------------------------------------------------------@
| CAVIAR!		| 	   v2.2         |  10/Apr/2018| 
|-------------------------------------------------------------|
| (C) 2018 Farhad Hormozdiari, GNU General Public License, v2 |
|-------------------------------------------------------------|
| For documentation, citation & bug-report instructions:      |
| 		http://genetics.cs.ucla.edu/caviar/           |
@-------------------------------------------------------------@
Max Causal=3
99.987%Total Likelihood= 1.195587e+01 SNP=330 

201 3.211882e-01
325 4.620896e-01
232 6.020182e-01
136 6.198611e-01
302 6.234904e-01
297 6.269260e-01
244 6.295815e-01
91 6.320197e-01
67 6.343605e-01
24 6.367002e-01
243 6.389888e-01
260 6.411343e-01
276 6.432791e-01
184 6.454046e-01
329 6.475127e-01
163 6.496071e-01
165 6.517006e-01
137 6.537849e-01
141 6.558688e-01
53 6.577655e-01
62 6.596273e-01
37 6.614891e-01
38 6.633508e-01
44 6.652126e-01
43 6.670744e-01
39 6.689215e-01
299 6.706790e-01
13 6.724312e-01
47 6.741015e-01
29 6.757539e-01
34 6.774063e-01
35 6.790588e-01
4 6.806209e-01
9 6.821812e-01
272 6.837391e-01
89 6.852901e-01
191 6.868267e-01
192 6.883632e-01
106 6.898920e-01
61 6.913984e-01
316 6.928869e-01
18 6.943575e-01
23 6.958281e-01
19 6.972987e-01
22 6.987693e-01
21 7.002400e-01
20 7.017106e-01
7 7.031812e-01
8 7.046518e-01
14 7.061224e-01
15 7.075930e-01
3 7.090636e-01
2 7.105342e-01
11 7.120049e-01
64 7.134694e-01
97 7.148857e-01
96 7.163021e-01
30 7.177120e-01
117 7.191084e-01
48 7.204623e-01
31 7.218161e-01
32 7.231700e-01
114 7.245130e-01
195 7.258500e-01
313 7.271871e-01
59 7.285195e-01
197 7.298378e-01
100 7.311531e-01
235 7.324621e-01
180 7.337626e-01
58 7.350601e-01
194 7.363229e-01
66 7.375619e-01
189 7.387997e-01
188 7.400367e-01
183 7.412633e-01
42 7.424894e-01
175 7.437154e-01
185 7.449413e-01
45 7.461668e-01
128 7.473913e-01
208 7.486039e-01
181 7.498082e-01
63 7.510110e-01
198 7.522125e-01
16 7.534106e-01
150 7.546078e-01
258 7.558008e-01
109 7.569859e-01
147 7.581652e-01
182 7.593428e-01
179 7.605204e-01
176 7.616980e-01
174 7.628756e-01
171 7.640532e-01
172 7.652308e-01
173 7.664084e-01
157 7.675828e-01
167 7.687573e-01
162 7.699317e-01
95 7.711059e-01
105 7.722801e-01
28 7.734538e-01
88 7.746274e-01
85 7.758002e-01
205 7.769720e-01
207 7.781362e-01
103 7.792886e-01
87 7.804355e-01
90 7.815817e-01
92 7.827273e-01
93 7.838730e-01
204 7.850172e-01
127 7.861614e-01
123 7.873055e-01
120 7.884463e-01
51 7.895857e-01
238 7.907224e-01
225 7.918583e-01
226 7.929937e-01
148 7.941288e-01
278 7.952627e-01
86 7.963957e-01
231 7.975271e-01
233 7.986555e-01
70 7.997819e-01
33 8.009076e-01
74 8.020327e-01
78 8.031561e-01
288 8.042781e-01
79 8.053980e-01
131 8.065106e-01
246 8.076182e-01
151 8.087257e-01
265 8.098300e-01
209 8.109337e-01
156 8.120200e-01
279 8.131050e-01
267 8.141883e-01
187 8.152708e-01
248 8.163522e-01
280 8.174334e-01
36 8.185143e-01
274 8.195912e-01
271 8.206680e-01
26 8.217444e-01
54 8.228208e-01
57 8.238971e-01
253 8.249688e-01
52 8.260393e-01
257 8.271095e-01
25 8.281796e-01
321 8.292459e-01
240 8.303016e-01
199 8.313568e-01
252 8.324118e-01
104 8.334617e-01
259 8.345115e-01
242 8.355592e-01
5 8.366061e-01
294 8.376507e-01
289 8.386867e-01
303 8.397182e-01
153 8.407491e-01
129 8.417792e-01
121 8.428070e-01
170 8.438326e-01
27 8.448553e-01
211 8.458752e-01
212 8.468951e-01
216 8.479150e-01
261 8.489298e-01
239 8.499413e-01
68 8.509516e-01
293 8.519618e-01
155 8.529715e-01
76 8.539787e-01
77 8.549852e-01
133 8.559890e-01
17 8.569911e-01
255 8.579889e-01
55 8.589822e-01
247 8.599711e-01
222 8.609598e-01
6 8.619477e-01
286 8.629356e-01
296 8.639235e-01
290 8.649109e-01
160 8.658965e-01
224 8.668812e-01
83 8.678634e-01
56 8.688450e-01
99 8.698259e-01
223 8.708047e-01
326 8.717834e-01
142 8.727608e-01
234 8.737374e-01
230 8.747137e-01
41 8.756898e-01
140 8.766651e-01
145 8.776405e-01
144 8.786158e-01
149 8.795898e-01
152 8.805638e-01
154 8.815378e-01
101 8.825117e-01
98 8.834857e-01
94 8.844597e-01
119 8.854336e-01
122 8.864075e-01
130 8.873814e-01
132 8.883552e-01
113 8.893291e-01
65 8.903030e-01
219 8.912766e-01
146 8.922498e-01
161 8.932221e-01
159 8.941945e-01
158 8.951668e-01
284 8.961391e-01
228 8.971114e-01
295 8.980834e-01
236 8.990511e-01
315 9.000179e-01
317 9.009844e-01
319 9.019510e-01
324 9.029176e-01
327 9.038840e-01
82 9.048486e-01
270 9.058129e-01
266 9.067770e-01
221 9.077404e-01
262 9.087034e-01
320 9.096659e-01
81 9.106278e-01
80 9.115896e-01
203 9.125513e-01
108 9.135119e-01
75 9.144723e-01
73 9.154326e-01
72 9.163929e-01
71 9.173530e-01
60 9.183129e-01
307 9.192726e-01
314 9.202321e-01
69 9.211917e-01
300 9.221511e-01
227 9.231101e-01
50 9.240691e-01
49 9.250278e-01
254 9.259853e-01
125 9.269423e-01
281 9.278986e-01
111 9.288547e-01
112 9.298107e-01
143 9.307660e-01
250 9.317208e-01
177 9.326747e-01
178 9.336286e-01
306 9.345818e-01
126 9.355334e-01
115 9.364850e-01
116 9.374366e-01
124 9.383882e-01
264 9.393385e-01
10 9.402886e-01
168 9.412379e-01
107 9.421866e-01
110 9.431353e-01
301 9.440836e-01
218 9.450315e-01
285 9.459789e-01
292 9.469261e-01
169 9.478731e-01
282 9.488198e-01
283 9.497662e-01
40 9.507119e-01

In [11]:
caviar = readRDS("N2finemapping.CAVIAR.rds")
snp = caviar[[1]]$snp
pip = snp[order(as.numeric(snp$snp)),]$snp_prob
susie_pplot(pip, dtype='PIP', b=b, main = 'CAVIAR')

The result is less "clean", but still CAVIAR is able to capture the top signal.

Analysis with DAP-g

In [22]:
export PATH=~/GIT/github/mvarbvs/dsc/modules/linux:$PATH
python ~/GIT/software/susieR/inst/code/dap-g.py N2.with_sumstats.rds N2finemapping.DAP -ld_control 0.20 --all
In [23]:
dap = readRDS("N2finemapping.DAP.rds")
snp = dap[[1]]$snp
pip = snp[order(as.numeric(snp$snp)),]$snp_prob
susie_pplot(pip, dtype='PIP', b=b, main = 'DAP')

DAP seems to work fine in this case.

SuSiE with L 10

In [25]:
set.seed(1)
fitted = susie(dat$X, dat$y, L=10,
               estimate_residual_variance=TRUE, 
               prior_variance=dat$pve/(1-dat$pve),
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
susie_pplot(pip, res = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)

Interestingly, 1 CS is picked up, that does not include the signal.

SuSiE with L = 5 but estimated prior variance

In [19]:
set.seed(1)
fitted = susie(dat$X, dat$y, L=5,
               estimate_residual_variance=TRUE, 
               estimate_prior_variance=TRUE,
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
susie_pplot(pip, res = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)

We now get the same output as CAVIAR.

Example 2

In [20]:
%preview /home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/CAVIAR_follow_up/chr10_114186117_114186976_clu_3277.CAVIAR.png
> /home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/CAVIAR_follow_up/chr10_114186117_114186976_clu_3277.CAVIAR.png (230.1 KiB):
In [21]:
ls /home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_*/chr10_114186117_114186976_clu_3277*
/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr10_114186117_114186976_clu_3277.log
/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr10_114186117_114186976_clu_3277.png
/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr10_114186117_114186976_clu_3277.rds
In [22]:
fn = "/home/gaow/Documents/GIT/LargeFiles/JointLCL/AS_output/fastqtl_qqnorm_ASintron_RNAseqGeuvadis_YangVCF_100Kb/PVE_Prior/SuSiE_CS_2/chr10_114186117_114186976_clu_3277.rds"
susie = readRDS(fn)
dat = readRDS(susie$input)[[susie$idx]]
saveRDS(dat, "~/chr10_114186117_114186976_clu_3277_data.rds")
In [23]:
top_idx = which.max(abs(dat$z_score))
b = rep(0, length(dat$z_score))
b[top_idx] = 1
In [24]:
dat$pve
0.344063445406137
In [26]:
library(susieR)
set.seed(1)
fitted = susie(dat$X, dat$y, L=5,
               estimate_residual_variance=TRUE, 
               prior_variance=dat$pve/(1-dat$pve),
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
susie_pplot(pip, res = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)

To track iterations:

In [22]:
susie_iterplot(fitted, 3, 'example_2')
Creating GIF animation ...
Iterplot saved to example_2.gif
In [23]:
%preview example_2.gif
> example_2.gif (102.9 KiB):
In [20]:
fitted$niter
8
In [21]:
fitted$elbo
  1. -Inf
  2. -89.0071353774196
  3. -88.3842809518943
  4. -88.0172936582747
  5. -87.6273222681564
  6. -87.4517034446148
  7. -87.4120706110556
  8. -87.4066848830207
  9. -87.4061782553302

If I set L=1:

In [30]:
library(susieR)
set.seed(1)
fitted = susie(dat$X, dat$y, L=1,
               estimate_residual_variance=TRUE, 
               prior_variance=dat$pve/(1-dat$pve),
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
susie_pplot(pip, fitted = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)
In [31]:
fitted$elbo
  1. -Inf
  2. -82.5063140130696
  3. -82.3985239892553
  4. -82.3984433844399

The ELBO here is in fact better.

In [33]:
susie_iterplot(fitted, 3, 'example_2_l1')
Creating GIF animation ...
Iterplot saved to example_2_l1.gif
In [34]:
%preview example_2_l1.gif
> example_2_l1.gif (27.3 KiB):

CAVIAR and DAP other parameters

CAVIAR is more robust to parameter choices here.

In [29]:
sumstats = mm_regression(as.matrix(dat$X), as.matrix(dat$y))
dat$Y = matrix(dat$y, length(dat$y), 1)
saveRDS(list(data=dat, sumstats=sumstats), 'N2.with_sumstats.rds')
In [14]:
export PATH=~/GIT/github/mvarbvs/dsc/modules/linux:$PATH
Rscript ~/GIT/software/susieR/inst/code/caviar.R input=\"N2.with_sumstats.rds\" output=\"N2finemapping.CAVIAR\" args=\"-c\ 3\"
Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Running shell command:
CAVIAR -z /tmp/RtmpcU0JHI/file760fcf36499.caviar_condition_1.z -l /tmp/RtmpcU0JHI/file760f3a25624d.ld -o /tmp/RtmpcU0JHI/file760fcf36499.caviar_condition_1 -c 3
@-------------------------------------------------------------@
| CAVIAR!		| 	   v2.2         |  10/Apr/2018| 
|-------------------------------------------------------------|
| (C) 2018 Farhad Hormozdiari, GNU General Public License, v2 |
|-------------------------------------------------------------|
| For documentation, citation & bug-report instructions:      |
| 		http://genetics.cs.ucla.edu/caviar/           |
@-------------------------------------------------------------@
Max Causal=3
99.9813%Total Likelihood= 2.304663e+01 SNP=232 

128 3.690046e-01
98 3.960911e-01
126 4.231605e-01
144 4.501783e-01
1 4.663686e-01
26 4.790929e-01
24 4.908481e-01
95 5.024325e-01
88 5.140168e-01
89 5.256011e-01
91 5.371854e-01
92 5.487697e-01
85 5.603540e-01
76 5.719383e-01
70 5.835164e-01
73 5.950944e-01
67 6.066660e-01
119 6.182377e-01
64 6.298031e-01
63 6.413684e-01
62 6.529337e-01
55 6.644863e-01
47 6.759944e-01
23 6.872392e-01
22 6.975064e-01
20 7.074492e-01
19 7.172269e-01
3 7.250237e-01
54 7.302127e-01
57 7.350613e-01
106 7.395296e-01
14 7.439730e-01
29 7.484106e-01
13 7.528106e-01
11 7.571592e-01
6 7.611425e-01
131 7.649307e-01
140 7.681735e-01
141 7.714163e-01
0 7.745273e-01
69 7.774099e-01
125 7.802925e-01
114 7.831742e-01
117 7.860558e-01
116 7.889375e-01
120 7.918191e-01
156 7.946591e-01
158 7.974181e-01
58 8.001530e-01
159 8.028429e-01
171 8.052110e-01
161 8.075288e-01
165 8.096930e-01
139 8.118558e-01
230 8.140047e-01
111 8.160838e-01
195 8.180719e-01
168 8.199185e-01
167 8.217637e-01
163 8.235570e-01
157 8.253363e-01
2 8.269667e-01
15 8.285837e-01
82 8.300877e-01
164 8.315668e-01
220 8.330418e-01
72 8.344964e-01
146 8.359469e-01
65 8.373968e-01
184 8.387909e-01
138 8.401593e-01
71 8.415180e-01
121 8.428493e-01
177 8.441497e-01
127 8.454462e-01
49 8.467352e-01
129 8.480121e-01
48 8.492804e-01
193 8.505374e-01
87 8.517937e-01
149 8.530354e-01
148 8.542770e-01
38 8.554810e-01
39 8.566759e-01
145 8.578570e-01
32 8.590354e-01
56 8.602132e-01
30 8.613908e-01
115 8.625679e-01
61 8.637450e-01
78 8.649208e-01
198 8.660939e-01
135 8.672631e-01
21 8.684188e-01
103 8.695663e-01
104 8.707016e-01
75 8.718342e-01
97 8.729661e-01
102 8.740974e-01
101 8.752282e-01
194 8.763585e-01
100 8.774885e-01
133 8.786182e-01
132 8.797466e-01
110 8.808738e-01
112 8.820006e-01
222 8.831265e-01
124 8.842477e-01
105 8.853685e-01
185 8.864867e-01
188 8.876049e-01
52 8.887203e-01
136 8.898343e-01
209 8.909455e-01
84 8.920471e-01
108 8.931456e-01
33 8.942394e-01
192 8.953194e-01
41 8.963973e-01
200 8.974734e-01
202 8.985494e-01
211 8.996255e-01
215 9.007016e-01
221 9.017735e-01
79 9.028454e-01
96 9.039098e-01
99 9.049741e-01
150 9.060374e-01
207 9.070999e-01
189 9.081492e-01
218 9.091870e-01
77 9.102198e-01
35 9.112482e-01
28 9.122766e-01
18 9.133047e-01
153 9.143291e-01
27 9.153523e-01
31 9.163754e-01
60 9.173974e-01
107 9.184182e-01
162 9.194276e-01
5 9.204327e-01
203 9.214301e-01
143 9.224148e-01
183 9.233973e-01
147 9.243771e-01
217 9.253547e-01
186 9.263289e-01
205 9.273012e-01
204 9.282735e-01
208 9.292458e-01
212 9.302181e-01
154 9.311862e-01
160 9.321512e-01
173 9.331001e-01
214 9.340454e-01
176 9.349881e-01
174 9.359305e-01
179 9.368721e-01
181 9.378133e-01
169 9.387530e-01
170 9.396859e-01
190 9.406156e-01
86 9.415431e-01
210 9.424540e-01
191 9.433627e-01
182 9.442631e-01
59 9.451620e-01
187 9.460599e-01
178 9.469548e-01
180 9.478497e-01
224 9.487404e-01
201 9.496267e-01
197 9.505130e-01

In [16]:
caviar = readRDS("N2finemapping.CAVIAR.rds")
snp = caviar[[1]]$snp
pip = snp[order(as.numeric(snp$snp)),]$snp_prob
susie_pplot(pip, dtype='PIP', b=b, main = 'CAVIAR')
In [30]:
export PATH=~/GIT/github/mvarbvs/dsc/modules/linux:$PATH
python ~/GIT/software/susieR/inst/code/dap-g.py N2.with_sumstats.rds N2finemapping.DAP -ld_control 0.20 --all
In [32]:
dap = readRDS("N2finemapping.DAP.rds")
snp = dap[[1]]$snp
pip = snp[order(as.numeric(snp$snp)),]$snp_prob
susie_pplot(pip, dtype='PIP', b=b, main = 'DAP')

Here DAP also does not think the top z-score is strong enough to be boosted.

SuSiE with prior estimated

In [33]:
set.seed(1)
fitted = susie(dat$X, dat$y, L=5,
               estimate_residual_variance=TRUE, 
               estimate_prior_variance=TRUE,
               tol=1e-3, track_fit=TRUE)
sets = susie_get_CS(fitted,
            coverage = 0.95,
            X = dat$X, 
            min_abs_corr = 0.4)
pip = susie_get_PIP(fitted, sets$cs_index)
susie_pplot(pip, res = fitted, CS = sets, max_cs = 0.4, dtype='PIP',b=b)

Now SuSiE gives exactly same result as CAVIAR.

In [36]:
fitted$sa2
  1. 0.501225173264026
  2. 0
  3. 0
  4. 0
  5. 0
In [ ]:


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