This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qqR2 <- function(corvec,nn,pad_neg_with_0 = FALSE,...) | |
{ | |
## nn is the sample size, number of individuals used to compute correlation. | |
## needs correlation vector as input. | |
## nullcorvec generates a random sample from correlation distributions, under the null hypothesis of 0 correlation using Fisher's approximation. | |
if(pad_neg_with_0) corvec[corvec < 0 | is.na(corvec) ]=0 | |
mm <- length(corvec) | |
nullcorvec = tanh(rnorm(mm)/sqrt(nn-3)) ## null correlation vector | |
qqplot(nullcorvec^2,corvec^2,...); abline(0,1); grid() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## May 7, 2012 | |
## Hae Kyung Im | |
## haky@uchicago.edu | |
## | |
## Please cite: | |
## Eric R Gamazon, R. Stephanie Huang, Eileen Dolan, Nancy Cox, and Hae Kyung Im, (2012) | |
## Integrative Genomics: Quantifying significance of phenotype-genotype | |
## relationships from multiple sources of high-throughput data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## pvalue vs uniform | |
qqunif = | |
function(p,BH=T,CI=T,mlog10_p_thres=30,...) | |
{ | |
## thresholded by default at 1e-30 | |
p=na.omit(p) | |
nn = length(p) | |
xx = -log10((1:nn)/(nn+1)) | |
NewerOlder