“GWAS.PC” (GWAS Power Calculation) is an R package that does power analysis in genome wide association studies. In particular, genotyping error is considered in power calculation. Power.single() and Power.multi() calculates power for single marker and multiple marker association test respectively. Power.single() and Power.multi() calculates minimum sample size needed to achieve a pre-specified power. You can use help() to learn more about these functions after installing and loading the package.
Here is an example code of using the R package “GWAS.PC”.
library(GWAS.PC)
emat.case<-matrix(c(1,0,0,0,1,0,0,0.001,0.999),nrow=3,byrow=T)
emat.case
## [,1] [,2] [,3]
## [1,] 1 0.000 0.000
## [2,] 0 1.000 0.000
## [3,] 0 0.001 0.999
emat.ctrl<-matrix(c(1,0,0,0,1,0,0.0005,0.0005,0.999),nrow=3,byrow=T)
emat.ctrl
## [,1] [,2] [,3]
## [1,] 1e+00 0e+00 0.000
## [2,] 0e+00 1e+00 0.000
## [3,] 5e-04 5e-04 0.999
### Power calculation for single marker when assuming non-differential genotyping error and multiplicative mode of inheritance
Power.single(alpha=0.05,r=1.2,pA=0.1,ncase=5000,nctrl=5000,pD=0.1,
emat1=emat.case,type="ndiff",moi="m")
## [1] 0.9934713
### Power calculation for single marker when assuming differential genotyping error and dominant mode of inheritance
Power.single(alpha=0.05,r=1.2,pA=0.1,ncase=5000,nctrl=5000,pD=0.1,
emat1=emat.case,emat2=emat.case,type="diff",moi="d")
## [1] 0.9835105
### Minimum size calculation for single marker when assuming non-differential genotyping error and multiplicative mode of inheritance
Size.single(alpha=0.05, p=0.8, r=1.2, pA=0.1,pD=0.1,
emat1=emat.case,type="ndiff",moi="m",range=c(1,10000))
## [1] 1921
### Minimum size calculation for single marker when assuming differential genotyping error and dominant mode of inheritance
Size.single(alpha=0.05, p=0.8, r=1.2,pA=0.1,pD=0.1,
emat1=emat.case,emat2=emat.case,type="diff",moi="d",range=c(1,10000))
## [1] 2321
### Power calculation for multiple marker when assuming non-differential genotyping error
Power.multi(alpha=0.05,r=2,pA=0.01,ncase=5000,pD=0.1,M=20,
m10.case=0.001,m00.case=0.995,type="ndiff")
## [1] 0.196638
### Power calculation for multiple marker when assuming differential genotyping error
Power.multi(alpha=0.05,r=2,pA=0.01,ncase=5000,pD=0.1,M=20,
m10.case=0.001,m00.case=0.995,m10.ctrl=0.002,m00.ctrl=0.996,type="diff")
## [1] 0.2936117
### Minimum size calculation for multiple marker when assuming non-differential genotyping error
Size.multi(alpha=0.05,p=0.8,r=3,pA=0.01,pD=0.1,M=20,
m10.case=0.001,m00.case=0.995,type="ndiff",range=c(1,20000))
## [1] 8321
### Minimum size calculation for multiple marker when assuming differential genotyping error
Size.multi(alpha=0.05,p=0.8,r=3,pA=0.01,pD=0.1,M=20,
m10.case=0.001,m00.case=0.995,m10.ctrl=0.002,m00.ctrl=0.996,type="diff",range=c(1,20000))
## [1] 6561