Skip to contents

Extracts coefficients from an existing mvSuSiE fit. This never fits mvSuSiE itself: fine-mapping belongs to fineMappingPipeline(), and a missing fit is an error rather than an invitation to refit.

Usage

mvsusieWeights(mvsusieFit = NULL)

Arguments

mvsusieFit

A fitted mvSuSiE object. Required.

Value

Matrix of variant weights.

Examples

# \donttest{
# Requires susieR attached (mvsusieR 0.3.0 packaging limitation).
library(susieR)
data(multiTraitData)
X <- multiTraitData$X[, 1:60]
Y <- multiTraitData$Y
fit <- fitMvsusie(X = X, Y = Y,
  prior_variance = buildMvsusieMixturePrior(R = ncol(Y)),
  methodArgs = MvsusieOptions(max_iter = 50))
#> mvsusie: N=400, J=60, R=7, L=10 [mem: 1.01 GB]
#> Residual variance set, common_cov=FALSE [mem: 1.01 GB]
#> Prior: K=12 mixture components [mem: 1.01 GB]
#> Eigendecomposition cache: K=12, common_cov=FALSE [mem: 1.02 GB]
#> Model initialized: J=60, R=7, L=10, K=12 [mem: 1.02 GB]
#> iter          ELBO       delta   sigma2      mem      V
#>    1    -1209.0798           -   diag[0.151,0.152]   1.02 GB  [2.27e-04, 1.04e-04, 5.79e-05, 3.42e-05, 2.07e-05, 1.28e-05, 7.91e-06, 4.93e-06, 3.08e-06, 1.92e-06]
#>    2    -1208.7445    3.35e-01   diag[0.151,0.152]   1.02 GB  [9.74e-04, 2.08e-06, 4.28e-06, 2.39e-06, 1.52e-06, 9.48e-07, 0 x 4]
#>    3    -1208.7260    1.84e-02   diag[0.151,0.152]   1.02 GB  [1.24e-03, 0 x 9]
#>    4    -1208.7259    1.35e-04   diag[0.151,0.152]   1.02 GB  [1.26e-03, 0 x 9]
#>    5    -1208.7259    0.00e+00   diag[0.151,0.152]   1.02 GB  [1.26e-03, 0 x 9]  converged
#> Eigendecomposition cache: K=12, common_cov=FALSE [mem: 1.02 GB]
#> Model initialized: J=60, R=7, L=10, K=12 [mem: 1.02 GB]
#> iter          ELBO       delta   sigma2      mem      V
#>    1    -1209.0765           -   diag[0.149,0.151]   1.02 GB  [2.40e-04, 1.07e-04, 5.92e-05, 3.48e-05, 2.11e-05, 1.29e-05, 8.02e-06, 4.99e-06, 3.11e-06, 1.94e-06]
#>    2    -1208.7189    3.58e-01   diag[0.149,0.151]   1.02 GB  [1.01e-03, 4.34e-06, 4.18e-06, 2.47e-06, 1.55e-06, 9.69e-07, 0 x 4]
#>    3    -1208.6991    1.99e-02   diag[0.149,0.151]   1.02 GB  [1.28e-03, 0 x 9]
#>    4    -1208.6989    1.98e-04   diag[0.149,0.151]   1.02 GB  [1.31e-03, 0 x 9]
#>    5    -1208.6989    2.27e-13   diag[0.149,0.151]   1.02 GB  [1.31e-03, 0 x 9]  converged
#> Block ascent iter 1: ELBO=-1208.6989, change=0.02702, sigma2=[0.15, 0.15, 0.151, 0.15, 0.15, 0.149, 0.15]
mvsusieWeights(mvsusieFit = fit)
#>                                       cond_1 cond_2 cond_3 cond_4 cond_5
#> chr8:27119632_TA_T                         0      0      0      0      0
#> chr8:27119646_A_AG                         0      0      0      0      0
#> chr8:27119646_A_G                          0      0      0      0      0
#> chr8:27119788_C_T                          0      0      0      0      0
#> chr8:27119867_G_T                          0      0      0      0      0
#> chr8:27119961_G_T                          0      0      0      0      0
#> chr8:27120636_C_T                          0      0      0      0      0
#> chr8:27120932_A_G                          0      0      0      0      0
#> chr8:27121290_T_C                          0      0      0      0      0
#> chr8:27121498_C_A                          0      0      0      0      0
#> chr8:27121702_G_A                          0      0      0      0      0
#> chr8:27121936_A_G                          0      0      0      0      0
#> chr8:27122117_CAA_C                        0      0      0      0      0
#> chr8:27122117_CAAA_C                       0      0      0      0      0
#> chr8:27122139_A_C                          0      0      0      0      0
#> chr8:27122351_G_A                          0      0      0      0      0
#> chr8:27123070_G_C                          0      0      0      0      0
#> chr8:27123164_C_T                          0      0      0      0      0
#> chr8:27123274_T_TG                         0      0      0      0      0
#> chr8:27123283_T_TTTTTGTTTTGTTTTG           0      0      0      0      0
#> chr8:27123283_T_TTTTTGTTTTG                0      0      0      0      0
#> chr8:27123283_T_TTTTTGTTTTGTTTTGTTTTG      0      0      0      0      0
#> chr8:27123383_C_T                          0      0      0      0      0
#> chr8:27123630_G_C                          0      0      0      0      0
#> chr8:27123806_T_C                          0      0      0      0      0
#> chr8:27124049_A_G                          0      0      0      0      0
#> chr8:27124126_T_C                          0      0      0      0      0
#> chr8:27124147_C_A                          0      0      0      0      0
#> chr8:27124381_A_G                          0      0      0      0      0
#> chr8:27124644_G_A                          0      0      0      0      0
#> chr8:27124683_C_T                          0      0      0      0      0
#> chr8:27125591_C_G                          0      0      0      0      0
#> chr8:27125730_A_G                          0      0      0      0      0
#> chr8:27125829_T_A                          0      0      0      0      0
#> chr8:27126386_A_G                          0      0      0      0      0
#> chr8:27126486_C_T                          0      0      0      0      0
#> chr8:27127215_T_A                          0      0      0      0      0
#> chr8:27127370_T_C                          0      0      0      0      0
#> chr8:27127374_T_C                          0      0      0      0      0
#> chr8:27127405_T_C                          0      0      0      0      0
#> chr8:27128069_G_A                          0      0      0      0      0
#> chr8:27128102_T_TAAAG                      0      0      0      0      0
#> chr8:27128473_C_G                          0      0      0      0      0
#> chr8:27128733_G_T                          0      0      0      0      0
#> chr8:27129375_G_GA                         0      0      0      0      0
#> chr8:27129602_T_C                          0      0      0      0      0
#> chr8:27129674_A_G                          0      0      0      0      0
#> chr8:27129849_TAAA_T                       0      0      0      0      0
#> chr8:27129864_G_A                          0      0      0      0      0
#> chr8:27129921_C_T                          0      0      0      0      0
#> chr8:27130038_G_A                          0      0      0      0      0
#> chr8:27130250_G_C                          0      0      0      0      0
#> chr8:27130586_G_C                          0      0      0      0      0
#> chr8:27130820_A_T                          0      0      0      0      0
#> chr8:27131153_G_T                          0      0      0      0      0
#> chr8:27131169_T_A                          0      0      0      0      0
#> chr8:27131173_C_T                          0      0      0      0      0
#> chr8:27131449_G_A                          0      0      0      0      0
#> chr8:27131584_G_A                          0      0      0      0      0
#> chr8:27132152_T_C                          0      0      0      0      0
#>                                              cond_6        cond_7
#> chr8:27119632_TA_T                     5.180715e-04 -1.016230e-20
#> chr8:27119646_A_AG                    -9.418167e-05  1.794997e-22
#> chr8:27119646_A_G                     -1.526077e-04  2.049952e-21
#> chr8:27119788_C_T                      2.160531e-05  3.882281e-21
#> chr8:27119867_G_T                      2.160531e-05  3.882281e-21
#> chr8:27119961_G_T                      5.346543e-04  2.504755e-21
#> chr8:27120636_C_T                     -9.029812e-05  9.121655e-22
#> chr8:27120932_A_G                      3.531336e-05 -1.335941e-21
#> chr8:27121290_T_C                     -3.242028e-04  8.755412e-21
#> chr8:27121498_C_A                     -3.242028e-04  8.755412e-21
#> chr8:27121702_G_A                      1.089555e-04 -2.701755e-21
#> chr8:27121936_A_G                     -1.526077e-04  2.049952e-21
#> chr8:27122117_CAA_C                   -1.669376e-04  2.225053e-21
#> chr8:27122117_CAAA_C                   5.347964e-06  9.281502e-22
#> chr8:27122139_A_C                      4.897130e-04 -1.097654e-20
#> chr8:27122351_G_A                     -2.916208e-04  3.441652e-21
#> chr8:27123070_G_C                     -7.994490e-04 -1.295401e-20
#> chr8:27123164_C_T                     -1.978132e-03  2.051773e-20
#> chr8:27123274_T_TG                     5.023109e-04  2.448323e-20
#> chr8:27123283_T_TTTTTGTTTTGTTTTG      -5.610249e-04  6.249084e-21
#> chr8:27123283_T_TTTTTGTTTTG            2.972137e-05  1.765167e-22
#> chr8:27123283_T_TTTTTGTTTTGTTTTGTTTTG -6.609647e-03  1.649605e-19
#> chr8:27123383_C_T                     -8.612533e-04 -1.396893e-20
#> chr8:27123630_G_C                     -7.510018e-04  2.485127e-21
#> chr8:27123806_T_C                     -8.612533e-04 -1.396893e-20
#> chr8:27124049_A_G                     -8.612533e-04 -1.396893e-20
#> chr8:27124126_T_C                     -9.029812e-05  9.121655e-22
#> chr8:27124147_C_A                     -8.612533e-04 -1.396893e-20
#> chr8:27124381_A_G                     -7.031334e-06  4.023005e-22
#> chr8:27124644_G_A                     -1.526077e-04  2.049952e-21
#> chr8:27124683_C_T                     -9.029812e-05  9.121655e-22
#> chr8:27125591_C_G                     -7.031334e-06  4.023005e-22
#> chr8:27125730_A_G                     -2.259705e-05  7.406306e-22
#> chr8:27125829_T_A                     -2.427355e-06 -1.261565e-23
#> chr8:27126386_A_G                     -4.267826e-04 -1.047969e-20
#> chr8:27126486_C_T                     -1.526077e-04  2.049952e-21
#> chr8:27127215_T_A                     -9.099366e-05  2.317934e-21
#> chr8:27127370_T_C                      2.188138e-05 -3.207879e-22
#> chr8:27127374_T_C                      2.188138e-05 -3.207879e-22
#> chr8:27127405_T_C                     -1.526077e-04  2.049952e-21
#> chr8:27128069_G_A                     -8.612533e-04 -1.396893e-20
#> chr8:27128102_T_TAAAG                 -9.840183e-04 -2.925805e-20
#> chr8:27128473_C_G                      3.043701e-04  2.609299e-21
#> chr8:27128733_G_T                     -9.029812e-05  9.121655e-22
#> chr8:27129375_G_GA                    -8.612533e-04 -1.396893e-20
#> chr8:27129602_T_C                     -9.452814e-04 -1.531703e-20
#> chr8:27129674_A_G                     -8.612533e-04 -1.396893e-20
#> chr8:27129849_TAAA_T                   3.977784e-04  7.996703e-21
#> chr8:27129864_G_A                      2.476848e-04 -1.217545e-20
#> chr8:27129921_C_T                      9.236547e-05 -2.552202e-21
#> chr8:27130038_G_A                      3.043701e-04  2.609299e-21
#> chr8:27130250_G_C                      1.853109e-05  3.356641e-22
#> chr8:27130586_G_C                     -8.612533e-04 -1.396893e-20
#> chr8:27130820_A_T                     -9.099366e-05  2.317934e-21
#> chr8:27131153_G_T                     -1.526077e-04  2.049952e-21
#> chr8:27131169_T_A                      1.853109e-05  3.356641e-22
#> chr8:27131173_C_T                      2.592752e-04  4.856848e-21
#> chr8:27131449_G_A                      1.308575e-05  3.185194e-21
#> chr8:27131584_G_A                     -8.612533e-04 -1.396893e-20
#> chr8:27132152_T_C                     -9.099366e-05  2.317934e-21
# }