Skip to contents

An R port of the RAISS summary-statistic imputation library, described in Julienne H, Shi H, Pasaniuc B, Aschard H (2019), "RAISS: robust and accurate imputation from summary statistics", Bioinformatics 35(22):4837-4839. doi:10.1093/bioinformatics/btz466

Usage

raiss(
  refPanel = NULL,
  knownZscores,
  ldMatrix = NULL,
  genotypes = NULL,
  lamb = 0.01,
  rcond = 0.01,
  svdTol = 1e-08,
  r2Threshold = 0.6,
  minimumLd = 5,
  verbose = TRUE
)

Arguments

refPanel

A data frame containing 'chrom', 'pos', 'variant_id', 'A1', and 'A2'. Optional when the LD comes as an LdMatrix or a genotype panel, whose own variants are used; knownZscores must then label chromosomes canonically, as character (e.g. "22"). Required with a plain ldMatrix, whose rows and columns follow it.

knownZscores

A data frame containing 'chrom', 'pos', 'variant_id', 'A1', 'A2', and 'z' values.

ldMatrix

A square LD matrix over refPanel's variants, in its order, or an LdMatrix covering them. Provide either ldMatrix or genotypes, not both.

genotypes

A genotype panel (see readGenotypes) or a GenotypeMixture covering the variants, as an alternative to ldMatrix. Its dosages are matched to refPanel by variant and allele, mean-imputed and standardized here.

lamb

Regularization term added to the diagonal of the ldMatrix.

rcond

Eigenvalue cutoff for the pseudo-inverse of the known variants' LD: directions whose ridged eigenvalue is below rcond times the largest are dropped. Applied on both routes, so a genotype panel and the LD matrix computed from it give the same imputation.

svdTol

Relative tolerance below which singular values of the standardized genotypes are treated as numerically zero (genotype route only).

r2Threshold

R square threshold below which SNPs are filtered from the output.

minimumLd

Minimum LD score threshold for SNP filtering.

verbose

Logical indicating whether to print progress information.

Value

A list containing filtered and unfiltered results, and filtered LD matrix (ldMat is NULL on the genotype route).

Details

The imputation model it implements is the one introduced in Pasaniuc B, Zaitlen N, et al. (2014), "Fast and accurate imputation of summary statistics enhances evidence of functional enrichment", Bioinformatics 30(20):2906-2914. doi:10.1093/bioinformatics/btu416

One call imputes one region, from either of the two kinds of LD reference. The LD can be given as a square correlation matrix or an LdMatrix, and the imputation then inverts it. Or a genotype panel from readGenotypes can be given instead, and the imputation then works from the singular value decomposition of its standardized dosages, never forming the p x p LD matrix (memory and compute savings when n << p).

Examples

data(eqtlRegionExample)
X <- eqtlRegionExample$X[, 1:30]
refPanel <- data.frame(chrom = 22, pos = 1:30,
  variant_id = paste0("22:", 1:30, ":A:G"), A1 = "A", A2 = "G")
knownZscores <- data.frame(chrom = 22, pos = 1:20,
  variant_id = paste0("22:", 1:20, ":A:G"), A1 = "A", A2 = "G",
  z = rnorm(20))
raiss(refPanel = refPanel, knownZscores = knownZscores,
  ldMatrix = cor(X))
