Giter Club home page Giter Club logo

fdrci's Introduction

Travis build status

Build status

fdrci

FDR functions for permutation-based estimators, including pi0 as well as FDR confidence intervals. The confidence intervals account for dependencies between tests by the incorporation of an overdispersion parameter, which is estimated from the permuted data. --- From the package description

Installation

You can install fdrci from GitHub with:

# install.packages("devtools")
devtools::install_github("USCbiostats/fdrci")

Example

This is a basic example which shows you how to solve a common problem:

library(fdrci)

ss = 100
nvar = 100
X = as.data.frame(matrix(rnorm(ss*nvar),nrow=ss,ncol=nvar))
Y = as.data.frame(matrix(rnorm(ss*nvar),nrow=ss,ncol=nvar))
nperm = 10

myanalysis = function(X,Y){
    ntests = ncol(X)
    rslts = as.data.frame(matrix(NA,nrow=ntests,ncol=2))
    names(rslts) = c("ID","pvalue")
    rslts[,"ID"] = 1:ntests
    for(i in 1:ntests){
        fit = cor.test(X[,i],Y[,i],na.action="na.exclude",
            alternative="two.sided",method="pearson")
        rslts[i,"pvalue"] = fit$p.value
    }
    return(rslts)
} # End myanalysis

# Generate observed results
obs = myanalysis(X,Y)

# Generate permuted results
perml = vector('list',nperm)
for(p_ in 1:nperm){
    X1 = X[order(runif(nvar)),]
    perml[[p_]] = myanalysis(X1,Y)
}

# FDR results table
myfdrtbl = fdrTbl(obs$pvalue,perml,"pvalue",nvar,0,3)
# Plot results
FDRplot(myfdrtbl,0,3,annot="A. An Example")
#> Warning: Removed 13 rows containing missing values (geom_path).
#> Warning: Removed 13 rows containing missing values (geom_point).
#> Warning: Removed 13 rows containing missing values (geom_text).

fdrci's People

Contributors

emilhvitfeldt avatar gvegayon avatar millstei avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fdrci's Issues

New Core C/D Assessment Project Template

R packages development

This document provides a general framework for assessing the software and computing needs of a particular project.

The first step consists on answering the following questions:

  • In a paragraph, describe what is the project about.
  • List the project's specific goals (e.g. make the method available for public use, create a webservice, present this analysis)
  • Think about what are your computing/software needs, and list them.

Once a general overview of the project has been defined, the next step consists on analyzing the following:

Fundamental questions/tasks

  • Check for other R packages/software that does what the project tries to do.
  • Describe the ultimate goal of your R package (e.g. solve an optim problem, implement a visualization problem, estimate parameters, etc.)
  • Think about data (if any needed), in particular, input/output, have you checked any R packages that already have this?
  • Create a repository for the package.

Once the project is on git, following checkmarks

  • The package's functions are throughly documented using roxygen2, this includes: Description, parameters (@param), value (@return), details (if any), examples (@details), references (@references) and links to other functions (@seealso, and @family).
  • The package has been fully tested using testthat or other framework.
  • The project is built using Continuous Integration services as Travis-ci and Appveyor.
  • The package includes a vignette with an extended example and, if needed, references on the package.
  • The package has a website (suggest using pkgdown)
  • The package has been uploaded to CRAN or BioC.

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.