Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hvaret committed Dec 3, 2015
1 parent 40d38df commit 91e4586
Show file tree
Hide file tree
Showing 45 changed files with 67 additions and 58 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Package: SARTools
Type: Package
Title: Statistical Analysis of RNA-Seq Tools
Version: 1.2.0
Date: 2015-12-01
Date: 2015-12-03
Author: Marie-Agnes Dillies and Hugo Varet
Maintainer: Hugo Varet <hugo.varet@pasteur.fr>
Depends: R (>= 3.1.0), DESeq2 (>= 1.6.0), edgeR (>= 3.8.0), xtable
Depends: R (>= 3.2.2), DESeq2 (>= 1.10.0), edgeR (>= 3.12.0), xtable
Imports: knitr, GenomicRanges, S4Vectors, limma, genefilter (>= 1.44.0)
VignetteBuilder: knitr
Encoding: latin1
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated by roxygen2 (4.1.1): do not edit by hand

exportPattern("^[a-zA-Z]")
import(DESeq2)
import(edgeR)
Expand All @@ -10,3 +8,4 @@ importFrom(S4Vectors,mcols)
importFrom(genefilter,shorth)
importFrom(knitr,knit2html)
importFrom(limma,plotMDS)
importFrom(S4Vectors,metadata)
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ CHANGES IN VERSION 1.2.0
o Fixed a bug when selecting the most variant features in PCAPlot()
o Fixed a bug when setting cpmCutoff to 0 using the edgeR script
o Vignette name is now "SARTools" instead of "tutorial"
o Mofidied the way of getting the independent filtering threshold (bug due to new DESeq2 version)
o New versions of R (3.2.2), DESeq2 (1.10.0) and edgeR (3.12.0) required

CHANGES IN VERSION 1.1.0
------------------------
Expand Down
30 changes: 18 additions & 12 deletions R/diagSizeFactorsPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,38 @@
#'
#' @param dds a \code{DESeqDataSet} object
#' @param outfile TRUE to export the figure in a png file
#' @param plots vector of plots to generate
#' @return Two files in the figures directory: diagSizeFactorsHist.png containing one histogram per sample and diagSizeFactorsTC.png for a plot of the size factors vs the total number of reads
#' @author Marie-Agnes Dillies and Hugo Varet

