Giter VIP home page Giter VIP logo

powereqtl's Introduction

powerEQTL

R package for power analysis for eQTL study

== TOADD ==

  • Below is example code using the package to generate the similar power analysis curve as GTEx study1
# library(devtools);install_github("sterding/powerEQTL")  
library('powerEQTL')

# sample size
N <- c(50,100,150,200,250,300)
nn <- length(N)

# MAF
MAF <- seq(0.5,20,0.1)/100
nq <- length(MAF)

# number of SNPs tested (10 SNPs per gene x 24 genes in total)
nSNP=240

# significant level (FP)
a=0.05

# obtain power
power_unbalanced <- array(numeric(nn*nq), dim=c(nn,nq))
for (i in 1:nn){
    for (j in 1:nq){
        # unbalanced
        result <- powerEQTL.ANOVA(MAF=MAF[j], 
                                  typeI=a, 
                                  nTests=nSNP, 
                                  myntotal=N[i], 
                                  mystddev=0.13,
                                  deltaVec = c(0.13, 0.13),
                                  verbose = F)
        power_unbalanced[i,j] <-result;
    }
}

# set up graph
xrange <- range(MAF*100)
yrange <- c(0:1)
colors <- rainbow(length(N))
plot(xrange, yrange, log='x', type="n",
     xlab="MAF (%)",
     ylab="Power",
     main="Power Estimation for eQTL Studies\nSig=0.05, nSNP=240 (one-way unbalanced ANOVA)")

abline(v=0, h=seq(0,1,.1), lty=2, col="grey89")
abline(h=0, v=c(1:10), lty=2,col="grey89")

# add power curves
for (i in 1:nn){
    lines(MAF*100, power_unbalanced[i,], type="l", lwd=4, col=colors[i])
}

legend("topleft", title="Sample size (n)", as.character(N),fill=colors, bty='n')

Footnotes

  1. Lonsdale J and Thomas J, et al. The Genotype-Tissue Expression (GTEx) project. Nature Genetics, 45:580-585, 2013. โ†ฉ

powereqtl's People

Contributors

sterding avatar weiliangqiu avatar

Stargazers

Jichen Wen avatar  avatar Thyago L Calvo avatar  avatar Arun Durvasula avatar Sander W. van der Laan avatar

Watchers

 avatar James Cloos avatar Sander W. van der Laan avatar  avatar

powereqtl's Issues

Unable to install from cran

Hello powerEQTL developers,

It appears that there are some dependencies for your package that cran no longer support so it has been removed from their website and cannot currently be installed with cran.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.