DENTIST (Detecting Errors iN analyses of summary staTISTics) is a quality control tool for GWAS summary data. It uses linkage disequilibrium (LD) information from a reference panel to identify and correct problematic variants by comparing observed GWAS statistics to predicted values. It can detect errors in genotyping/imputation, allelic errors, and heterogeneity between GWAS and LD reference samples.
Usage
dentist(
sumStat,
R = NULL,
X = NULL,
nSample = NULL,
windowSize = 2e+06,
windowMode = c("distance", "count"),
pValueThreshold = 5.0369e-08,
propSVD = 0.4,
gcControl = FALSE,
nIter = 10,
gPvalueThreshold = 0.05,
duprThreshold = 0.99,
ncpus = 1,
correctChenEtAlBug = TRUE,
minDim = 2000,
ldMethod = "sample"
)Arguments
- sumStat
A data frame containing summary statistics, including 'pos' or 'position' and 'z' or 'zscore' columns.
- R
Square LD correlation matrix. Provide either
RorX.- X
Genotype matrix (samples x SNPs). If provided, LD is computed via
computeLd(X)andnSampledefaults tonrow(X).- nSample
The number of samples in the LD reference panel (NOT the GWAS sample size). This controls the SVD truncation rank K = min(idx_size, nSample) * propSVD. Required when
Ris provided; inferred fromXwhenXis provided.- windowSize
The size of the window for dividing the genomic region in distance mode (base pairs). Default is 2000000 (2 Mb). Only used when
windowMode = "distance".- windowMode
Character string specifying the windowing strategy:
"distance"(default) creates windows by physical distance usingsegmentByDist(C++--wind-dist), and"count"creates windows by variant count usingsegmentByCount(C++--wind).- pValueThreshold
The p-value threshold for significance. Default is 5e-8.
- propSVD
The proportion of singular value decomposition (SVD) to use. Default is 0.4.
- gcControl
Logical indicating whether genomic control should be applied. Default is FALSE.
- nIter
The number of iterations for the Dentist algorithm. Default is 10.
- gPvalueThreshold
The genomic p-value threshold for significance. Default is 0.05.
- duprThreshold
The absolute correlation r value threshold to be considered duplicate. Default is 0.99.
- ncpus
The number of CPU cores to use for parallel processing. Default is 1.
- correctChenEtAlBug
Logical indicating whether to correct the Chen et al. bug. Default is TRUE.
- minDim
In distance mode: minimum number of SNPs per block (default 2000). In count mode: the number of variants per window (i.e., the window size).
- ldMethod
Character string specifying the LD computation method when
Xis provided. Passed tocomputeLd. One of"sample"(default),"population", or"gcta". Ignored whenRis provided directly.
Value
A data frame containing the imputed result and detected outliers.
The returned data frame includes the following columns:
original_zThe original z-score values from the input
sumStat.imputed_zThe imputed z-score values computed by the Dentist algorithm.
rsqThe coefficient of determination (R-squared) between original and imputed z-scores.
iter_to_correctThe number of iterations required to correct the z-scores, if applicable.
index_within_windowThe index of the observation within the window.
index_globalThe global index of the observation.
outlier_statThe computed statistical value based on the original and imputed z-scores and R-squared.
outlierA logical indicator specifying whether the observation is identified as an outlier based on the statistical test.
Details
Windowing supports two modes matching the original DENTIST C++ binary:
"distance"(default): Uses thesegmentingByDistalgorithm (C++--wind-dist), implemented insegmentByDist. Windows span a fixed physical distance (windowSizebp)."count": Uses thesegmentedQCedalgorithm (C++--wind), implemented insegmentByCount. Windows contain a fixed number of variants (minDim). Useful when regions have sparse variants where distance-based windows would create windows with too few variants.
The correctChenEtAlBug parameter affects the iterative filtering
in two ways:
Comparison between iteration index
tandnIter(explained in source code)The
!grouping_tmpoperator bug (explained in source code)