diagSizeFactorsPlots <- function(dds, outfile=TRUE){
diagSizeFactorsPlots <- function(dds, outfile=TRUE, plots=c("diag","sf_libsize")){
# histograms
nrow <- ceiling(sqrt(ncol(counts(dds))))
ncol <- ceiling(ncol(counts(dds))/nrow)
if (outfile) png(filename="figures/diagSizeFactorsHist.png", width=300*max(ncol,nrow), height=300*min(ncol,nrow))
if ("diag" %in% plots){
nrow <- ceiling(sqrt(ncol(counts(dds))))
ncol <- ceiling(ncol(counts(dds))/nrow)
if (outfile) png(filename="figures/diagSizeFactorsHist.png", width=300*max(ncol,nrow), height=300*min(ncol,nrow))
par(mfrow=sort(c(nrow,ncol)))
geomeans <- exp(rowMeans(log(counts(dds))))
geomeans <- exp(rowMeans(log(counts(dds))))
samples <- colnames(counts(dds))
counts.trans <- log2(counts(dds)/geomeans)
xmin <- min(counts.trans[is.finite(counts.trans)],na.rm=TRUE)
xmax <- max(counts.trans[is.finite(counts.trans)],na.rm=TRUE)
for (j in 1:ncol(dds)){
hist(log2(counts(dds)[,j]/geomeans), nclass=100, xlab=expression(log[2] ~ (counts/geometric~mean)), las=1, xlim=c(xmin,xmax),
hist(log2(counts(dds)[,j]/geomeans), nclass=100, xlab=expression(log[2] ~ (counts/geometric~mean)), las=1, xlim=c(xmin,xmax),
main=paste0("Size factors diagnostic - Sample ",samples[j]),col="skyblue")
abline(v = log2(sizeFactors(dds)[j]), col="red", lwd=1.5)
}
if (outfile) dev.off()
if (outfile) dev.off()
}

# total read counts vs size factors
if (outfile) png(filename="figures/diagSizeFactorsTC.png",width=400,height=400)
plot(sizeFactors(dds), colSums(counts(dds)), pch=19, las=1, xlab="Size factors",
ylab="Total number of reads",main="Diagnostic: size factors vs total number of reads")
abline(lm(colSums(counts(dds)) ~ sizeFactors(dds) + 0), lty=2, col="grey")
if (outfile) dev.off()
if ("sf_libsize" %in% plots){
if (outfile) png(filename="figures/diagSizeFactorsTC.png",width=400,height=400)
plot(sizeFactors(dds), colSums(counts(dds)), pch=19, las=1, xlab="Size factors",
ylab="Total number of reads",main="Diagnostic: size factors vs total number of reads")
abline(lm(colSums(counts(dds)) ~ sizeFactors(dds) + 0), lty=2, col="grey")
if (outfile) dev.off()
}
}


2 changes: 1 addition & 1 deletion R/tabIndepFiltering.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
tabIndepFiltering <- function(results){
out <- matrix(NA,ncol=3,nrow=length(names(results)),dimnames=list(names(results),c("Test vs Ref","Threshold","# discarded")))
for (name in names(results)){
threshold <- attr(results[[name]],"filterThreshold")
threshold <- metadata(results[[name]])$filterThreshold
out[name,2] <- round(threshold,2)
use <- results[[name]]$baseMean > threshold
out[name,3] <- ifelse(is.na(table(use)["FALSE"]),0,table(use)["FALSE"])
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 (`template_script_DESeq2.r`
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). SARTools needs R version 3.1.0 or higher, DESeq2 1.6.0 or higher and edgeR 3.8.5 or higher: old versions of DESeq2 or edgeR may be incompatible with 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). SARTools needs R version 3.2.2 or higher, DESeq2 1.10.0 or higher and edgeR 3.12.0 or higher: old versions of DESeq2 or edgeR may be incompatible with SARTools.

To install the SARTools package from GitHub, open a R session and:
- install DESeq2, edgeR and genefilter with `source("http://bioconductor.org/biocLite.R")` and `biocLite(c("DESeq2", "edgeR", "genefilter"))` (if not installed yet)
Expand Down
2 changes: 1 addition & 1 deletion inst/report_edgeR.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Normalization aims at correcting systematic technical biases in the data, in ord
edgeR computes a factor for each sample. These normalization factors apply to the total number of counts and cannot be used to normalize read counts in a direct manner. Indeed, normalization factors are used to normalize total counts. These in turn are used to normalize read counts according to a total count normalization: if $N_j$ is the total number of reads of the sample $j$ and $f_j$ its normalization factor, $N'_j=f_j \times N_j$ is the normalized total number of reads. Then, let $s_j=N'_j/\bar{N'}$ with $\bar{N'}$ the mean of the $N'_j$ s. Finally, the normalized counts of the sample $j$ are defined as $x'_{ij}=x_{ij}/s_j$ where $i$ is the gene index.

```{r , cache=TRUE, echo=FALSE, results="asis"}
print(xtable(t(matrix(out.edgeR$dge$samples$norm.factors, dimnames=list(target$label,"TMM"))),caption="Table 5: Normalization factors."), type="html", html.table.attributes = "align='center'")
print(xtable(t(matrix(out.edgeR$dge$samples$norm.factors, dimnames=list(target$label,paste0(normalizationMethod," normalization factors")))),caption="Table 5: Normalization factors."), type="html", html.table.attributes = "align='center'")
```

Boxplots are often used to assess the quality of the normalization process, as they show how distributions are globally affected during this process. We expect normalization to stabilize distributions across samples. Figure 8 shows boxplots of raw (left) and normalized (right) data respectively.
Expand Down
2 changes: 1 addition & 1 deletion man/BCVPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/MAPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/MDSPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PCAPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/SARTools-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/SERE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/barplotNull.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/barplotTotal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/checkParameters.DESeq2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/checkParameters.edgeR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/clusterPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/countsBoxplots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/densityPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/descriptionPlots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/diagSizeFactorsPlots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dispersionsPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/exploreCounts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/exportResults.DESeq2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/exportResults.edgeR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/loadCountData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/loadTargetFile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/majSequences.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/nDiffTotal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pairwiseScatterPlots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/rawpHist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/removeNull.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/run.DESeq2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/run.edgeR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/summarizeResults.DESeq2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/summarizeResults.edgeR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tabIndepFiltering.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tabSERE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/volcanoPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/writeReport.DESeq2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/writeReport.edgeR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion template_script_DESeq2.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### R script to compare several conditions with the SARTools and DESeq2 packages
### Hugo Varet
### April 20th, 2015
### designed to be executed with SARTools 1.1.1
### designed to be executed with SARTools 1.2.0
################################################################################

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion template_script_edgeR.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### R script to compare several conditions with the SARTools and edgeR packages
### Hugo Varet
### April 20th, 2015
### designed to be executed with SARTools 1.1.1
### designed to be executed with SARTools 1.2.0
################################################################################

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion vignettes/SARTools.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ targetFile <- system.file("target.txt", package="SARTools")
rawDir <- system.file("raw", package="SARTools")
```

The user can try the R scripts `template_script_DESeq2.r` and `template_script_edgeR.r` with the parameters above (all the others remaining unchanged).
The user can try the R scripts `template_script_DESeq2.r` and `template_script_edgeR.r` specifying a working directory (`workDir`) and with the parameters above (all the others remaining unchanged).

## Bibliography

Expand Down

0 comments on commit 91e4586

Please sign in to comment.