Skip to contents

Unified wrapper for detecting outlier variants due to LD-summary statistic mismatches. Dispatches to either dentistSingleWindow or slalom based on the method argument.

Usage

ldMismatchQc(
  zScore,
  R = NULL,
  X = NULL,
  nSample = NULL,
  method = c("slalom", "dentist"),
  ldMethod = "sample",
  ...
)

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 and nSample defaults to nrow(X).

nSample

Number of samples in the LD reference panel. Required when R is provided and method = "dentist"; inferred from X when X is provided.

method

Character string specifying the QC method: "slalom" (default) or "dentist".

ldMethod

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

...

Additional arguments passed to the underlying QC method (dentistSingleWindow or slalom).

Value

A data frame with at least a logical outlier column indicating which variants are identified as outliers. The remaining columns depend on the method used.

Examples

data(eqtlRegionExample)
R <- cor(eqtlRegionExample$X[, 1:20])
ldMismatchQc(zScore = rnorm(20), R = R, nSample = 415)
#> # A tibble: 20 × 5
#>    original_z   prob pvalue outlier nlog10p_dentist_s
#>         <dbl>  <dbl>  <dbl> <lgl>               <dbl>
#>  1     1.30   0.0507 0.903  FALSE              0.534 
#>  2    -0.435  0.0492 0.332  FALSE              0.321 
#>  3    -0.809  0.0497 0.209  FALSE              0.0498
#>  4    -0.522  0.0493 0.301  FALSE              0.277 
#>  5    -0.288  0.0491 0.387  FALSE              0.159 
#>  6    -0.643  0.0495 0.260  FALSE              0.377 
#>  7     0.343  0.0492 0.634  FALSE              0.0838
#>  8     1.45   0.0511 0.926  FALSE              0.744 
#>  9     1.35   0.0508 0.912  FALSE              0.479 
#> 10     0.475  0.0493 0.683  FALSE              0.0177
#> 11    -0.249  0.0491 0.402  FALSE              0.144 
#> 12    -1.44   0.0511 0.0744 NA               NaN     
#> 13    -0.984  0.0500 0.163  FALSE              0.663 
#> 14    -1.19   0.0504 0.116  FALSE              1.06  
#> 15    -0.0605 0.0491 0.476  FALSE              0.0640
#> 16     1.95   0.0528 0.974  FALSE              1.18  
#> 17    -1.40   0.0509 0.0808 FALSE              1.34  
#> 18    -1.18   0.0504 0.119  FALSE              1.16  
#> 19    -0.243  0.0491 0.404  FALSE              0.0734
#> 20    -0.372  0.0492 0.355  FALSE              0.465