fitAll: Fit GPA model for all possible pairs of GWAS datasets

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/fitAll.R

Description

Fit GPA model and the GPA model under H0 for all possible pairs of GWAS datasets.

Usage

1
2
3
fitAll( pmat, 
  maxIter=2000, stopping="relative", epsStopLL=1e-10, 
  parallel=FALSE, nCore=8 )

Arguments

pmat

p-value matrix from GWAS data, where row and column correspond to SNP and phenotype, respectively.

maxIter

Maximum number of EM iteration. Default is 2000.

stopping

Stopping rule for EM iteration. Possible values are "absolute" (based on absolute difference in log likelihood), "relative" (based on relative difference in log likelihood), or "aitken" (based on Aitken acceleration-based stopping rule). Default is "relative".

epsStopLL

Threshold to stop the EM iteration. Default is 1e-100.

parallel

Utilize multiple CPUs for parallel computing using "parallel" package? Possible values are TRUE (utilize multiple CPUs) or FALSE (do not utilize multiple CPUs). Default is FALSE (do not utilize multiple CPUs).

nCore

Number of CPUs when parallel computing is utilized.

Details

fitAll function fits the GPA model and the GPA model under H0 for all possible pairs of GWAS datasets. Its output can be used as an input for the shinyGPA function.

Value

A list with 6 elements, including pmat (original GWAS p-value matrix), combs (a matrix of GWAS pair indices), combList (a matrix of GWAS pair indices), pTestPval (a matrix of pleiotropy test p-values), fitGPA (a list of the GPA fit for each pair), and fitH0 (a list of the GPA fit under H0 for each pair).

Author(s)

Dongjun Chung, Emma Kortemeier

References

Kortemeier E, Ramos PS, Hunt KJ, Kim HJ, Hardiman G, and Chung D (2017), "ShinyGPA: An interactive and dynamic visualization toolkit for genetic studies."

See Also

GPA, pTest, and shinyGPA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# simulator function

simulator <- function( risk.ind, nsnp=20000, alpha=0.6 ) {
  
  m <- length(risk.ind)
  
  p.sig <- rbeta( m, alpha, 1 )
  pvec <- runif(nsnp)
  pvec[ risk.ind ] <- p.sig
  
  return(pvec)
}

# run simulation

set.seed(12345)
nsnp <- 1000
alpha <- 0.4
pmat <- matrix( NA, nsnp, 5 )

pmat[,1] <- simulator( c(1:200), nsnp=nsnp, alpha=alpha )
pmat[,2] <- simulator( c(51:250), nsnp=nsnp, alpha=alpha )
pmat[,3] <- simulator( c(401:600), nsnp=nsnp, alpha=alpha )
pmat[,4] <- simulator( c(451:750), nsnp=nsnp, alpha=alpha )
pmat[,5] <- simulator( c(801:1000), nsnp=nsnp, alpha=alpha )

# Fit GPA for all possible pairs of GWAS datasets

out <- fitAll( pmat, maxIter = 100 )

carter-allen/GPA documentation built on April 21, 2020, 11:18 a.m.