Skip to contents

Detect outliers in GWAS summary statistics using LD-based iterative imputation. Provide either an LD correlation matrix R or a genotype matrix X (from which LD and sample size are derived automatically).

Usage

dentistSingleWindow(
  zScore,
  R = NULL,
  X = NULL,
  nSample = NULL,
  pValueThreshold = 5e-08,
  propSVD = 0.4,
  gcControl = FALSE,
  nIter = 10,
  gPvalueThreshold = 0.05,
  duprThreshold = 0.99,
  ncpus = 1,
  correctChenEtAlBug = TRUE,
  ldMethod = "sample",
  seed = NULL
)

Arguments

zScore

Numeric vector of z-scores.

R

Square LD correlation matrix. Provide either R or X.

X

Genotype matrix (samples x SNPs). If provided, LD is computed via computeLd(X) and nSample defaults to nrow(X).

nSample

Number of samples in the LD reference panel (NOT the GWAS sample size). Controls the SVD truncation rank. Required when R is provided; inferred from X when X is provided.

pValueThreshold

P-value threshold for outlier detection. Default is 5e-8.

propSVD

SVD truncation proportion. Default is 0.4.

gcControl

Logical; apply genomic control. Default is FALSE.

nIter

Number of iterations. Default is 10.

gPvalueThreshold

Grouping p-value threshold. Default is 0.05.

duprThreshold

Duplicate r-squared threshold. Default is 0.99.

ncpus

Number of CPU cores. Default is 1.

correctChenEtAlBug

Correct the original DENTIST operator! bug. Default is TRUE.

ldMethod

Character string specifying the LD computation method when X is provided. Passed to computeLd. One of "sample" (default), "population", or "gcta". Ignored when R is provided directly.

seed

Integer or NULL. Random seed for the iterative variant-partitioning RNG. NULL (default) preserves the original DENTIST hard-coded seeds (10 for the initial partition, 20000 + t * 20000 per iteration); a provided seed overrides them.

Value

Data frame with columns: original_z, imputed_z, iter_to_correct, rsq, is_duplicate, outlier_stat, outlier.

See also

Examples

data(eqtlRegionExample)
R <- cor(eqtlRegionExample$X[, 1:20])
dentistSingleWindow(zScore = rnorm(20), R = R, nSample = 415)
#> Warning: The number of variants (20) is below 2000. The algorithm may not work as expected, as suggested by the original DENTIST. Consider using windowMode = 'count' with an appropriate minDim to control window sizes by variant count.
#> 6 duplicated variants out of a total of 20 were found at r threshold of 0.995
#> # A tibble: 20 × 7
#>    original_z imputed_z iter_to_correct    rsq is_duplicate outlier_stat outlier
#>         <dbl>     <dbl>           <dbl>  <dbl> <lgl>               <dbl> <lgl>  
#>  1      0.143   -0.231               10 0.314  FALSE             0.205   FALSE  
#>  2     -0.312   -0.231               10 0.314  TRUE              0.00940 FALSE  
#>  3      0.521    0.551               10 0.512  FALSE             0.00179 FALSE  
#>  4     -0.357   -0.634               10 0.702  FALSE             0.258   FALSE  
#>  5      0.104   -0.634               10 0.702  TRUE              1.83    FALSE  
#>  6     -1.45    -0.0311              10 0.0414 FALSE             2.09    FALSE  
#>  7      0.599   -0.162               10 0.152  FALSE             0.683   FALSE  
#>  8     -0.447   -0.0236              10 0.0184 FALSE             0.183   FALSE  
#>  9     -0.918    0.0124              10 0.898  FALSE             8.48    FALSE  
#> 10     -0.660    0.0124              10 0.898  TRUE              4.43    FALSE  
#> 11     -0.101    0.151               10 0.0735 FALSE             0.0683  FALSE  
#> 12      1.08     0.246               10 0.168  FALSE             0.843   FALSE  
#> 13      0.228   -0.144               10 0.158  FALSE             0.165   FALSE  
#> 14     -0.562   -0.321               10 0.769  FALSE             0.251   FALSE  
#> 15      0.707    0.151               10 0.0735 TRUE              0.334   FALSE  
#> 16      0.299   -0.0236              10 0.0184 TRUE              0.106   FALSE  
#> 17      0.235   -0.543               10 0.745  FALSE             2.37    FALSE  
#> 18      0.109   -0.536               10 0.840  FALSE             2.60    FALSE  
#> 19      0.873    0.0677              10 0.0172 FALSE             0.660   FALSE  
#> 20      0.702   -0.536               10 0.840  TRUE              9.56    FALSE