Multivariate Bayesian variable selection regression

Fine mapping on FMO2 data in GTEx

This is an update and combined version of m&m and susie on multi-tissue fine mapping.

Major updates:

  • Fixed lfsr computation: now lfsr is defined as how "mappable" are the SNP sets identified by the $l$-th fit.
  • In addition to a modified version of effect-level plots (posterior mean plot similar to the ones shown before), we summarize for each $l$:

    • The size of 95% HPD interval
    • The purity of it (defined by the smallest pair-wise LD)
    • The minimum lfsr across conditions

    we expect to see high correlation between small size, high purity and low lfsr.

The DSC prototype

As previously explained we use DSC for prototyping of these methods

In [1]:
%cd ../src/model_dsc
/home/gaow/GIT/github/mvarbvs/src/model_dsc
In [2]:
./model.dsc -h
INFO: MODULES
+------------+---------------------+--------------------------------+-------------------+------+
|            |      parameters     |             input              |       output      | type |
+------------+---------------------+--------------------------------+-------------------+------+
|  get_data  |      data_file      |                                |        data       |  R   |
| original_Y |                     |              data              |        data       |  PY  |
|  init_mnm  | Sigma, (U, grid, p) |              data              |    data, model    |  R   |
|  fit_mnm   |      maxL, maxI     |          data, model           | fitted, posterior |  R   |
| fit_varbvs |    sa, maxL, maxI   |              data              | posterior, fitted |  R   |
|  diagnose  |                     | data, model, fitted, posterior |     diagnosed     |  R   |
| fit_susie  |    sa, maxL, maxI   |              data              | posterior, fitted |  R   |
+------------+---------------------+--------------------------------+-------------------+------+

INFO: PIPELINES
first_pass: get_data -> get_Y -> init -> fit -> diagnose

INFO: PIPELINES EXPANDED
1: get_data -> original_Y -> init_mnm -> fit_mnm -> diagnose
2: get_data -> original_Y -> init_mnm -> fit_susie -> diagnose
3: get_data -> original_Y -> init_mnm -> fit_varbvs -> diagnose

INFO: R LIBRARIES
INFO: Scanning package versions ...
+--------+---------+
|  name  | version |
+--------+---------+
| abind  |  1.4.5  |
| mashr  |  0.2.7  |
| susieR |  0.1.2  |
| varbvs |  2.5.2  |
+--------+---------+

INFO: PYTHON MODULES
+------+---------+
| name | version |
+------+---------+
| rpy2 | 0.2.7.5 |
| dsc  |  2.9.2  |
+------+---------+

As a first pass I extracted data for FMO2 on Thyroid and Lung. I use a maximum of 5 effects and 10 iterations of variational updates:

In [3]:
./model.dsc
INFO: Checking R library mashr ...
INFO: Checking R library abind ...
INFO: Checking R library varbvs@pcarbo/varbvs/varbvs-R ...
INFO: Checking R library susieR@stephenslab/susieR ...
INFO: Checking R library dscrutils@stephenslab/dsc/dscrutils ...
INFO: DSC script exported to mnm_model.html
INFO: Constructing DSC from ./model.dsc ...
INFO: Building execution graph & running DSC ...
DSC: 100%|██████████████████████████████████████| 10/10 [04:15<00:00, 24.53s/it]
INFO: Building DSC database ...
INFO: DSC complete!
INFO: Elapsed time 264.727 seconds.

Scripts for the DSC can be found here.

Plot utilities

In [4]:
import seaborn as sns
import matplotlib.pyplot as plt

