prsMultitest: Average Over Multiple PRS Simulations

Description Usage Arguments Details Value Author(s) Examples

Description

Perform a number of PRS simulations with gwasFast and prsInf and average over the results. Supports parallelization on multicore CPUs.

Usage

1
prsMultitest(signal, N, Nsim, nthreads = 0, minpv = 1e-20)

Arguments

signal

Vector of effect sizes for all SNPs.
Can be generated with genSignal.

N

GWAS sample size.

Nsim

Number of simulations to perform.

nthreads

Number of parallel threads to use.
Zero (default) set it to the number of CPU cores.
Setting nthreads = 1 disables multithreading.

minpv

The simulated PRS performance is recorded on the interval from minpv to 1.

Details

The function uses parallel package for multithreaded calculations.

Value

The function returns the vector of p-value thresholds and corresponding average asymptotic correlations of the phenotype with PRS (r).

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
NTotalSNPs = 10000
NSignalSnps = 100
heritability = 0.2
signalDistr = "Same"
Ntrain = 10000
Ntest = 3000

signal = genSignal(
            NSignalSnps = NSignalSnps,
            NTotalSNPs = NTotalSNPs,
            heritability = heritability,
            signalDistr = signalDistr)
            
prsA = prsMultitest(signal = signal, N = Ntrain, Nsim = 30, nthreads = 1)

rci = rConfInt(r = prsA$r, N = Ntest)

prsPlot(pv = prsA$pv, r = prsA$r, rci)

andreyshabalin/simPRS documentation built on May 21, 2019, 2 p.m.