Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute genomic control factor #3

Open
xiangzhu opened this issue Apr 25, 2018 · 0 comments
Open

Compute genomic control factor #3

xiangzhu opened this issue Apr 25, 2018 · 0 comments

Comments

@xiangzhu
Copy link
Collaborator

xiangzhu commented Apr 25, 2018

I wonder if we could let the program compute and display the genomic control factor for the input summary dataset.

Genomic control factor paper: https://www.ncbi.nlm.nih.gov/pubmed/11315092

The following code may be useful.

# SOURCE: http://genometoolbox.blogspot.com/2014/08/how-to-calculate-genomic-inflation.html
# compute genomic control factor
calc_gc <- function(pval) {
  if (all(is.na(pval))) {
    lambda_gc <- NA
    return(lambda_gc)
  } else {
    pval <- pval[!is.na(pval)]
    chisq <- qchisq(1-pval, 1)
    lambda_gc <- median(chisq)/qchisq(0.5,1)
    return(lambda_gc)
  }
}

Displaying this factor can help us understand why sometimes the estimated PVE is large when the true PVE is close to zero (maybe the input summary data were not corrected for population stratification?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant