corrcov {corrcoverage} | R Documentation |
Corrected coverage estimate using Z-scores and MAFs
Description
Corrected coverage estimate using Z-scores and mafs
Usage
corrcov(z, f, N0, N1, Sigma, thr, W = 0.2, nrep = 1000, pp0min = 0.001)
Arguments
z |
Marginal Z-scores |
f |
Minor allele frequencies |
N0 |
Number of controls |
N1 |
Number of cases |
Sigma |
SNP correlation matrix |
thr |
Minimum threshold for fine-mapping experiment |
W |
Prior for the standard deviation of the effect size parameter, beta (default 0.2) |
nrep |
The number of simulated posterior probability systems to consider for the corrected coverage estimate (default 1000) |
pp0min |
Only average over SNPs with pp0 > pp0min |
Details
This function only requires the marginal summary statistics from GWAS
Value
Corrected coverage estimate
Author(s)
Anna Hutchinson
Examples
set.seed(1)
nsnps = 100
N0 = 5000
N1 = 5000
z_scores <- rnorm(nsnps, 0, 3) # simulate a vector of Z-scores
## generate example LD matrix
library(mvtnorm)
nsamples = 1000
simx <- function(nsnps, nsamples, S, maf=0.1) {
mu <- rep(0,nsnps)
rawvars <- rmvnorm(n=nsamples, mean=mu, sigma=S)
pvars <- pnorm(rawvars)
x <- qbinom(1-pvars, 1, maf)
}
S <- (1 - (abs(outer(1:nsnps,1:nsnps,`-`))/nsnps))^4
X <- simx(nsnps,nsamples,S)
LD <- cor2(X)
maf <- colMeans(X)
corrcov(z = z_scores, f = maf, N0, N1, Sigma = LD, thr = 0.95)
[Package corrcoverage version 1.2.1 Index]