#' @title To conduct PCFisher test
#' @param Z_score GWAS summary statistics
#' @param Sigma the correlation matrix
#' @return PC.Fisher.p
#' @importFrom stats pchisq
#' @export
#'
#'
PCFisher <- function(Z_score,Sigma){
eigen.res = eigen(Sigma)
lambdas = eigen.res$values
eigen.vec = eigen.res$vectors
z.tmp = as.matrix(Z_score)
K = length(z.tmp)
PC.vec = t(eigen.vec)%*%z.tmp
PC.std = (PC.vec)^2/lambdas
PC.p = pchisq(PC.std,df=1,lower.tail=FALSE)
PC.Fisher.stat = -2*sum(log(PC.p))
PC.Fisher.p = pchisq(PC.Fisher.stat,df=2*K,lower.tail = FALSE)
return(PC.Fisher.p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.