grspwr: GRS power calculation

Description Usage Arguments Examples

View source: R/grspwr.R

Description

Calculates the power to detect of a GRS to detect a signal at given significance level using a GRS weights in a certain sample size and with given imputatation quality. Note: It assumes that the weights used are accurate estimates of SNP effects.

Usage

1
grspwr(snps, n, alpha = 0.05, max.iter = 1000, popsize = max(n)^2)

Arguments

n

The number of individuals to include in the GRS

max.iter

The number of iterations to use for the power calculation. This affects the precision of the calculated power. Should be at least 100.

popsize

The size of the population sample from which is sampled. Should be larger than N. Affects accuracy of power estimate.

snps:

A dataframe with the following columns:

  • SNP: Unique name of SNP

  • WEIGHT: a weight associated with the _minor_ allele of SNP. Weights should be normalized relative to a standard normal distribution (mean 0, variance 1).

  • EAF: Effect allele frequency

  • Estimated R-squared correlation of imputation with actual genotype.For imputed genotypes this will be [0-1] and for directly genotyped SNPs it should be 1.

Examples

1
2
3
4
5
exampleGRS <- data.frame(SNP = c("rs1", "rs2", "rs3"),
                              WEIGHT = c(0.01, 0.01, 0.2),
                              EAF = c(0.42, 0.42, 0.42),
                              INFO= c(0.9, 0.9, 0.2))
grspwr(exampleGRS,n=400, alpha = 0.05)

cth/grspwr documentation built on May 30, 2019, 6:25 a.m.