Skip to content

Commit 3e504af

Browse files
authored
Merge pull request #93 from PF2-pasteur-fr/development
ashr
2 parents b229ead + 0f9b5c9 commit 3e504af

19 files changed

Lines changed: 58 additions & 33 deletions

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Package: SARTools
22
Type: Package
33
Title: Statistical Analysis of RNA-Seq Tools
4-
Version: 1.8.0
5-
Date: 2022-02-17
4+
Version: 1.8.1
5+
Date: 2022-03-23
66
Author: Marie-Agnes Dillies and Hugo Varet
77
Maintainer: Hugo Varet <hugo.varet@pasteur.fr>
88
Depends: R (>= 3.3.0),
99
DESeq2 (>= 1.32.0),
10-
apeglm (>= 1.14.0),
10+
ashr (>= 2.2-54),
1111
edgeR (>= 3.34.0),
1212
ggplot2 (>= 3.3.0),
1313
kableExtra

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exportPattern("^[a-zA-Z]")
44
import(DESeq2)
5-
import(apeglm)
5+
import(ashr)
66
import(edgeR)
77
import(ggplot2)
88
import(kableExtra)

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
CHANGES IN VERSION 1.8.1
2+
------------------------
3+
o log2FoldChanges from DESeq2 are now computed using lfcShrink() with type="ashr" as "apeglm"
4+
was not compatible with the contrast argument
5+
16
CHANGES IN VERSION 1.8.0
27
------------------------
38
o log2FoldChanges from DESeq2 are now computed using lfcShrink() with type="apeglm"

R/NAMESPACE.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' @exportPattern ^[a-zA-Z]
22
#' @import DESeq2
3-
#' @import apeglm
3+
#' @import ashr
44
#' @import edgeR
55
#' @import ggplot2
66
#' @import kableExtra

R/descriptionPlots.r

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
#' @param counts \code{matrix} of counts
66
#' @param group factor vector of the condition from which each sample belongs
77
#' @param col colors for the plots (one per biological condition)
8-
#' @param ggplot_theme ggplot2 theme function (\code{theme_gray()} by default)
8+
#' @param ggplot_theme ggplot2 theme function (\code{theme_light()} by default)
99
#' @return PNG files in the "figures" directory and the matrix of the most expressed sequences
1010
#' @author Hugo Varet
1111

