Skip to content

Commit

Permalink
Merge pull request #83 from PF2-pasteur-fr/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
hvaret committed Jun 8, 2021
2 parents 2b95eaa + ea06750 commit 7c8fe50
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 18 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: SARTools
Type: Package
Title: Statistical Analysis of RNA-Seq Tools
Version: 1.7.3
Date: 2020-04-29
Version: 1.7.4
Date: 2021-06-08
Author: Marie-Agnes Dillies and Hugo Varet
Maintainer: Hugo Varet <[email protected]>
Depends: R (>= 3.3.0),
DESeq2 (>= 1.12.0),
edgeR (>= 3.12.0),
edgeR (>= 3.34.0),
ggplot2 (>= 3.3.0),
kableExtra
Imports: genefilter (>= 1.44.0),
Expand All @@ -33,4 +33,4 @@ VignetteBuilder: knitr, rmarkdown
Encoding: latin1
Description: Provide R tools and an environment for the statistical analysis of RNA-Seq projects: load and clean data, produce figures, perform statistical analysis/testing with DESeq2 or edgeR, export results and create final report.
License: GPL-2
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
CHANGES IN VERSION 1.7.4
------------------------
o fixed a bug in MDSPlot()
o SARTools now depends on edgeR 3.34.0

CHANGES IN VERSION 1.7.3
------------------------
o added some parameters to change the ggplot theme
Expand Down
8 changes: 5 additions & 3 deletions R/MAPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ MAPlot <- function(complete, alpha=0.05, outfile=TRUE, log2FClim=NULL, ggplot_th
complete.name$outfield <- factor(ifelse(py > ymax, "top", ifelse(py < -ymax, "bottom", "in")),
levels=c("bottom", "in", "top"))
p[[name]] <- ggplot(data=complete.name,
aes(x=.data$baseMean, y=.data$log2FoldChange, color=.data$DE, fill=.data$DE, shape=.data$outfield)) +
aes(x=.data$baseMean, y=.data$log2FoldChange,
color=.data$DE, fill=.data$DE,
shape=.data$outfield)) +
scale_x_continuous(trans = log10_trans(),
breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(~10^.x))) +
geom_point(show.legend=FALSE, alpha=0.5, size=0.8) +
geom_point(show.legend=FALSE, alpha=0.5, size=1.8, stroke=0) +
scale_fill_manual(values=c("no"="black", "yes"="red"), drop=FALSE) +
scale_colour_manual(values=c("no"="black", "yes"="red"), drop=FALSE) +
scale_shape_manual(values=c("bottom"=25, "in"=21, "top"=24), drop=FALSE) +
scale_fill_manual(values=c("no"="black", "yes"="red"), drop=FALSE) +
scale_y_continuous(expand=expansion(mult=c(0.03, 0.03))) +
xlab("Mean of normalized counts") +
ylab(expression(log[2]~fold~change)) +
Expand Down
4 changes: 2 additions & 2 deletions R/MDSPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#' @return A file named MDS.png in the figures directory
#' @author Marie-Agnes Dillies and Hugo Varet

MDSPlot <- function(dge, group, n=min(500, nrow(dge$counts)), gene.selection=c("pairwise", "common", ggplot_theme=theme_gray()),
MDSPlot <- function(dge, group, n=min(500, nrow(dge$counts)), gene.selection=c("pairwise", "common"),
col=c("lightblue","orange","MediumVioletRed","SpringGreen"), outfile=TRUE, ggplot_theme=theme_gray()){
if (outfile) png(filename="figures/MDS.png", width=1800, height=1800, res=300)
coord <- plotMDS(dge, top=n, method="logFC", gene.selection=gene.selection[1], plot=FALSE)
d <- data.frame(x=coord$x, y=coord$y, group = group,
sample = factor(names(coord$x), levels = names(coord$x)))
factor(colnames(coord$distance.matrix.squared), levels = colnames(coord$distance.matrix.squared)))
print(ggplot(data=d, aes(x=.data$x, y=.data$y, color=group, label=sample)) +
geom_point(show.legend=TRUE, size=3) +
labs(color="") +
Expand Down
10 changes: 6 additions & 4 deletions R/dispersionsPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ dispersionsPlot <- function(dds, outfile=TRUE, ggplot_theme=theme_gray()){
disp <- mcols(dds)$dispGeneEst
disp <- disp[!is.na(disp)]
disp <- disp[disp>1e-8]
disp <- log(disp)
mean.disp <- mean(disp,na.rm=TRUE)
sd.disp <- sd(disp,na.rm=TRUE)
d <- data.frame(disp)
p2 <- ggplot(data=d, aes(x=.data$disp)) +
geom_histogram(bins=80, aes(y=.data$..density..)) +
scale_x_continuous(trans = log10_trans(),
breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format())) +
scale_y_continuous(expand=expansion(mult=c(0.01, 0.05))) +
xlab("Feature dispersion estimate") +
ylab("Density") +
ggtitle("log-normality dispersion diagnostic") +
stat_function(fun = dnorm, args = list(mean = mean.disp, sd = sd.disp)) +
stat_function(fun = function(x, ...){dnorm(log10(x), ...)},
args = list(mean = mean(log10(disp), na.rm=TRUE),
sd = sd(log10(disp), na.rm=TRUE))) +
ggplot_theme

grid.arrange(p1, p2, layout_matrix=matrix(c(1, 1, 1, 1, 1, 2, 2, 2, 2), nrow=1))
Expand Down
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 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
### November 28th, 2019
### designed to be executed with SARTools 1.7.3
### designed to be executed with SARTools 1.7.4
################################################################################

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion template_script_DESeq2_CL.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
### November 28th, 2019
### designed to be executed with SARTools 1.7.2
### designed to be executed with SARTools 1.7.4
### run "Rscript template_script_DESeq2_CL.r --help" to get some help
################################################################################

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
### November 28th, 2019
### designed to be executed with SARTools 1.7.3
### designed to be executed with SARTools 1.7.4
################################################################################

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion template_script_edgeR_CL.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
### November 28th, 2019
### designed to be executed with SARTools 1.7.2
### designed to be executed with SARTools 1.7.4
### run "Rscript template_script_edgeR_CL.r --help" to get some help
################################################################################

Expand Down

0 comments on commit 7c8fe50

Please sign in to comment.