Skip to content

Commit

Permalink
Merge pull request #3 from PF2-pasteur-fr/development
Browse files Browse the repository at this point in the history
cooksCutoff
  • Loading branch information
hvaret committed Feb 4, 2015
2 parents 9d4b948 + 8db39a7 commit 921a581
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 26 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: SARTools
Type: Package
Title: Statistical Analysis of RNA-Seq Tools
Version: 1.0.2
Date: 2014-01-06
Version: 1.0.3
Date: 2015-02-04
Author: Marie-Agnes Dillies and Hugo Varet
Maintainer: Hugo Varet <[email protected]>
Depends: R (>= 3.1.0), DESeq2 (>= 1.6.0), edgeR (>= 3.8.0), xtable
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CHANGES IN VERSION 1.0.3
------------------------
o If use of DESeq2, the cooksCutoff parameter is now TRUE or FALSE (instead of NULL, Inf or a numeric)

CHANGES IN VERSION 1.0.2
------------------------
o Added volcano plots to the HTML reports
Expand Down
6 changes: 3 additions & 3 deletions R/checkParameters.DESeq2.r
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @param condRef reference biological condition
#' @param batch blocking factor in the design
#' @param fitType mean-variance relationship: "parametric" (default) or "local"
#' @param cooksCutoff outliers detection threshold (NULL to let DESeq2 choosing it)
#' @param cooksCutoff outliers detection (TRUE or FALSE)
#' @param independentFiltering TRUE/FALSE to perform independent filtering
#' @param alpha threshold of statistical significance
#' @param pAdjustMethod p-value adjustment method: "BH" (default) or "BY" for example
Expand Down Expand Up @@ -64,8 +64,8 @@ checkParameters.DESeq2 <- function(projectName,author,targetFile,rawDir,
print("fitType must be equal to 'parametric' or 'local'")
problem <- TRUE
}
if (!is.null(cooksCutoff) && I(!is.numeric(cooksCutoff) | length(cooksCutoff)!=1 || cooksCutoff<=0)){
print("cooksCutoff must be NULL or a numeric vector of length 1 with a positive value")
if (!is.logical(cooksCutoff) | length(cooksCutoff)!=1){
print("cooksCutoff must be a boolean vector of length 1")
problem <- TRUE
}
if (!is.logical(independentFiltering) | length(independentFiltering)!=1){
Expand Down
7 changes: 3 additions & 4 deletions R/run.DESeq2.r
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param locfunc \code{"median"} (default) or \code{"shorth"} to estimate the size factors
#' @param fitType mean-variance relationship: "parametric" (default) or "local"
#' @param pAdjustMethod p-value adjustment method: \code{"BH"} (default) or \code{"BY"} for instance
#' @param cooksCutoff outliers detection threshold (\code{NULL} to let DESeq2 choosing it)
#' @param cooksCutoff outliers detection threshold (TRUE to let DESeq2 choosing it or FALSE to disable the outliers detection)
#' @param independentFiltering \code{TRUE} or \code{FALSE} to perform the independent filtering or not
#' @param alpha significance threshold to apply to the adjusted p-values
#' @param ... optional arguments to be passed to \code{nbinomWaldTest()}
Expand All @@ -18,7 +18,7 @@

run.DESeq2 <- function(counts, target, varInt, batch=NULL,
locfunc="median", fitType="parametric", pAdjustMethod="BH",
cooksCutoff=NULL, independentFiltering=TRUE, alpha=0.05, ...){
cooksCutoff=TRUE, independentFiltering=TRUE, alpha=0.05, ...){
# building dds object
dds <- DESeqDataSetFromMatrix(countData=counts, colData=target,
design=formula(paste("~", ifelse(!is.null(batch), paste(batch,"+"), ""), varInt)))
Expand All @@ -40,8 +40,7 @@ run.DESeq2 <- function(counts, target, varInt, batch=NULL,
levelRef <- levels(colData(dds)[,varInt])[comp[1]]
levelTest <- levels(colData(dds)[,varInt])[comp[2]]
results[[paste0(levelTest,"_vs_",levelRef)]] <- results(dds, contrast=c(varInt, levelTest, levelRef),
pAdjustMethod=pAdjustMethod,
cooksCutoff=ifelse(!is.null(cooksCutoff),cooksCutoff,TRUE),
pAdjustMethod=pAdjustMethod, cooksCutoff=cooksCutoff,
independentFiltering=independentFiltering, alpha=alpha)
cat(paste("Comparison", levelTest, "vs", levelRef, "done\n"))
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SARTools is distributed with two R script templates which use functions of the p
How to install SARTools?
------------------------

In addition to the SARTools package itself, the workflow requires the installation of several packages: DESeq2, edgeR, genefilter, xtable and knitr (all available online, see the dedicated webpages). This current version of SARTools has been developed under R 3.1.1 and with DESeq2 1.6.1, edgeR 3.8.2, genefilter 1.48.1 and knitr 1.7. As a DESeq2 or edgeR update might make the workflow unusable due to modifications on the statistical models, care is recommended when updating these packages.
In addition to the SARTools package itself, the workflow requires the installation of several packages: DESeq2, edgeR, genefilter, xtable and knitr (all available online, see the dedicated webpages). This current version of SARTools has been developed under R 3.1.2 and with DESeq2 1.6.3, edgeR 3.8.5, genefilter 1.48.1 and knitr 1.7. As a DESeq2 or edgeR update might make the workflow unusable due to modifications on the statistical models, care is recommended when updating these packages.

To install the SARTools package from GitHub, open a R session and:
- install DESeq2, edgeR, genefilter and BiocStyle with `source("http://bioconductor.org/biocLite.R")` and `biocLite(c("DESeq2", "edgeR", "genefilter", "BiocStyle"))` (if not installed yet)
Expand Down
6 changes: 3 additions & 3 deletions inst/template_script_DESeq2.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
### R script to compare several conditions with the SARTools and DESeq2 packages
### Hugo Varet
### December 10th, 2014
### designed to be executed with SARTools 1.0.1
### February 04th, 2015
### designed to be executed with SARTools 1.0.3
################################################################################

################################################################################
Expand All @@ -26,7 +26,7 @@ condRef <- "WT" # reference biological cond
batch <- NULL # blocking factor: NULL (default) or "batch" for example

fitType <- "parametric" # mean-variance relationship: "parametric" (default) or "local"
cooksCutoff <- NULL # outliers detection threshold (NULL to let DESeq2 choosing it)
cooksCutoff <- TRUE # TRUE/FALSE to perform the outliers detection (default is TRUE)
independentFiltering <- TRUE # TRUE/FALSE to perform independent filtering (default is TRUE)
alpha <- 0.05 # threshold of statistical significance
pAdjustMethod <- "BH" # p-value adjustment method: "BH" (default) or "BY"
Expand Down
4 changes: 2 additions & 2 deletions inst/template_script_edgeR.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
### R script to compare several conditions with the SARTools and edgeR packages
### Hugo Varet
### December 10th, 2014
### designed to be executed with SARTools 1.0.1
### February 04th, 2015
### designed to be executed with SARTools 1.0.3
################################################################################

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion man/checkParameters.DESeq2.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ checkParameters.DESeq2(projectName, author, targetFile, rawDir,

\item{fitType}{mean-variance relationship: "parametric" (default) or "local"}

\item{cooksCutoff}{outliers detection threshold (NULL to let DESeq2 choosing it)}
\item{cooksCutoff}{outliers detection (TRUE or FALSE)}

\item{independentFiltering}{TRUE/FALSE to perform independent filtering}

Expand Down
4 changes: 2 additions & 2 deletions man/run.DESeq2.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\title{Wrapper to run DESeq2}
\usage{
run.DESeq2(counts, target, varInt, batch = NULL, locfunc = "median",
fitType = "parametric", pAdjustMethod = "BH", cooksCutoff = NULL,
fitType = "parametric", pAdjustMethod = "BH", cooksCutoff = TRUE,
independentFiltering = TRUE, alpha = 0.05, ...)
}
\arguments{
Expand All @@ -23,7 +23,7 @@ run.DESeq2(counts, target, varInt, batch = NULL, locfunc = "median",

\item{pAdjustMethod}{p-value adjustment method: \code{"BH"} (default) or \code{"BY"} for instance}

\item{cooksCutoff}{outliers detection threshold (\code{NULL} to let DESeq2 choosing it)}
\item{cooksCutoff}{outliers detection threshold (TRUE to let DESeq2 choosing it or FALSE to disable the outliers detection)}

\item{independentFiltering}{\code{TRUE} or \code{FALSE} to perform the independent filtering or not}

Expand Down
6 changes: 3 additions & 3 deletions template_script_DESeq2.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
### R script to compare several conditions with the SARTools and DESeq2 packages
### Hugo Varet
### December 10th, 2014
### designed to be executed with SARTools 1.0.1
### February 04th, 2015
### designed to be executed with SARTools 1.0.3
################################################################################

################################################################################
Expand All @@ -26,7 +26,7 @@ condRef <- "WT" # reference biological cond
batch <- NULL # blocking factor: NULL (default) or "batch" for example

fitType <- "parametric" # mean-variance relationship: "parametric" (default) or "local"
cooksCutoff <- NULL # outliers detection threshold (NULL to let DESeq2 choosing it)
cooksCutoff <- TRUE # TRUE/FALSE to perform the outliers detection (default is TRUE)
independentFiltering <- TRUE # TRUE/FALSE to perform independent filtering (default is TRUE)
alpha <- 0.05 # threshold of statistical significance
pAdjustMethod <- "BH" # p-value adjustment method: "BH" (default) or "BY"
Expand Down
4 changes: 2 additions & 2 deletions template_script_edgeR.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
### R script to compare several conditions with the SARTools and edgeR packages
### Hugo Varet
### December 10th, 2014
### designed to be executed with SARTools 1.0.1
### February 04th, 2015
### designed to be executed with SARTools 1.0.3
################################################################################

################################################################################
Expand Down
Binary file modified tutorial.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions vignettes/tutorial.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The next section details the tools and files required to perform an analysis and
\section{Prerequisites}
\subsection{\R{} tools}

In addition to the \Rpackage{SARTools} package itself, the workflow requires the installation of several packages: \deseq, \edger, \Biocpkg{genefilter}, \CRANpkg{xtable} and \CRANpkg{knitr} (all available online). This current version of \Rpackage{SARTools} has been developed under \R{}~3.1.1 and with \deseq~1.6.1, \edger~3.8.2, \Biocpkg{genefilter}~1.48.1 and \CRANpkg{knitr}~1.7. As a \deseq~or \edger~update might make the workflow unusable due to modifications on the statistical models, care is recommended when updating these packages. \\
In addition to the \Rpackage{SARTools} package itself, the workflow requires the installation of several packages: \deseq, \edger, \Biocpkg{genefilter}, \CRANpkg{xtable} and \CRANpkg{knitr} (all available online). This current version of \Rpackage{SARTools} has been developed under \R{}~3.1.2 and with \deseq~1.6.3, \edger~3.8.5, \Biocpkg{genefilter}~1.48.1 and \CRANpkg{knitr}~1.7. As a \deseq~or \edger~update might make the workflow unusable due to modifications on the statistical models, care is recommended when updating these packages. \\

The only file the user has to deal with for an analysis is either \file{template\_script\_DESeq2.r} or \file{template\_script\_edgeR.r} (supplied in the appendix at the end of this vignette). They contain all the code needed for the statistical analysis, and to generate figures, tables and the HTML report.

Expand Down Expand Up @@ -126,7 +126,7 @@ All the parameters that can be modified by the user are at the beginning of the
\item \Rcode{condRef}: reference biological condition used to compute fold-changes (no default, must be one of the levels of \Rcode{varInt});
\item \Rcode{batch}: adjustment variable to use as a batch effect, must be a column of the target file (\Rcode{NULL} if no batch effect needs to be taken into account);
\item \Rcode{fitType}: (if use of \deseq) type of model for the mean-dispersion relationship (\Rcode{"parametric"} by default, or \Rcode{"local"});
\item \Rcode{cooksCutoff}: (if use of \deseq) \Rcode{NULL} to let \deseq~choosing the threshold for the outlier detection, \Rcode{Inf} to turn it off, or a numeric of length one to give a specific value \cite{Cook1977Detection};
\item \Rcode{cooksCutoff}: (if use of \deseq) \Rcode{TRUE} (default) of \Rcode{FALSE} to execute or not the detection of the outliers \cite{Cook1977Detection};
\item \Rcode{independentFiltering}: (if use of \deseq) \Rcode{TRUE} (default) of \Rcode{FALSE} to execute or not the independent filtering \cite{bourgon2010};
\item \Rcode{alpha}: significance threshold applied to the adjusted p-values to select the differentially expressed features (default is \Rcode{0.05});
\item \Rcode{pAdjustMethod}: p-value adjustment method for multiple testing \cite{bh1995,yekutieli} (\Rcode{"BH"} by default, \Rcode{"BY"} or any value of \Rcode{p.adjust.methods});
Expand Down Expand Up @@ -173,7 +173,7 @@ While running the script, PNG files are generated in the \texttt{figures} direct
\item \file{BCV.png}: graph of the estimations of the tagwise, trended and common dispersions (if use of \edger);
\item \file{rawpHist.png}: histogram of the raw p-values for each comparison;
\item \file{MAplot.png}: MA-plot for each comparison (log ratio of the means vs intensity);
\item \file{vulcanoPlot.png}: vulcano plot for each comparison ($-\log_{10}\text{(adjusted P value)}$ vs log ratio of the means).
\item \file{volcanoPlot.png}: vulcano plot for each comparison ($-\log_{10}\text{(adjusted P value)}$ vs log ratio of the means).
\end{itemize}

Some tab-delimited files are exported in the \texttt{tables} directory. They store information on the features as $\log_2\text{(FC)}$ or p-values and can be read easily in a spreadsheet:
Expand Down

0 comments on commit 921a581

Please sign in to comment.