def plot_beta(yaxis, zaxis, ld, ci, 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 'CIMax' in conf:
        for idx in range(ci[1].shape[0]):
            if ci[0][idx] < conf['CIMax']:
                for ii, xx in enumerate(yaxis):
                    if ci[1][idx, ii] > 0:
                        ax.scatter(xaxis[ii], yaxis[ii], s=80,
                                   facecolors='none', edgecolors='#D3D3D3')
    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()

Other utils

In [9]:
import itertools
def get_set_positions(in_ci):
    positions = []
    curr_len = 0
    for b, g in itertools.groupby(in_ci):
        lg = len(list(g))
        if b:
            positions.append((curr_len, curr_len + lg))
        curr_len += lg
    return positions

Results from M&M

In [5]:
res = readRDS('mnm_model/fit_mnm/get_data_1_original_Y_1_init_mnm_1_fit_mnm_1.rds')$posterior
dat = readRDS('mnm_model/init_mnm/get_data_1_original_Y_1_init_mnm_1.rds')$data
In [6]:
r2 = dat$r2
In [7]:
%get r2 res --from R
Loading required package: feather

Quantities of interest

We are interested in alpha, n_in_CI, r2 and lfsr. Variable ci_sets helps extract those CI to plot.

In [23]:
res['ci_sets'] = [get_set_positions(ci) for ci in res['in_CI']]
Out[23]:
array([[5.02270854e-16, 5.28579835e-13, 2.41333343e-06, 2.32107453e-10,
        7.02121251e-05],
       [7.10181301e-16, 1.63280769e-12, 4.89671641e-06, 4.74065873e-10,
        1.53345627e-04],
       [9.74334382e-16, 1.47910641e-12, 4.62195429e-06, 4.03392300e-10,
        1.33824069e-04],
       ...,
       [5.23380415e-16, 5.16879272e-13, 1.94544887e-06, 2.30002450e-10,
        6.79727553e-05],
       [6.67798587e-16, 3.15949653e-13, 1.48179937e-06, 3.68383617e-10,
        5.50379340e-05],
       [5.62294006e-16, 5.23157669e-13, 1.96230912e-06, 2.30986910e-10,
        6.93099179e-05]])
In [24]:
res['n_in_CI']
Out[24]:
[1, 4, 16, 12, 6248]
In [12]:
res['alpha'].shape
Out[12]:
(7492, 5)
In [11]:
ci_sets
Out[11]:
[[(4017, 4018)],
 [(3486, 3487), (3494, 3495), (3497, 3498), (3500, 3501)],
 [(3713, 3714),
  (3731, 3734),
  (3748, 3749),
  (3751, 3753),
  (3760, 3761),
  (3766, 3767),
  (3775, 3776),
  (3779, 3780),
  (3798, 3800),
  (3830, 3831),
  (3839, 3840),
  (3856, 3857)],
 [(3369, 3370),
  (3373, 3374),
  (3391, 3392),
  (3393, 3395),
  (3468, 3469),
  (3478, 3479),
  (3533, 3534),
  (3601, 3602),
  (3608, 3609),
  (3610, 3611),
  (3623, 3624)],
 [(0, 5),
  (6, 64),
  (65, 76),
  (77, 80),
  (81, 86),
  (87, 95),
  (96, 104),
  (105, 106),
  (107, 110),
  (112, 125),
  (126, 127),
  (128, 131),
  (132, 139),
  (140, 145),
  (146, 152),
  (155, 171),
  (173, 174),
  (175, 180),
  (181, 233),
  (234, 237),
  (238, 240),
  (243, 245),
  (246, 248),
  (250, 254),
  (255, 259),
  (260, 261),
  (265, 266),
  (267, 268),
  (269, 275),
  (276, 284),
  (285, 297),
  (298, 302),
  (303, 304),
  (305, 312),
  (313, 314),
  (316, 320),
  (321, 331),
  (332, 333),
  (336, 340),
  (341, 342),
  (345, 347),
  (348, 349),
  (354, 362),
  (364, 371),
  (372, 378),
  (380, 381),
  (382, 385),
  (386, 393),
  (394, 416),
  (418, 440),
  (441, 448),
  (449, 450),
  (451, 454),
  (455, 457),
  (458, 459),
  (461, 485),
  (486, 532),
  (533, 542),
  (544, 545),
  (546, 563),
  (565, 570),
  (571, 594),
  (598, 600),
  (602, 603),
  (604, 605),
  (607, 608),
  (609, 610),
  (611, 615),
  (616, 618),
  (619, 622),
  (624, 633),
  (638, 651),
  (652, 667),
  (668, 670),
  (671, 683),
  (684, 685),
  (686, 687),
  (688, 690),
  (691, 694),
  (695, 702),
  (703, 715),
  (716, 717),
  (718, 719),
  (720, 738),
  (739, 744),
  (746, 750),
  (751, 755),
  (757, 760),
  (761, 767),
  (769, 779),
  (782, 784),
  (785, 788),
  (789, 790),
  (791, 812),
  (813, 815),
  (816, 817),
  (818, 820),
  (822, 825),
  (826, 827),
  (828, 831),
  (832, 886),
  (887, 890),
  (891, 892),
  (893, 896),
  (897, 901),
  (902, 929),
  (930, 932),
  (933, 935),
  (936, 942),
  (943, 951),
  (953, 962),
  (963, 973),
  (974, 975),
  (976, 985),
  (986, 1045),
  (1046, 1076),
  (1077, 1091),
  (1092, 1107),
  (1108, 1156),
  (1157, 1158),
  (1159, 1160),
  (1162, 1166),
  (1167, 1175),
  (1176, 1184),
  (1185, 1198),
  (1199, 1202),
  (1205, 1225),
  (1226, 1250),
  (1251, 1255),
  (1256, 1264),
  (1265, 1274),
  (1275, 1289),
  (1290, 1291),
  (1292, 1301),
  (1302, 1309),
  (1310, 1311),
  (1312, 1317),
  (1318, 1350),
  (1351, 1358),
  (1359, 1379),
  (1380, 1382),
  (1383, 1389),
  (1390, 1395),
  (1396, 1411),
  (1412, 1438),
  (1439, 1440),
  (1441, 1444),
  (1446, 1460),
  (1461, 1463),
  (1464, 1468),
  (1470, 1476),
  (1477, 1478),
  (1479, 1480),
  (1482, 1484),
  (1485, 1489),
  (1490, 1496),
  (1498, 1500),
  (1504, 1507),
  (1508, 1510),
  (1511, 1514),
  (1515, 1519),
  (1520, 1521),
  (1522, 1525),
  (1526, 1527),
  (1528, 1529),
  (1530, 1535),
  (1536, 1539),
  (1541, 1542),
  (1543, 1544),
  (1546, 1547),
  (1549, 1550),
  (1552, 1553),
  (1554, 1555),
  (1556, 1557),
  (1559, 1562),
  (1564, 1566),
  (1567, 1569),
  (1572, 1574),
  (1575, 1579),
  (1581, 1583),
  (1584, 1587),
  (1588, 1589),
  (1590, 1591),
  (1593, 1596),
  (1598, 1600),
  (1605, 1606),
  (1609, 1611),
  (1613, 1616),
  (1617, 1619),
  (1622, 1626),
  (1627, 1630),
  (1632, 1634),
  (1635, 1637),
  (1641, 1642),
  (1645, 1647),
  (1648, 1649),
  (1651, 1652),
  (1655, 1656),
  (1657, 1660),
  (1662, 1663),
  (1665, 1666),
  (1667, 1668),
  (1669, 1671),
  (1673, 1676),
  (1679, 1680),
  (1681, 1686),
  (1688, 1689),
  (1693, 1694),
  (1698, 1699),
  (1701, 1705),
  (1706, 1708),
  (1709, 1710),
  (1716, 1717),
  (1718, 1720),
  (1724, 1725),
  (1726, 1728),
  (1731, 1733),
  (1737, 1740),
  (1741, 1742),
  (1743, 1746),
  (1747, 1748),
  (1749, 1751),
  (1753, 1754),
  (1755, 1756),
  (1759, 1760),
  (1761, 1762),
  (1763, 1764),
  (1765, 1766),
  (1768, 1777),
  (1779, 1780),
  (1782, 1789),
  (1791, 1794),
  (1795, 1797),
  (1798, 1810),
  (1812, 1817),
  (1819, 1828),
  (1829, 1840),
  (1841, 1842),
  (1843, 1844),
  (1845, 1868),
  (1869, 1884),
  (1885, 1945),
  (1946, 1947),
  (1948, 1953),
  (1954, 1958),
  (1959, 1965),
  (1966, 1976),
  (1977, 1980),
  (1981, 1985),
  (1986, 1990),
  (1991, 2004),
  (2005, 2008),
  (2009, 2011),
  (2012, 2017),
  (2018, 2020),
  (2022, 2024),
  (2025, 2027),
  (2028, 2032),
  (2033, 2036),
  (2037, 2049),
  (2050, 2063),
  (2064, 2066),
  (2067, 2075),
  (2076, 2081),
  (2082, 2086),
  (2087, 2088),
  (2089, 2095),
  (2097, 2102),
  (2103, 2110),
  (2114, 2115),
  (2116, 2120),
  (2121, 2122),
  (2124, 2129),
  (2131, 2133),
  (2135, 2138),
  (2139, 2143),
  (2144, 2152),
  (2153, 2163),
  (2164, 2169),
  (2171, 2172),
  (2173, 2176),
  (2177, 2182),
  (2183, 2184),
  (2185, 2187),
  (2188, 2191),
  (2192, 2195),
  (2197, 2202),
  (2204, 2205),
  (2206, 2208),
  (2209, 2211),
  (2213, 2215),
  (2216, 2218),
  (2220, 2221),
  (2222, 2225),
  (2226, 2227),
  (2228, 2229),
  (2230, 2234),
  (2235, 2242),
  (2243, 2244),
  (2245, 2246),
  (2247, 2250),
  (2251, 2255),
  (2256, 2259),
  (2260, 2261),
  (2263, 2269),
  (2270, 2272),
  (2275, 2277),
  (2278, 2279),
  (2281, 2284),
  (2286, 2288),
  (2289, 2294),
  (2296, 2297),
  (2298, 2301),
  (2302, 2303),
  (2307, 2309),
  (2310, 2311),
  (2313, 2314),
  (2315, 2316),
  (2317, 2318),
  (2322, 2324),
  (2326, 2327),
  (2329, 2332),
  (2334, 2335),
  (2336, 2337),
  (2338, 2340),
  (2345, 2349),
  (2351, 2352),
  (2359, 2360),
  (2364, 2365),
  (2375, 2376),
  (2379, 2380),
  (2381, 2390),
  (2391, 2406),
  (2407, 2444),
  (2445, 2457),
  (2458, 2465),
  (2466, 2527),
  (2528, 2565),
  (2566, 2568),
  (2569, 2609),
  (2610, 2614),
  (2617, 2628),
  (2630, 2642),
  (2643, 2651),
  (2653, 2655),
  (2656, 2683),
  (2684, 2692),
  (2693, 2698),
  (2699, 2712),
  (2713, 2715),
  (2716, 2719),
  (2722, 2724),
  (2725, 2727),
  (2728, 2737),
  (2738, 2742),
  (2743, 2887),
  (2888, 2890),
  (2891, 2894),
  (2895, 2901),
  (2902, 2905),
  (2906, 2910),
  (2911, 2913),
  (2915, 2916),
  (2918, 2921),
  (2923, 2927),
  (2933, 3090),
  (3091, 3110),
  (3111, 3123),
  (3124, 3128),
  (3129, 3141),
  (3142, 3274),
  (3275, 3304),
  (3305, 3308),
  (3313, 3362),
  (3363, 3365),
  (3366, 3369),
  (3370, 3373),
  (3374, 3379),
  (3380, 3386),
  (3387, 3391),
  (3392, 3393),
  (3395, 3396),
  (3397, 3407),
  (3409, 3410),
  (3411, 3419),
  (3420, 3422),
  (3423, 3425),
  (3427, 3430),
  (3432, 3437),
  (3438, 3439),
  (3441, 3450),
  (3451, 3453),
  (3454, 3455),
  (3456, 3459),
  (3460, 3462),
  (3463, 3468),
  (3469, 3472),
  (3473, 3475),
  (3476, 3478),
  (3480, 3486),
  (3487, 3488),
  (3489, 3494),
  (3496, 3497),
  (3498, 3500),
  (3501, 3553),
  (3554, 3602),
  (3603, 3604),
  (3605, 3608),
  (3609, 3610),
  (3611, 3639),
  (3640, 3642),
  (3643, 3647),
  (3649, 3682),
  (3684, 3874),
  (3875, 3973),
  (3974, 4001),
  (4003, 4014),
  (4016, 4017),
  (4019, 4193),
  (4194, 4197),
  (4198, 4201),
  (4202, 4288),
  (4289, 4340),
  (4341, 4348),
  (4349, 4354),
  (4355, 4367),
  (4368, 4369),
  (4370, 4381),
  (4382, 4384),
  (4385, 4402),
  (4403, 4426),
  (4427, 4440),
  (4441, 4444),
  (4445, 4468),
  (4470, 4471),
  (4472, 4473),
  (4476, 4477),
  (4478, 4479),
  (4480, 4481),
  (4482, 4488),
  (4491, 4492),
  (4494, 4495),
  (4497, 4501),
  (4502, 4504),
  (4505, 4507),
  (4508, 4509),
  (4510, 4511),
  (4512, 4515),
  (4518, 4521),
  (4522, 4523),
  (4524, 4527),
  (4529, 4531),
  (4532, 4533),
  (4534, 4536),
  (4538, 4539),
  (4540, 4545),
  (4546, 4547),
  (4548, 4553),
  (4554, 4555),
  (4556, 4557),
  (4558, 4559),
  (4560, 4565),
  (4567, 4570),
  (4571, 4573),
  (4574, 4576),
  (4577, 4579),
  (4582, 4584),
  (4585, 4600),
  (4603, 4605),
  (4606, 4629),
  (4630, 4637),
  (4638, 4642),
  (4643, 4644),
  (4645, 4673),
  (4674, 4676),
  (4677, 4683),
  (4684, 4691),
  (4692, 4709),
  (4711, 4712),
  (4714, 4717),
  (4718, 4720),
  (4721, 4722),
  (4724, 4726),
  (4727, 4729),
  (4730, 4736),
  (4737, 4791),
  (4792, 4819),
  (4820, 4842),
  (4843, 4877),
  (4878, 4909),
  (4910, 4924),
  (4925, 4980),
  (4981, 4988),
  (4990, 4991),
  (4994, 4997),
  (4998, 4999),
  (5001, 5003),
  (5009, 5011),
  (5012, 5013),
  (5014, 5015),
  (5016, 5019),
  (5020, 5021),
  (5022, 5023),
  (5024, 5026),
  (5027, 5029),
  (5030, 5033),
  (5034, 5036),
  (5037, 5049),
  (5051, 5058),
  (5059, 5060),
  (5061, 5069),
  (5070, 5076),
  (5078, 5086),
  (5087, 5103),
  (5104, 5117),
  (5118, 5119),
  (5120, 5124),
  (5127, 5144),
  (5145, 5149),
  (5150, 5151),
  (5152, 5157),
  (5158, 5169),
  (5170, 5192),
  (5193, 5200),
  (5201, 5212),
  (5213, 5218),
  (5219, 5226),
  (5227, 5234),
  (5235, 5265),
  (5266, 5274),
  (5275, 5289),
  (5290, 5295),
  (5296, 5388),
  (5389, 5391),
  (5392, 5395),
  (5397, 5430),
  (5431, 5445),
  (5446, 5457),
  (5458, 5503),
  (5505, 5577),
  (5578, 5583),
  (5584, 5588),
  (5589, 5590),
  (5591, 5592),
  (5593, 5595),
  (5597, 5602),
  (5603, 5604),
  (5605, 5608),
  (5609, 5610),
  (5611, 5612),
  (5613, 5618),
  (5620, 5624),
  (5625, 5628),
  (5629, 5631),
  (5632, 5633),
  (5634, 5642),
  (5643, 5646),
  (5647, 5648),
  (5649, 5653),
  (5654, 5661),
  (5662, 5665),
  (5666, 5668),
  (5669, 5683),
  (5684, 5686),
  (5687, 5688),
  (5689, 5691),
  (5692, 5695),
  (5696, 5704),
  (5706, 5711),
  (5712, 5736),
  (5737, 5820),
  (5821, 5831),
  (5832, 5854),
  (5856, 5857),
  (5866, 5867),
  (5869, 5870),
  (5872, 5875),
  (5877, 5878),
  (5881, 5882),
  (5891, 5892),
  (5910, 5911),
  (5912, 5913),
  (5917, 5919),
  (5920, 5921),
  (5922, 5923),
  (5924, 5925),
  (5927, 5929),
  (5930, 5931),
  (5933, 5935),
  (5939, 5947),
  (5951, 5952),
  (5953, 5954),
  (5955, 5957),
  (5958, 5961),
  (5963, 5965),
  (5967, 5968),
  (5971, 5974),
  (5977, 5980),
  (5982, 5984),
  (5985, 5988),
  (5990, 5993),
  (5997, 5999),
  (6000, 6001),
  (6002, 6004),
  (6006, 6011),
  (6012, 6015),
  (6016, 6017),
  (6018, 6023),
  (6024, 6026),
  (6027, 6028),
  (6030, 6031),
  (6032, 6034),
  (6035, 6036),
  (6038, 6043),
  (6044, 6053),
  (6054, 6055),
  (6057, 6059),
  (6060, 6061),
  (6062, 6069),
  (6070, 6072),
  (6073, 6074),
  (6076, 6077),
  (6079, 6080),
  (6082, 6085),
  (6086, 6087),
  (6088, 6094),
  (6096, 6128),
  (6129, 6133),
  (6134, 6141),
  (6142, 6159),
  (6160, 6165),
  (6166, 6168),
  (6169, 6189),
  (6190, 6199),
  (6200, 6211),
  (6214, 6215),
  (6217, 6226),
  (6229, 6230),
  (6233, 6235),
  (6236, 6239),
  (6241, 6243),
  (6249, 6250),
  (6255, 6258),
  (6264, 6265),
  (6266, 6267),
  (6268, 6269),
  (6270, 6271),
  (6272, 6273),
  (6276, 6278),
  (6279, 6281),
  (6282, 6284),
  (6286, 6287),
  (6292, 6293),
  (6301, 6302),
  (6305, 6306),
  (6313, 6314),
  (6318, 6319),
  (6324, 6325),
  (6327, 6330),
  (6337, 6338),
  (6341, 6342),
  (6347, 6349),
  (6352, 6353),
  (6354, 6356),
  (6358, 6360),
  (6362, 6363),
  (6371, 6372),
  (6374, 6375),
  (6376, 6379),
  (6386, 6388),
  (6389, 6391),
  (6408, 6412),
  (6415, 6416),
  (6418, 6419),
  (6420, 6421),
  (6423, 6424),
  (6425, 6426),
  (6434, 6435),
  (6439, 6440),
  (6441, 6443),
  (6448, 6449),
  (6451, 6454),
  (6455, 6459),
  (6463, 6465),
  (6467, 6470),
  (6471, 6476),
  (6477, 6479),
  (6482, 6483),
  (6489, 6490),
  (6493, 6495),
  (6505, 6507),
  (6510, 6511),
  (6525, 6526),
  (6527, 6529),
  (6530, 6531),
  (6535, 6537),
  (6539, 6542),
  (6543, 6559),
  (6561, 6575),
  (6576, 6616),
  (6617, 6694),
  (6695, 6771),
  (6772, 6784),
  (6785, 6836),
  (6837, 6844),
  (6845, 6854),
  (6855, 6877),
  (6878, 6881),
  (6882, 6901),
  (6902, 6911),
  (6912, 6913),
  (6914, 6920),
  (6921, 6929),
  (6930, 6932),
  (6933, 6950),
  (6952, 6955),
  (6956, 6966),
  (6968, 6971),
  (6972, 6973),
  (6975, 6976),
  (6979, 6980),
  (6982, 7012),
  (7013, 7020),
  (7021, 7029),
  (7030, 7034),
  (7035, 7037),
  (7038, 7054),
  (7055, 7066),
  (7067, 7073),
  (7075, 7077),
  (7078, 7081),
  (7082, 7126),
  (7129, 7147),
  (7149, 7155),
  (7156, 7200),
  (7201, 7212),
  (7213, 7219),
  (7220, 7227),
  (7228, 7264),
  (7266, 7281),
  (7282, 7288),
  (7289, 7292),
  (7293, 7303),
  (7304, 7312),
  (7313, 7320),
  (7323, 7334),
  (7335, 7380),
  (7381, 7396),
  (7397, 7403),
  (7404, 7416),
  (7417, 7421),
  (7422, 7425),
  (7426, 7428),
  (7430, 7433),
  (7434, 7438),
  (7440, 7445),
  (7446, 7447),
  (7449, 7450),
  (7452, 7453),
  (7455, 7460),
  (7461, 7466),
  (7467, 7472),
  (7474, 7477),
  (7478, 7482),
  (7483, 7484),
  (7485, 7486),
  (7488, 7492)]]
In [8]:
res['lfsr'].min(axis=1)
Out[8]:
array([7.68431462e-12, 2.83867537e-08, 2.28151495e-02, 3.62919314e-06,
       7.27873608e-01])

We focus on inferred posterior mean. We plot this quantity in both Thyroid and Lung tissues, annotated by local false sign rate (lfsr) and LD structure.

Thyroid results

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.

In [ ]:
conf = {'title': 'FMO2, Thyroid, M&M ASH', 
        'ylabel': 'betahat', 
        'zlabel': 'PIP (1 - lfsr)',
        'pip_cutoff': 0.95,
        'ld_cutoff1': 0.1,
        'ld_cutoff2': 0.6,
        'CIMax': 50}
plot_beta(post_mean[:,0], 1 - lfsr[:,0], r2, (n_in_CI, in_CI), conf)

Lung results

In [ ]:
conf = {'title': 'FMO2, Lung, M&M ASH', 
        'ylabel': 'betahat', 
        'zlabel': 'PIP (1 - lfsr)',
        'pip_cutoff': 0.95,
        'ld_cutoff1': 0.1,
        'ld_cutoff2': 0.6, 
        'CIMax': 50}
plot_beta(post_mean[:,1], 1 - lfsr[:,1], r2, (n_in_CI, in_CI), conf)

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