GithubHelp home page GithubHelp logo

ffdr's Introduction

fFDR: Functional False Discovery Rate

R build status

This fFDR package implements the functional false discovery rate (FDR) methodology and estimates FDR from a collection of p-values and observations from an informative variable. The informative variable may affect the likelihood of a true null hypothesis or the power of a statistical test, and the methodology models the likelihood or power as a function of the informative variable. When the informative variable does not affect the likelihood or power, it reduces to the traditional q-value based FDR methodology. The functional FDR methodology induces and employs the functional q-value. At a pre-specified threshold for the functional q-value (which is in general equivalent to a nominal FDR level), a null hypothesis is rejected if its associated functional q-value is less than or equal to the threshold.

An overview of the functional FDR methodology can be found in the preprint ``The Functional False Discovery Rate with Applications to Genomics'' authored by Xiongzhi Chen, David G. Robinson and John D. Storey and available at bioRxiv. We recommend reading the package vignette for users of the fFDR package who want a quick start.

Installation and documentation

To install, open R and type:

install.packages("devtools")
library("devtools")
devtools::install_github("StoreyLab/fFDR")

The vignette can be viewed by typing:

browseVignettes(package = "fFDR")

Package overview

Functions

  • fqvalue: Estimate functional q-value based on p-value and an informative variable.
  • estimate_fpi0: Estimate the functional proportion; a tuning parameter lambda will be used for this purpose.
  • plot: Plot the estimated functional proportion and/or construct a scatter plot of p-values and quantiles of the informative variable

Quick start guide

First, the built-in function simulate_t_tests generates m=2000 hypotheses, their associated p-values (as p.value) that are induced by t-tests, and (as z) quantile transformed sample sizes of the Normal observations. Note that the power of a t-test is affected by the sample size, which in this setting is an informative variable.

library(fFDR)
ttests_example <- simulate_t_tests(m = 2000)
p.value <- ttests_example$p.value
z <- ttests_example$n

Once p-values and observations from an informative are available, fqvalue implements the functional FDR methodology, and creates a fqvalue object fq.

fq <- fqvalue(p.value, z)

The functional q-value associated with each hypothesis testing can be extract by:

fqvalues <- fq$table$fq.value

With the individual functional q-values, at FDR level 0.05, null hypotheses that are rejected and the number of rejections can be found by:

fqvalues <- fq$table$fq.value
which(fqvalues < .05)
sum(fqvalues < .05)

The fqvalue object fq can be visualized via 2 panels in a vertical layout: the top panel is a scatter plot of p-values against quantiles of the informative variable; the bottom shows the estimated functional proportion for different values of the tuning parameter lambda, for which the solid curve is the estimated corresponding to the optimal choice of lambda.

p <- plot(fq)
grid::grid.draw(p)

For additional details, please see the package vignette.

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.