#> Processing LD matrix...
#> IMPUTATION REPORT
#> Variants before filter:                    10
#> Non-imputed variants:                      0
#> Imputed variants:                          10
#> Variants filtered because of low LD score: 8
#> Variants filtered because of low R2:       3
#> Remaining variants after filter:           2
#> $resultNofilter
#> # A tibble: 30 × 9
#>    chrom   pos variant_id A1    A2      Var raissLdScore raissR2       z
#>    <dbl> <int> <chr>      <chr> <chr> <dbl>        <dbl>   <dbl>   <dbl>
#>  1    22     1 22:1:A:G   A     G        -1          Inf      NA  0.837 
#>  2    22     2 22:2:A:G   A     G        -1          Inf      NA  1.93  
#>  3    22     3 22:3:A:G   A     G        -1          Inf      NA  0.493 
#>  4    22     4 22:4:A:G   A     G        -1          Inf      NA  0.0371
#>  5    22     5 22:5:A:G   A     G        -1          Inf      NA  0.0279
#>  6    22     6 22:6:A:G   A     G        -1          Inf      NA  0.990 
#>  7    22     7 22:7:A:G   A     G        -1          Inf      NA -0.287 
#>  8    22     8 22:8:A:G   A     G        -1          Inf      NA -0.218 
#>  9    22     9 22:9:A:G   A     G        -1          Inf      NA -1.63  
#> 10    22    10 22:10:A:G  A     G        -1          Inf      NA -2.39  
#> # ℹ 20 more rows
#> 
#> $resultFilter
#> # A tibble: 22 × 9
#>    chrom   pos variant_id A1    A2      Var raissLdScore raissR2       z
#>    <dbl> <int> <chr>      <chr> <chr> <dbl>        <dbl>   <dbl>   <dbl>
#>  1    22     1 22:1:A:G   A     G        -1          Inf      NA  0.837 
#>  2    22     2 22:2:A:G   A     G        -1          Inf      NA  1.93  
#>  3    22     3 22:3:A:G   A     G        -1          Inf      NA  0.493 
#>  4    22     4 22:4:A:G   A     G        -1          Inf      NA  0.0371
#>  5    22     5 22:5:A:G   A     G        -1          Inf      NA  0.0279
#>  6    22     6 22:6:A:G   A     G        -1          Inf      NA  0.990 
#>  7    22     7 22:7:A:G   A     G        -1          Inf      NA -0.287 
#>  8    22     8 22:8:A:G   A     G        -1          Inf      NA -0.218 
#>  9    22     9 22:9:A:G   A     G        -1          Inf      NA -1.63  
#> 10    22    10 22:10:A:G  A     G        -1          Inf      NA -2.39  
#> # ℹ 12 more rows
#> 
#> $ldMat
#>                    chr22:32119788:T:C chr22:32119867:T:G chr22:32119961:T:G
#> chr22:32119788:T:C         1.00000000         1.00000000         -0.3896071
#> chr22:32119867:T:G         1.00000000         1.00000000         -0.3896071
#> chr22:32119961:T:G        -0.38960714        -0.38960714          1.0000000
#> chr22:32120053:T:C        -0.07607973        -0.07607973         -0.1431621
#> chr22:32120593:A:G        -0.07607973        -0.07607973         -0.1431621
#> chr22:32120636:T:C        -0.16985384        -0.16985384         -0.2327461
#> chr22:32120932:G:A         0.64492502         0.64492502         -0.2595210
#> chr22:32120975:A:G        -0.11897144        -0.11897144         -0.1416922
#> chr22:32121290:C:T         0.67670793         0.67670793         -0.5329025
#> chr22:32121498:A:C         0.67670793         0.67670793         -0.5329025
#> chr22:32121635:T:G        -0.08086272        -0.08086272         -0.1515361
#> chr22:32121702:A:G        -0.18308878        -0.18308878          0.4774493
#> chr22:32121936:G:A        -0.17425323        -0.17425323         -0.2013013
#> chr22:32122351:A:G         0.66471365         0.66471365         -0.5068189
#> chr22:32122676:A:G        -0.08086272        -0.08086272         -0.1515361
#> chr22:32123055:A:G        -0.11897144        -0.11897144         -0.1416922
#> chr22:32123164:T:C         0.41128264         0.41128264         -0.5804376
#> chr22:32123383:T:C         0.53624197         0.53624197         -0.6247040
#> chr22:32123461:T:C        -0.09309050        -0.09309050          0.1465514
#> chr22:32123806:C:T         0.53624197         0.53624197         -0.6247040
#> chr22:32124049:G:A         0.53624197         0.53624197         -0.6247040
#> chr22:32124147:A:C         0.53624197         0.53624197         -0.6247040
#>                    chr22:32120053:T:C chr22:32120593:A:G chr22:32120636:T:C
#> chr22:32119788:T:C        -0.07607973        -0.07607973        -0.16985384
#> chr22:32119867:T:G        -0.07607973        -0.07607973        -0.16985384
#> chr22:32119961:T:G        -0.14316214        -0.14316214        -0.23274610
#> chr22:32120053:T:C         1.00000000         1.00000000        -0.09691283
#> chr22:32120593:A:G         1.00000000         1.00000000        -0.09691283
#> chr22:32120636:T:C        -0.09691283        -0.09691283         1.00000000
#> chr22:32120932:G:A        -0.01898060        -0.01898060        -0.14868888
#> chr22:32120975:A:G        -0.08068061        -0.08068061         0.68622457
#> chr22:32121290:C:T        -0.16508211        -0.16508211        -0.24050169
#> chr22:32121498:A:C        -0.16508211        -0.16508211        -0.24050169
#> chr22:32121635:T:G         0.98361289         0.98361289        -0.09945025
#> chr22:32121702:A:G        -0.07352322        -0.07352322        -0.10944994
#> chr22:32121936:G:A        -0.10007160        -0.10007160        -0.09805724
#> chr22:32122351:A:G        -0.16810632        -0.16810632        -0.24590866
#> chr22:32122676:A:G         0.98361289         0.98361289        -0.09945025
#> chr22:32123055:A:G        -0.08068061        -0.08068061         0.68622457
#> chr22:32123164:T:C        -0.20768833        -0.20768833         0.38571586
#> chr22:32123383:T:C        -0.21940825        -0.21940825         0.35375073
#> chr22:32123461:T:C        -0.03942684        -0.03942684        -0.01498660
#> chr22:32123806:C:T        -0.21940825        -0.21940825         0.35375073
#> chr22:32124049:G:A        -0.21940825        -0.21940825         0.35375073
#> chr22:32124147:A:C        -0.21940825        -0.21940825         0.35375073
#>                    chr22:32120932:G:A chr22:32120975:A:G chr22:32121290:C:T
#> chr22:32119788:T:C         0.64492502        -0.11897144          0.6767079
#> chr22:32119867:T:G         0.64492502        -0.11897144          0.6767079
#> chr22:32119961:T:G        -0.25952101        -0.14169222         -0.5329025
#> chr22:32120053:T:C        -0.01898060        -0.08068061         -0.1650821
#> chr22:32120593:A:G        -0.01898060        -0.08068061         -0.1650821
#> chr22:32120636:T:C        -0.14868888         0.68622457         -0.2405017
#> chr22:32120932:G:A         1.00000000        -0.12097213          0.4578246
#> chr22:32120975:A:G        -0.12097213         1.00000000         -0.1631149
#> chr22:32121290:C:T         0.45782464        -0.16311490          1.0000000
#> chr22:32121498:A:C         0.45782464        -0.16311490          1.0000000
#> chr22:32121635:T:G        -0.02229749        -0.08220297         -0.1579317
#> chr22:32121702:A:G        -0.08442599        -0.07815523         -0.2957522
#> chr22:32121936:G:A        -0.09281440        -0.07338441          0.4227297
#> chr22:32122351:A:G         0.44146752        -0.16680800          0.9841509
#> chr22:32122676:A:G        -0.02229749        -0.08220297         -0.1579317
#> chr22:32123055:A:G        -0.12097213         1.00000000         -0.1631149
#> chr22:32123164:T:C         0.36639669         0.24741886          0.7219857
#> chr22:32123383:T:C         0.33890432         0.23838466          0.8049083
#> chr22:32123461:T:C        -0.05761079        -0.03960804         -0.1118759
#> chr22:32123806:C:T         0.33890432         0.23838466          0.8049083
#> chr22:32124049:G:A         0.33890432         0.23838466          0.8049083
#> chr22:32124147:A:C         0.33890432         0.23838466          0.8049083
#>                    chr22:32121498:A:C chr22:32121635:T:G chr22:32121702:A:G
#> chr22:32119788:T:C          0.6767079        -0.08086272        -0.18308878
#> chr22:32119867:T:G          0.6767079        -0.08086272        -0.18308878
#> chr22:32119961:T:G         -0.5329025        -0.15153607         0.47744929
#> chr22:32120053:T:C         -0.1650821         0.98361289        -0.07352322
#> chr22:32120593:A:G         -0.1650821         0.98361289        -0.07352322
#> chr22:32120636:T:C         -0.2405017        -0.09945025        -0.10944994
#> chr22:32120932:G:A          0.4578246        -0.02229749        -0.08442599
#> chr22:32120975:A:G         -0.1631149        -0.08220297        -0.07815523
#> chr22:32121290:C:T          1.0000000        -0.15793174        -0.29575216
#> chr22:32121498:A:C          1.0000000        -0.15793174        -0.29575216
#> chr22:32121635:T:G         -0.1579317         1.00000000        -0.07735647
#> chr22:32121702:A:G         -0.2957522        -0.07735647         1.00000000
#> chr22:32121936:G:A          0.4227297        -0.08038849        -0.16177962
#> chr22:32122351:A:G          0.9841509        -0.16118508        -0.30258029
#> chr22:32122676:A:G         -0.1579317         1.00000000        -0.07735647
#> chr22:32123055:A:G         -0.1631149        -0.08220297        -0.07815523
#> chr22:32123164:T:C          0.7219857        -0.20174277        -0.33332967
#> chr22:32123383:T:C          0.8049083        -0.21422268        -0.35583510
#> chr22:32123461:T:C         -0.1118759        -0.04017078         0.03234585
#> chr22:32123806:C:T          0.8049083        -0.21422268        -0.35583510
#> chr22:32124049:G:A          0.8049083        -0.21422268        -0.35583510
#> chr22:32124147:A:C          0.8049083        -0.21422268        -0.35583510
#>                    chr22:32121936:G:A chr22:32122351:A:G chr22:32122676:A:G
#> chr22:32119788:T:C        -0.17425323         0.66471365        -0.08086272
#> chr22:32119867:T:G        -0.17425323         0.66471365        -0.08086272
#> chr22:32119961:T:G        -0.20130126        -0.50681889        -0.15153607
#> chr22:32120053:T:C        -0.10007160        -0.16810632         0.98361289
#> chr22:32120593:A:G        -0.10007160        -0.16810632         0.98361289
#> chr22:32120636:T:C        -0.09805724        -0.24590866        -0.09945025
#> chr22:32120932:G:A        -0.09281440         0.44146752        -0.02229749
#> chr22:32120975:A:G        -0.07338441        -0.16680800        -0.08220297
#> chr22:32121290:C:T         0.42272968         0.98415090        -0.15793174
#> chr22:32121498:A:C         0.42272968         0.98415090        -0.15793174
#> chr22:32121635:T:G        -0.08038849        -0.16118508         1.00000000
#> chr22:32121702:A:G        -0.16177962        -0.30258029        -0.07735647
#> chr22:32121936:G:A         1.00000000         0.41488387        -0.08038849
#> chr22:32122351:A:G         0.41488387         1.00000000        -0.16118508
#> chr22:32122676:A:G        -0.08038849        -0.16118508         1.00000000
#> chr22:32123055:A:G        -0.07338441        -0.16680800        -0.08220297
#> chr22:32123164:T:C         0.36747838         0.72764383        -0.20174277
#> chr22:32123383:T:C         0.34368263         0.81708979        -0.21422268
#> chr22:32123461:T:C        -0.02241121        -0.08710318        -0.04017078
#> chr22:32123806:C:T         0.34368263         0.81708979        -0.21422268
#> chr22:32124049:G:A         0.34368263         0.81708979        -0.21422268
#> chr22:32124147:A:C         0.34368263         0.81708979        -0.21422268
#>                    chr22:32123055:A:G chr22:32123164:T:C chr22:32123383:T:C
#> chr22:32119788:T:C        -0.11897144         0.41128264         0.53624197
#> chr22:32119867:T:G        -0.11897144         0.41128264         0.53624197
#> chr22:32119961:T:G        -0.14169222        -0.58043759        -0.62470401
#> chr22:32120053:T:C        -0.08068061        -0.20768833        -0.21940825
#> chr22:32120593:A:G        -0.08068061        -0.20768833        -0.21940825
#> chr22:32120636:T:C         0.68622457         0.38571586         0.35375073
#> chr22:32120932:G:A        -0.12097213         0.36639669         0.33890432
#> chr22:32120975:A:G         1.00000000         0.24741886         0.23838466
#> chr22:32121290:C:T        -0.16311490         0.72198572         0.80490828
#> chr22:32121498:A:C        -0.16311490         0.72198572         0.80490828
#> chr22:32121635:T:G        -0.08220297        -0.20174277        -0.21422268
#> chr22:32121702:A:G        -0.07815523        -0.33332967        -0.35583510
#> chr22:32121936:G:A        -0.07338441         0.36747838         0.34368263
#> chr22:32122351:A:G        -0.16680800         0.72764383         0.81708979
#> chr22:32122676:A:G        -0.08220297        -0.20174277        -0.21422268
#> chr22:32123055:A:G         1.00000000         0.24741886         0.23838466
#> chr22:32123164:T:C         0.24741886         1.00000000         0.93235705
#> chr22:32123383:T:C         0.23838466         0.93235705         1.00000000
#> chr22:32123461:T:C        -0.03960804        -0.08059521        -0.09259379
#> chr22:32123806:C:T         0.23838466         0.93235705         1.00000000
#> chr22:32124049:G:A         0.23838466         0.93235705         1.00000000
#> chr22:32124147:A:C         0.23838466         0.93235705         1.00000000
#>                    chr22:32123461:T:C chr22:32123806:C:T chr22:32124049:G:A
#> chr22:32119788:T:C        -0.09309050         0.53624197         0.53624197
#> chr22:32119867:T:G        -0.09309050         0.53624197         0.53624197
#> chr22:32119961:T:G         0.14655136        -0.62470401        -0.62470401
#> chr22:32120053:T:C        -0.03942684        -0.21940825        -0.21940825
#> chr22:32120593:A:G        -0.03942684        -0.21940825        -0.21940825
#> chr22:32120636:T:C        -0.01498660         0.35375073         0.35375073
#> chr22:32120932:G:A        -0.05761079         0.33890432         0.33890432
#> chr22:32120975:A:G        -0.03960804         0.23838466         0.23838466
#> chr22:32121290:C:T        -0.11187585         0.80490828         0.80490828
#> chr22:32121498:A:C        -0.11187585         0.80490828         0.80490828
#> chr22:32121635:T:G        -0.04017078        -0.21422268        -0.21422268
#> chr22:32121702:A:G         0.03234585        -0.35583510        -0.35583510
#> chr22:32121936:G:A        -0.02241121         0.34368263         0.34368263
#> chr22:32122351:A:G        -0.08710318         0.81708979         0.81708979
#> chr22:32122676:A:G        -0.04017078        -0.21422268        -0.21422268
#> chr22:32123055:A:G        -0.03960804         0.23838466         0.23838466
#> chr22:32123164:T:C        -0.08059521         0.93235705         0.93235705
#> chr22:32123383:T:C        -0.09259379         1.00000000         1.00000000
#> chr22:32123461:T:C         1.00000000        -0.09259379        -0.09259379
#> chr22:32123806:C:T        -0.09259379         1.00000000         1.00000000
#> chr22:32124049:G:A        -0.09259379         1.00000000         1.00000000
#> chr22:32124147:A:C        -0.09259379         1.00000000         1.00000000
#>                    chr22:32124147:A:C
#> chr22:32119788:T:C         0.53624197
#> chr22:32119867:T:G         0.53624197
#> chr22:32119961:T:G        -0.62470401
#> chr22:32120053:T:C        -0.21940825
#> chr22:32120593:A:G        -0.21940825
#> chr22:32120636:T:C         0.35375073
#> chr22:32120932:G:A         0.33890432
#> chr22:32120975:A:G         0.23838466
#> chr22:32121290:C:T         0.80490828
#> chr22:32121498:A:C         0.80490828
#> chr22:32121635:T:G        -0.21422268
#> chr22:32121702:A:G        -0.35583510
#> chr22:32121936:G:A         0.34368263
#> chr22:32122351:A:G         0.81708979
#> chr22:32122676:A:G        -0.21422268
#> chr22:32123055:A:G         0.23838466
#> chr22:32123164:T:C         0.93235705
#> chr22:32123383:T:C         1.00000000
#> chr22:32123461:T:C        -0.09259379
#> chr22:32123806:C:T         1.00000000
#> chr22:32124049:G:A         1.00000000
#> chr22:32124147:A:C         1.00000000
#>