Skip to content

Commit 5c8c9bd

Browse files
committed
shrinkage+ggplot2
1 parent 4424887 commit 5c8c9bd

7 files changed

Lines changed: 7 additions & 11 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: SARTools
22
Type: Package
33
Title: Statistical Analysis of RNA-Seq Tools
44
Version: 1.8.2
5-
Date: 2025-03-24
5+
Date: 2025-10-09
66
Authors@R: c(
77
person(given = "Hugo", family = "Varet", role = c("aut", "cre"), email = "hugo.varet@pasteur.fr"),
88
person(given = "Marie-Agnès", family = "Dillies", role = c("aut"), email = "marie-agnes.dillies@pasteur.fr")

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
CHANGES IN VERSION 1.8.2
22
------------------------
33
o use of after_stat(density) instead of ..density..
4+
o fixed other few deprecated usages of ggplot2
5+
o back to default DESeq2 shrinkage as "ashr" tends to produce aberrant log2FoldChanges
46

57
CHANGES IN VERSION 1.8.1
68
------------------------

R/barplotNull.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ barplotNull <- function(counts, group, col=c("lightblue","orange","MediumVioletR
2525
ggplot_theme +
2626
theme(axis.text.x=element_text(angle=90, hjust=1, vjust=0.5)) +
2727
scale_y_continuous(expand=expansion(mult=c(0.01, 0.05))) +
28-
geom_hline(yintercept=percentage.allNull, linetype="dashed", color="black", size=1))
28+
geom_hline(yintercept=percentage.allNull, linetype="dashed", color="black", linewidth=1))
2929
if (outfile) dev.off()
3030
}

R/diagSizeFactorsPlots.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ diagSizeFactorsPlots <- function(dds, group, col=c("lightblue","orange","MediumV
3131
xlab(expression(log[2]~(counts/geometric~mean))) +
3232
ylab("") +
3333
ggtitle(paste0("Size factor diagnostic - ", samples[j])) +
34-
geom_vline(xintercept=log2(sizeFactors(dds)[j]), linetype="dashed", color="red", size=1) +
34+
geom_vline(xintercept=log2(sizeFactors(dds)[j]), linetype="dashed", color="red", linewidth=1) +
3535
ggplot_theme
3636
}
3737
tmpfun <- function(...) grid.arrange(..., nrow=nrow, ncol=ncol)

R/pairwiseScatterPlots.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pairwiseScatterPlots <- function(counts, outfile=TRUE, ggplot_theme=theme_gray()
2020
for (j in 1:ncol){
2121
if (i==j) next
2222
if (i > j){
23-
p[[k]] <- ggplot(data=cbind(d, z=1), aes_string(x=names(d)[i], y=names(d)[j], z="z")) +
23+
p[[k]] <- ggplot(data=cbind(d, z=1), aes(x=.data[[names(d)[i]]], y=.data[[names(d)[j]]], z=.data[["z"]])) +
2424
stat_summary_2d(fun=function(z) log(sum(z)), bins=60, show.legend=FALSE) +
2525
scale_x_continuous(trans = log10_trans(),
2626
breaks = trans_breaks("log10", function(x) 10^x),

R/run.DESeq2.r

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ run.DESeq2 <- function(counts, target, varInt, batch=NULL,
3434
dds <- estimateDispersions(dds, fitType=fitType)
3535

3636
# statistical testing: perform all the comparisons between the levels of varInt
37-
dds <- nbinomWaldTest(dds, ...)
37+
dds <- nbinomWaldTest(dds, betaPrior=TRUE, ...)
3838
results <- list()
3939
for (comp in combn(nlevels(colData(dds)[,varInt]), 2, simplify=FALSE)){
4040
levelRef <- levels(colData(dds)[,varInt])[comp[1]]
@@ -43,10 +43,6 @@ run.DESeq2 <- function(counts, target, varInt, batch=NULL,
4343
contrast=c(varInt, levelTest, levelRef),
4444
pAdjustMethod=pAdjustMethod, cooksCutoff=cooksCutoff,
4545
independentFiltering=independentFiltering, alpha=alpha)
46-
lfcs <- lfcShrink(dds, res=res,
47-
contrast=c(varInt, levelTest, levelRef),
48-
type="ashr", quiet=TRUE)
49-
res$log2FoldChange <- lfcs$log2FoldChange
5046
results[[paste0(levelTest,"_vs_",levelRef)]] <- res
5147
cat(paste("Comparison", levelTest, "vs", levelRef, "done\n"))
5248
}

inst/report_DESeq2.rmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ Figure 14 shows the volcano plots for the comparisons performed and differential
226226

227227
</center>
228228

229-
Note that the log2(Fold-Changes) are shrunk using the "ashr" method that has been shown to be more robust than the original "normal" method [@ashr].
230-
231229
Full results as well as lists of differentially expressed features are provided in the following text files which can be easily read in a spreadsheet. For each comparison:
232230

233231
- TestVsRef.complete.txt contains results for all the features;

0 commit comments

Comments
 (0)