12-
descriptionPlots <- function(counts, group, col=c("lightblue","orange","MediumVioletRed","SpringGreen"), ggplot_theme=theme_gray()){
12+
descriptionPlots <- function(counts, group, col=c("lightblue","orange","MediumVioletRed","SpringGreen"),
13+
ggplot_theme=theme_light()){
1314
# create the figures directory if does not exist
1415
if (!I("figures" %in% dir())) dir.create("figures", showWarnings=FALSE)
1516

R/exploreCounts.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#' @param typeTrans transformation method for PCA/clustering with DESeq2: \code{"VST"} or \code{"rlog"}
88
#' @param gene.selection selection of the features in MDSPlot (\code{"pairwise"} by default)
99
#' @param col colors used for the PCA/MDS (one per biological condition)
10-
#' @param ggplot_theme ggplot2 theme function (\code{theme_gray()} by default)
10+
#' @param ggplot_theme ggplot2 theme function (\code{theme_light()} by default)
1111
#' @return A list containing the dds object and the results object
1212
#' @author Hugo Varet
1313

1414
exploreCounts <- function(object, group, typeTrans="VST", gene.selection="pairwise",
1515
col=c("lightblue","orange","MediumVioletRed","SpringGreen"),
16-
ggplot_theme=theme_gray()){
16+
ggplot_theme=theme_light()){
1717
if (class(object)=="DESeqDataSet"){
1818
if (typeTrans == "VST") counts.trans <- assay(varianceStabilizingTransformation(object))
1919
else counts.trans <- assay(rlogTransformation(object))

R/run.DESeq2.r

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ run.DESeq2 <- function(counts, target, varInt, batch=NULL,
3939
for (comp in combn(nlevels(colData(dds)[,varInt]), 2, simplify=FALSE)){
4040
levelRef <- levels(colData(dds)[,varInt])[comp[1]]
4141
levelTest <- levels(colData(dds)[,varInt])[comp[2]]
42-
res <- results(dds, name=paste(c(varInt, levelTest, "vs", levelRef), collapse="_"),
42+
res <- results(dds,
43+
contrast=c(varInt, levelTest, levelRef),
4344
pAdjustMethod=pAdjustMethod, cooksCutoff=cooksCutoff,
4445
independentFiltering=independentFiltering, alpha=alpha)
45-
lfcs <- lfcShrink(dds, res=res, coef=paste(c(varInt, levelTest, "vs", levelRef), collapse="_"), type="apeglm")
46+
lfcs <- lfcShrink(dds, res=res,
47+
contrast=c(varInt, levelTest, levelRef),
48+
type="ashr", quiet=TRUE)
4649
res$log2FoldChange <- lfcs$log2FoldChange
4750
results[[paste0(levelTest,"_vs_",levelRef)]] <- res
4851
cat(paste("Comparison", levelTest, "vs", levelRef, "done\n"))
4952
}
5053

51-
return(list(dds=dds,results=results,sf=sizeFactors(dds)))
54+
return(list(dds=dds, results=results, sf=sizeFactors(dds)))
5255
}

R/summarizeResults.DESeq2.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
#' @param col colors for the plots
1111
#' @param log2FClim numeric vector containing both upper and lower y-axis limits for all the MA-plots produced (NULL by default to set them automatically)
1212
#' @param padjlim numeric value between 0 and 1 for the adjusted p-value upper limits for all the volcano plots produced (NULL by default to set them automatically)
13-
#' @param ggplot_theme ggplot2 theme function (\code{theme_gray()} by default)
13+
#' @param ggplot_theme ggplot2 theme function (\code{theme_light()} by default)
1414
#' @return A list containing: (i) a list of \code{data.frames} from \code{exportResults.DESeq2()}, (ii) the table summarizing the independent filtering procedure and (iii) a table summarizing the number of differentially expressed features
1515
#' @author Hugo Varet
1616

1717
summarizeResults.DESeq2 <- function(out.DESeq2, group, independentFiltering=TRUE, cooksCutoff=TRUE,
1818
alpha=0.05, col=c("lightblue","orange","MediumVioletRed","SpringGreen"),
19-
log2FClim=NULL, padjlim=NULL, ggplot_theme=theme_gray()){
19+
log2FClim=NULL, padjlim=NULL, ggplot_theme=theme_light()){
2020
# create the figures/tables directory if does not exist
2121
if (!I("figures" %in% dir())) dir.create("figures", showWarnings=FALSE)
2222
if (!I("tables" %in% dir())) dir.create("tables", showWarnings=FALSE)

R/summarizeResults.edgeR.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
#' @param col colors for the plots
1010
#' @param log2FClim numeric vector containing both upper and lower y-axis limits for all the MA-plots produced (NULL by default to set them automatically)
1111
#' @param padjlim numeric value between 0 and 1 for the adjusted p-value upper limits for all the volcano plots produced (NULL by default to set them automatically)
12-
#' @param ggplot_theme ggplot2 theme function (\code{theme_gray()} by default)
12+
#' @param ggplot_theme ggplot2 theme function (\code{theme_light()} by default)
1313
#' @return A list containing: (i) a list of \code{data.frames} from \code{exportResults.edgeR()} and (ii) a table summarizing the number of differentially expressed features
1414
#' @author Hugo Varet
1515

1616
summarizeResults.edgeR <- function(out.edgeR, group, counts, alpha=0.05,
1717
col=c("lightblue","orange","MediumVioletRed","SpringGreen"),
18-
log2FClim=NULL, padjlim=NULL, ggplot_theme=theme_gray()){
18+
log2FClim=NULL, padjlim=NULL, ggplot_theme=theme_light()){
1919
# create the figures/tables directory if does not exist
2020
if (!I("figures" %in% dir())) dir.create("figures", showWarnings=FALSE)
2121
if (!I("tables" %in% dir())) dir.create("tables", showWarnings=FALSE)

inst/bibliography.bib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,19 @@ @article{zhu2018
232232
url = {https://doi.org/10.1093/bioinformatics/bty895},
233233
eprint = {https://academic.oup.com/bioinformatics/article-pdf/35/12/2084/28839676/bty895.pdf},
234234
}
235+
236+
@article{ashr,
237+
author = {Stephens, Matthew},
238+
title = "{False discovery rates: a new deal}",
239+
journal = {Biostatistics},
240+
volume = {18},
241+
number = {2},
242+
pages = {275-294},
243+
year = {2016},
244+
month = {10},
245+
abstract = "{We introduce a new Empirical Bayes approach for large-scale hypothesis testing, including estimating false discovery rates (FDRs), and effect sizes. This approach has two key differences from existing approaches to FDR analysis. First, it assumes that the distribution of the actual (unobserved) effects is unimodal, with a mode at 0. This “unimodal assumption” (UA), although natural in many contexts, is not usually incorporated into standard FDR analysis, and we demonstrate how incorporating it brings many benefits. Specifically, the UA facilitates efficient and robust computation—estimating the unimodal distribution involves solving a simple convex optimization problem—and enables more accurate inferences provided that it holds. Second, the method takes as its input two numbers for each test (an effect size estimate and corresponding standard error), rather than the one number usually used (\\$p\\$ value or \\$z\\$ score). When available, using two numbers instead of one helps account for variation in measurement precision across tests. It also facilitates estimation of effects, and unlike standard FDR methods, our approach provides interval estimates (credible regions) for each effect in addition to measures of significance. To provide a bridge between interval estimates and significance measures, we introduce the term “local false sign rate” to refer to the probability of getting the sign of an effect wrong and argue that it is a superior measure of significance than the local FDR because it is both more generally applicable and can be more robustly estimated. Our methods are implemented in an R package ashr available from http://github.com/stephens999/ashr.}",
246+
issn = {1465-4644},
247+
doi = {10.1093/biostatistics/kxw041},
248+
url = {https://doi.org/10.1093/biostatistics/kxw041},
249+
eprint = {https://academic.oup.com/biostatistics/article-pdf/18/2/275/11057424/kxw041.pdf},
250+
}

0 commit comments

Comments
 (0)