fitAll {GPA} | R Documentation

## Fit GPA model for all possible pairs of GWAS datasets

### Description

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

### Usage

    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

    # 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 )

[Package GPA version 1.6.0 Index]