Skip to content

Commit

Permalink
Merge pull request #71 from PF2-pasteur-fr/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
hvaret committed Jan 13, 2020
2 parents bd3a165 + f519e13 commit d04b76c
Show file tree
Hide file tree
Showing 34 changed files with 238 additions and 87 deletions.
6 changes: 3 additions & 3 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.7.1
Date: 2019-09-16
Version: 1.7.2
Date: 2020-01-13
Author: Marie-Agnes Dillies and Hugo Varet
Maintainer: Hugo Varet <[email protected]>
Depends: R (>= 3.3.0),
Expand Down Expand Up @@ -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: 6.1.1
RoxygenNote: 7.0.0
8 changes: 7 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGES IN VERSION 1.7.2
------------------------
o the levels of the variable of interest are now ordered as they appear in the target file (after the reference level set as parameter)
o new default colors as some previous ones are not compatible with ggplot2

CHANGES IN VERSION 1.7.1
------------------------
o remove RGraphics dependency as it causes problems with conda
o remove RGraphics dependency as it causes problems with conda
o replaced stat_summary_hex() by stat_summary_2d() in pairwiseScatterPlots() as it required to install the hexbin package

CHANGES IN VERSION 1.7.0
------------------------
Expand Down
2 changes: 1 addition & 1 deletion R/descriptionPlots.r
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ descriptionPlots <- function(counts, group, col=c("lightblue","orange","MediumVi
# SERE and pairwise scatter plots
cat("Matrix of SERE statistics:\n")
print(tabSERE(counts))
pairwiseScatterPlots(counts=counts, group=group)
pairwiseScatterPlots(counts=counts)

return(majSequences)
}
2 changes: 1 addition & 1 deletion R/diagSizeFactorsPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ diagSizeFactorsPlots <- function(dds, group, col=c("lightblue","orange","MediumV

# total read counts vs size factors
if ("sf_libsize" %in% plots){
if (outfile) png(filename="figures/diagSizeFactorsTC.png", width=1900, height=1800, res=300)
if (outfile) png(filename="figures/diagSizeFactorsTC.png", width=2000, height=1800, res=300)
d <- data.frame(sf=sizeFactors(dds), libsize=colSums(counts(dds))/1e6,
group, sample=factor(colnames(dds), levels=colnames(dds)))
print(ggplot(data=d, aes(x=.data$sf, y=.data$libsize, color=.data$group, label=.data$sample)) +
Expand Down
12 changes: 6 additions & 6 deletions R/dispersionsPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ dispersionsPlot <- function(dds, outfile=TRUE){
d <- as.data.frame(mcols(dds)[,c("baseMean", "dispGeneEst", "dispFit", "dispersion")])
d <- d[which(d$baseMean > 0),]
d <- data.frame(baseMean=rep(d$baseMean, 3),
value=c(d$dispGeneEst, d$dispFit, d$dispersion),
variable=factor(rep(c("dispGeneEst", "dispFit", "dispersion"), each=nrow(d)),
levels=c("dispGeneEst", "dispFit", "dispersion")))
value=c(d$dispGeneEst, d$dispersion, d$dispFit),
variable=factor(rep(c("dispGeneEst", "dispersion", "dispFit"), each=nrow(d)),
levels=c("dispGeneEst", "dispersion", "dispFit")))
p1 <- ggplot(d, aes(x=.data$baseMean, y=.data$value, colour=.data$variable)) +
geom_point(size=0.1) +
scale_x_continuous(trans = log10_trans(),
Expand All @@ -28,9 +28,9 @@ dispersionsPlot <- function(dds, outfile=TRUE){
ylab("Dispersion") +
xlab("Mean of normalized counts") +
scale_colour_manual(
values=c("Black", "#e41a1c", "#377eb8"),
breaks=c("dispGeneEst", "dispFit", "dispersion"),
labels=c("Estimate", "Fit", "Final"),
values=c("Black", "#377eb8", "#e41a1c"),
breaks=c("dispGeneEst", "dispersion", "dispFit"),
labels=c("Estimate", "Final", "Fit"),
name="") +
guides(colour = guide_legend(override.aes = list(size=2))) +
ggtitle("Dispersions")
Expand Down
4 changes: 3 additions & 1 deletion R/loadTargetFile.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ loadTargetFile <- function(targetFile, varInt, condRef, batch){
if (!is.null(batch) && !I(batch %in% names(target))) stop(paste("The batch effect", batch, "is not in the target file"))
target[,varInt] <- as.factor(target[,varInt])
if (!I(condRef %in% as.character(target[,varInt]))) stop(paste("The reference level", condRef, "is not a level of the factor of interest"))
target[,varInt] <- relevel(target[,varInt],ref=condRef)
lev <- c(condRef, unique(as.character(target[,varInt])))
lev <- lev[!duplicated(lev)]
target[,varInt] <- factor(target[,varInt], levels=lev)
target <- target[order(target[,varInt]),]
rownames(target) <- as.character(target[,1])
# check if varInt contains replicates
Expand Down
5 changes: 2 additions & 3 deletions R/pairwiseScatterPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
#' Scatter plots for pairwise comparaisons of log counts
#'
#' @param counts \code{matrix} of raw counts
#' @param group factor vector of the condition from which each sample belongs
#' @param outfile TRUE to export the figure in a png file
#' @return A file named pairwiseScatter.png in the figures directory containing a pairwise scatter plot with the SERE statistics in the lower panel
#' @author Marie-Agnes Dillies and Hugo Varet

pairwiseScatterPlots <- function(counts, group, outfile=TRUE){
pairwiseScatterPlots <- function(counts, outfile=TRUE){
ncol <- ncol(counts)
if (ncol <= 12){
if (outfile) png(filename="figures/pairwiseScatter.png", width=cairoSizeWrapper(850*ncol), height=cairoSizeWrapper(700*ncol), res=300)
Expand All @@ -21,7 +20,7 @@ pairwiseScatterPlots <- function(counts, group, outfile=TRUE){
if (i==j) next
if (i > j){
p[[k]] <- ggplot(data=cbind(d, z=1), aes_string(x=names(d)[i], y=names(d)[j], z="z")) +
stat_summary_hex(fun=function(z) log(sum(z)), bins=50, show.legend=FALSE) +
stat_summary_2d(fun=function(z) log(sum(z)), bins=60, show.legend=FALSE) +
scale_x_continuous(trans = log10_trans(),
breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(~10^.x))) +
Expand Down
2 changes: 1 addition & 1 deletion R/run.DESeq2.r
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

run.DESeq2 <- function(counts, target, varInt, batch=NULL,
locfunc="median", fitType="parametric", pAdjustMethod="BH",
cooksCutoff=TRUE, 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 Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Note: if you want to set a dedicated conda environment for SARTools, use `conda
How to use SARTools?
--------------------

A HTML vignette is available within the vignettes folder on GitHub and provides extensive information on the use of SARTools. The user can also open it with `vignette("SARTools")` if it has been generated during the installation of the package.
A HTML vignette is available within the vignettes folder on GitHub and provides extensive information on the use of SARTools. The user can also open it with `vignette("SARTools")` if it has been generated during the installation of the package. Note that it is not available when SARTools has been installed using conda.

Be careful to use the R script associated with the version of SARTools installed on your system.

Expand Down
11 changes: 8 additions & 3 deletions man/MDSPlot.Rd

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

8 changes: 6 additions & 2 deletions man/PCAPlot.Rd

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

8 changes: 6 additions & 2 deletions man/barplotNull.Rd

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

8 changes: 6 additions & 2 deletions man/barplotTotal.Rd

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

21 changes: 18 additions & 3 deletions man/checkParameters.DESeq2.Rd

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

19 changes: 16 additions & 3 deletions man/checkParameters.edgeR.Rd

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

8 changes: 6 additions & 2 deletions man/countsBoxplots.Rd

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

8 changes: 6 additions & 2 deletions man/densityPlot.Rd

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

7 changes: 5 additions & 2 deletions man/descriptionPlots.Rd

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

10 changes: 7 additions & 3 deletions man/diagSizeFactorsPlots.Rd

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

10 changes: 7 additions & 3 deletions man/exploreCounts.Rd

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

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

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

10 changes: 7 additions & 3 deletions man/loadCountData.Rd

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

9 changes: 7 additions & 2 deletions man/majSequences.Rd

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

4 changes: 1 addition & 3 deletions man/pairwiseScatterPlots.Rd

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

Loading

0 comments on commit d04b76c

Please sign in to comment.