From 12d6a08fdc5ea2e67a7ed39fae5895f50abf6cff Mon Sep 17 00:00:00 2001 From: hvaret Date: Tue, 24 Sep 2019 13:41:21 +0200 Subject: [PATCH 1/7] ggplot2VersionDependency --- DESCRIPTION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2b3e216..ec1ff49 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ Package: SARTools Type: Package Title: Statistical Analysis of RNA-Seq Tools -Version: 1.7.1 -Date: 2019-09-16 +Version: 1.7.2 +Date: 2019-09-24 Author: Marie-Agnes Dillies and Hugo Varet Maintainer: Hugo Varet Depends: R (>= 3.3.0), DESeq2 (>= 1.12.0), edgeR (>= 3.12.0), - ggplot2, + ggplot2 (>= 3.2.1), kableExtra Imports: genefilter (>= 1.44.0), GGally, From a74f4e7199f061e75ca6ee404594af6106c5be20 Mon Sep 17 00:00:00 2001 From: hvaret Date: Wed, 25 Sep 2019 16:21:23 +0200 Subject: [PATCH 2/7] hexbinDependency --- DESCRIPTION | 4 ++-- NEWS | 3 ++- R/pairwiseScatterPlots.R | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ec1ff49..c1179b8 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,13 +2,13 @@ Package: SARTools Type: Package Title: Statistical Analysis of RNA-Seq Tools Version: 1.7.2 -Date: 2019-09-24 +Date: 2019-09-25 Author: Marie-Agnes Dillies and Hugo Varet Maintainer: Hugo Varet Depends: R (>= 3.3.0), DESeq2 (>= 1.12.0), edgeR (>= 3.12.0), - ggplot2 (>= 3.2.1), + ggplot2, kableExtra Imports: genefilter (>= 1.44.0), GGally, diff --git a/NEWS b/NEWS index 793386c..afe6830 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ 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 ------------------------ diff --git a/R/pairwiseScatterPlots.R b/R/pairwiseScatterPlots.R index c500d0b..b2775c2 100755 --- a/R/pairwiseScatterPlots.R +++ b/R/pairwiseScatterPlots.R @@ -21,7 +21,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))) + From 80960c86fdb8d1e7b68d8166f21f6e65f550430d Mon Sep 17 00:00:00 2001 From: hvaret Date: Tue, 12 Nov 2019 14:54:16 +0100 Subject: [PATCH 3/7] vignetteConda --- DESCRIPTION | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c1179b8..fe0ef81 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: SARTools Type: Package Title: Statistical Analysis of RNA-Seq Tools Version: 1.7.2 -Date: 2019-09-25 +Date: 2019-11-12 Author: Marie-Agnes Dillies and Hugo Varet Maintainer: Hugo Varet Depends: R (>= 3.3.0), diff --git a/README.md b/README.md index 3971a5f..fe8e494 100755 --- a/README.md +++ b/README.md @@ -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. From 7c30f32ede33ba639ef8bce6b828a5ad48d9fc86 Mon Sep 17 00:00:00 2001 From: hvaret Date: Fri, 22 Nov 2019 11:50:17 +0100 Subject: [PATCH 4/7] order_levels --- DESCRIPTION | 4 ++-- NEWS | 4 ++++ R/diagSizeFactorsPlots.R | 2 +- R/dispersionsPlot.R | 12 ++++++------ R/loadTargetFile.R | 4 +++- R/run.DESeq2.r | 2 +- man/MDSPlot.Rd | 11 ++++++++--- man/PCAPlot.Rd | 8 ++++++-- man/barplotNull.Rd | 8 ++++++-- man/barplotTotal.Rd | 8 ++++++-- man/checkParameters.DESeq2.Rd | 21 ++++++++++++++++++--- man/checkParameters.edgeR.Rd | 19 ++++++++++++++++--- man/countsBoxplots.Rd | 8 ++++++-- man/densityPlot.Rd | 8 ++++++-- man/descriptionPlots.Rd | 7 +++++-- man/diagSizeFactorsPlots.Rd | 10 +++++++--- man/exploreCounts.Rd | 10 +++++++--- man/exportResults.edgeR.Rd | 3 +-- man/loadCountData.Rd | 10 +++++++--- man/majSequences.Rd | 9 +++++++-- man/run.DESeq2.Rd | 16 +++++++++++++--- man/run.edgeR.Rd | 13 +++++++++++-- man/summarizeResults.DESeq2.Rd | 13 ++++++++++--- man/summarizeResults.edgeR.Rd | 10 ++++++++-- man/writeReport.DESeq2.Rd | 28 ++++++++++++++++++++++++---- man/writeReport.edgeR.Rd | 26 ++++++++++++++++++++++---- 26 files changed, 211 insertions(+), 63 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fe0ef81..5d55484 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: SARTools Type: Package Title: Statistical Analysis of RNA-Seq Tools Version: 1.7.2 -Date: 2019-11-12 +Date: 2019-11-22 Author: Marie-Agnes Dillies and Hugo Varet Maintainer: Hugo Varet Depends: R (>= 3.3.0), @@ -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 diff --git a/NEWS b/NEWS index afe6830..236bc1a 100755 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +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) + CHANGES IN VERSION 1.7.1 ------------------------ o remove RGraphics dependency as it causes problems with conda diff --git a/R/diagSizeFactorsPlots.R b/R/diagSizeFactorsPlots.R index 484fe24..45307aa 100755 --- a/R/diagSizeFactorsPlots.R +++ b/R/diagSizeFactorsPlots.R @@ -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)) + diff --git a/R/dispersionsPlot.R b/R/dispersionsPlot.R index 8355860..52044e4 100755 --- a/R/dispersionsPlot.R +++ b/R/dispersionsPlot.R @@ -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(), @@ -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") diff --git a/R/loadTargetFile.R b/R/loadTargetFile.R index 65c7934..c21db82 100755 --- a/R/loadTargetFile.R +++ b/R/loadTargetFile.R @@ -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(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 diff --git a/R/run.DESeq2.r b/R/run.DESeq2.r index 3c1e826..5b8c8f6 100755 --- a/R/run.DESeq2.r +++ b/R/run.DESeq2.r @@ -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))) diff --git a/man/MDSPlot.Rd b/man/MDSPlot.Rd index 635fde4..6bc525a 100644 --- a/man/MDSPlot.Rd +++ b/man/MDSPlot.Rd @@ -4,9 +4,14 @@ \alias{MDSPlot} \title{MDS plot (for edgeR objects)} \usage{ -MDSPlot(dge, group, n = min(500, nrow(dge$counts)), - gene.selection = c("pairwise", "common"), col = c("lightblue", - "orange", "MediumVioletRed", "SpringGreen"), outfile = TRUE) +MDSPlot( + dge, + group, + n = min(500, nrow(dge$counts)), + gene.selection = c("pairwise", "common"), + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE +) } \arguments{ \item{dge}{a \code{DGEList} object} diff --git a/man/PCAPlot.Rd b/man/PCAPlot.Rd index dea93db..ed793ec 100644 --- a/man/PCAPlot.Rd +++ b/man/PCAPlot.Rd @@ -4,9 +4,13 @@ \alias{PCAPlot} \title{PCA of samples (if use of DESeq2)} \usage{ -PCAPlot(counts.trans, group, n = min(500, nrow(counts.trans)), +PCAPlot( + counts.trans, + group, + n = min(500, nrow(counts.trans)), col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), - outfile = TRUE) + outfile = TRUE +) } \arguments{ \item{counts.trans}{a matrix a transformed counts (VST- or rlog-counts)} diff --git a/man/barplotNull.Rd b/man/barplotNull.Rd index de7b39b..8fdfae2 100644 --- a/man/barplotNull.Rd +++ b/man/barplotNull.Rd @@ -4,8 +4,12 @@ \alias{barplotNull} \title{Percentage of null counts per sample} \usage{ -barplotNull(counts, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), outfile = TRUE) +barplotNull( + counts, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE +) } \arguments{ \item{counts}{\code{matrix} of counts} diff --git a/man/barplotTotal.Rd b/man/barplotTotal.Rd index 90fd04f..0475270 100644 --- a/man/barplotTotal.Rd +++ b/man/barplotTotal.Rd @@ -4,8 +4,12 @@ \alias{barplotTotal} \title{Total number of reads per sample} \usage{ -barplotTotal(counts, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), outfile = TRUE) +barplotTotal( + counts, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE +) } \arguments{ \item{counts}{\code{matrix} of counts} diff --git a/man/checkParameters.DESeq2.Rd b/man/checkParameters.DESeq2.Rd index eb0d7cd..4f37607 100644 --- a/man/checkParameters.DESeq2.Rd +++ b/man/checkParameters.DESeq2.Rd @@ -4,9 +4,24 @@ \alias{checkParameters.DESeq2} \title{Check the parameters (when using DESeq2)} \usage{ -checkParameters.DESeq2(projectName, author, targetFile, rawDir, - featuresToRemove, varInt, condRef, batch, fitType, cooksCutoff, - independentFiltering, alpha, pAdjustMethod, typeTrans, locfunc, colors) +checkParameters.DESeq2( + projectName, + author, + targetFile, + rawDir, + featuresToRemove, + varInt, + condRef, + batch, + fitType, + cooksCutoff, + independentFiltering, + alpha, + pAdjustMethod, + typeTrans, + locfunc, + colors +) } \arguments{ \item{projectName}{name of the project} diff --git a/man/checkParameters.edgeR.Rd b/man/checkParameters.edgeR.Rd index 38843e5..e7fcc80 100644 --- a/man/checkParameters.edgeR.Rd +++ b/man/checkParameters.edgeR.Rd @@ -4,9 +4,22 @@ \alias{checkParameters.edgeR} \title{Check the parameters (when using edgeR)} \usage{ -checkParameters.edgeR(projectName, author, targetFile, rawDir, - featuresToRemove, varInt, condRef, batch, alpha, pAdjustMethod, - cpmCutoff, gene.selection, normalizationMethod, colors) +checkParameters.edgeR( + projectName, + author, + targetFile, + rawDir, + featuresToRemove, + varInt, + condRef, + batch, + alpha, + pAdjustMethod, + cpmCutoff, + gene.selection, + normalizationMethod, + colors +) } \arguments{ \item{projectName}{name of the project} diff --git a/man/countsBoxplots.Rd b/man/countsBoxplots.Rd index 1f1d5e0..b6299a0 100644 --- a/man/countsBoxplots.Rd +++ b/man/countsBoxplots.Rd @@ -4,8 +4,12 @@ \alias{countsBoxplots} \title{Box-plots of (normalized) counts distribution per sample} \usage{ -countsBoxplots(object, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), outfile = TRUE) +countsBoxplots( + object, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE +) } \arguments{ \item{object}{a \code{DESeqDataSet} object from DESeq2 or a \code{DGEList} object from edgeR} diff --git a/man/densityPlot.Rd b/man/densityPlot.Rd index a988302..4bb5c13 100644 --- a/man/densityPlot.Rd +++ b/man/densityPlot.Rd @@ -4,8 +4,12 @@ \alias{densityPlot} \title{Density plot of all samples} \usage{ -densityPlot(counts, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), outfile = TRUE) +densityPlot( + counts, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE +) } \arguments{ \item{counts}{\code{matrix} of counts} diff --git a/man/descriptionPlots.Rd b/man/descriptionPlots.Rd index 308668e..347aaca 100644 --- a/man/descriptionPlots.Rd +++ b/man/descriptionPlots.Rd @@ -4,8 +4,11 @@ \alias{descriptionPlots} \title{Description plots of the counts} \usage{ -descriptionPlots(counts, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen")) +descriptionPlots( + counts, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen") +) } \arguments{ \item{counts}{\code{matrix} of counts} diff --git a/man/diagSizeFactorsPlots.Rd b/man/diagSizeFactorsPlots.Rd index 72060a8..0700d76 100644 --- a/man/diagSizeFactorsPlots.Rd +++ b/man/diagSizeFactorsPlots.Rd @@ -4,9 +4,13 @@ \alias{diagSizeFactorsPlots} \title{Assess the estimations of the size factors} \usage{ -diagSizeFactorsPlots(dds, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), outfile = TRUE, plots = c("diag", - "sf_libsize")) +diagSizeFactorsPlots( + dds, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE, + plots = c("diag", "sf_libsize") +) } \arguments{ \item{dds}{a \code{DESeqDataSet} object} diff --git a/man/exploreCounts.Rd b/man/exploreCounts.Rd index 0c66715..747314c 100644 --- a/man/exploreCounts.Rd +++ b/man/exploreCounts.Rd @@ -4,9 +4,13 @@ \alias{exploreCounts} \title{Explore counts structure} \usage{ -exploreCounts(object, group, typeTrans = "VST", - gene.selection = "pairwise", col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen")) +exploreCounts( + object, + group, + typeTrans = "VST", + gene.selection = "pairwise", + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen") +) } \arguments{ \item{object}{a \code{DESeqDataSet} from DESeq2 or \code{DGEList} object from edgeR} diff --git a/man/exportResults.edgeR.Rd b/man/exportResults.edgeR.Rd index 079041e..e7c1b2c 100644 --- a/man/exportResults.edgeR.Rd +++ b/man/exportResults.edgeR.Rd @@ -4,8 +4,7 @@ \alias{exportResults.edgeR} \title{Export results for edgeR analyses} \usage{ -exportResults.edgeR(out.edgeR, group, counts, alpha = 0.05, - export = TRUE) +exportResults.edgeR(out.edgeR, group, counts, alpha = 0.05, export = TRUE) } \arguments{ \item{out.edgeR}{the result of \code{run.edgeR()}} diff --git a/man/loadCountData.Rd b/man/loadCountData.Rd index 71194d4..c102a1a 100644 --- a/man/loadCountData.Rd +++ b/man/loadCountData.Rd @@ -4,9 +4,13 @@ \alias{loadCountData} \title{Load count files} \usage{ -loadCountData(target, rawDir = "raw", skip = 0, - featuresToRemove = c("alignment_not_unique", "ambiguous", "no_feature", - "not_aligned", "too_low_aQual")) +loadCountData( + target, + rawDir = "raw", + skip = 0, + featuresToRemove = c("alignment_not_unique", "ambiguous", "no_feature", "not_aligned", + "too_low_aQual") +) } \arguments{ \item{target}{target \code{data.frame} of the project returned by \code{loadTargetFile()}} diff --git a/man/majSequences.Rd b/man/majSequences.Rd index 4cc2f7a..5c01aa4 100644 --- a/man/majSequences.Rd +++ b/man/majSequences.Rd @@ -4,8 +4,13 @@ \alias{majSequences} \title{Most expressed sequences per sample} \usage{ -majSequences(counts, n = 3, group, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), outfile = TRUE) +majSequences( + counts, + n = 3, + group, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + outfile = TRUE +) } \arguments{ \item{counts}{\code{matrix} of counts} diff --git a/man/run.DESeq2.Rd b/man/run.DESeq2.Rd index 8378a51..b14de4d 100644 --- a/man/run.DESeq2.Rd +++ b/man/run.DESeq2.Rd @@ -4,9 +4,19 @@ \alias{run.DESeq2} \title{Wrapper to run DESeq2} \usage{ -run.DESeq2(counts, target, varInt, batch = NULL, locfunc = "median", - fitType = "parametric", pAdjustMethod = "BH", cooksCutoff = TRUE, - independentFiltering = TRUE, alpha = 0.05, ...) +run.DESeq2( + counts, + target, + varInt, + batch = NULL, + locfunc = "median", + fitType = "parametric", + pAdjustMethod = "BH", + cooksCutoff = TRUE, + independentFiltering = TRUE, + alpha = 0.05, + ... +) } \arguments{ \item{counts}{\code{matrix} of raw counts} diff --git a/man/run.edgeR.Rd b/man/run.edgeR.Rd index 4720544..e0ebbcb 100644 --- a/man/run.edgeR.Rd +++ b/man/run.edgeR.Rd @@ -4,8 +4,17 @@ \alias{run.edgeR} \title{Wrapper to run edgeR} \usage{ -run.edgeR(counts, target, varInt, condRef, batch = NULL, cpmCutoff = 1, - normalizationMethod = "TMM", pAdjustMethod = "BH", ...) +run.edgeR( + counts, + target, + varInt, + condRef, + batch = NULL, + cpmCutoff = 1, + normalizationMethod = "TMM", + pAdjustMethod = "BH", + ... +) } \arguments{ \item{counts}{\code{matrix} of counts} diff --git a/man/summarizeResults.DESeq2.Rd b/man/summarizeResults.DESeq2.Rd index b990d9b..9f6b031 100644 --- a/man/summarizeResults.DESeq2.Rd +++ b/man/summarizeResults.DESeq2.Rd @@ -4,9 +4,16 @@ \alias{summarizeResults.DESeq2} \title{Summarize DESeq2 analysis} \usage{ -summarizeResults.DESeq2(out.DESeq2, group, independentFiltering = TRUE, - cooksCutoff = TRUE, alpha = 0.05, col = c("lightblue", "orange", - "MediumVioletRed", "SpringGreen"), log2FClim = NULL, padjlim = NULL) +summarizeResults.DESeq2( + out.DESeq2, + group, + independentFiltering = TRUE, + cooksCutoff = TRUE, + alpha = 0.05, + col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), + log2FClim = NULL, + padjlim = NULL +) } \arguments{ \item{out.DESeq2}{the result of \code{run.DESeq2()}} diff --git a/man/summarizeResults.edgeR.Rd b/man/summarizeResults.edgeR.Rd index da61372..db02dad 100644 --- a/man/summarizeResults.edgeR.Rd +++ b/man/summarizeResults.edgeR.Rd @@ -4,9 +4,15 @@ \alias{summarizeResults.edgeR} \title{Summarize edgeR analysis} \usage{ -summarizeResults.edgeR(out.edgeR, group, counts, alpha = 0.05, +summarizeResults.edgeR( + out.edgeR, + group, + counts, + alpha = 0.05, col = c("lightblue", "orange", "MediumVioletRed", "SpringGreen"), - log2FClim = NULL, padjlim = NULL) + log2FClim = NULL, + padjlim = NULL +) } \arguments{ \item{out.edgeR}{the result of \code{run.edgeR()}} diff --git a/man/writeReport.DESeq2.Rd b/man/writeReport.DESeq2.Rd index 9d93517..e325332 100644 --- a/man/writeReport.DESeq2.Rd +++ b/man/writeReport.DESeq2.Rd @@ -4,10 +4,30 @@ \alias{writeReport.DESeq2} \title{Write HTML report for DESeq2 analyses} \usage{ -writeReport.DESeq2(target, counts, out.DESeq2, summaryResults, - majSequences, workDir, projectName, author, targetFile, rawDir, - featuresToRemove, varInt, condRef, batch, fitType, cooksCutoff, - independentFiltering, alpha, pAdjustMethod, typeTrans, locfunc, colors) +writeReport.DESeq2( + target, + counts, + out.DESeq2, + summaryResults, + majSequences, + workDir, + projectName, + author, + targetFile, + rawDir, + featuresToRemove, + varInt, + condRef, + batch, + fitType, + cooksCutoff, + independentFiltering, + alpha, + pAdjustMethod, + typeTrans, + locfunc, + colors +) } \arguments{ \item{target}{target \code{data.frame} of the project returned by \code{loadTargetFile()}} diff --git a/man/writeReport.edgeR.Rd b/man/writeReport.edgeR.Rd index 4d4a0c8..f127072 100644 --- a/man/writeReport.edgeR.Rd +++ b/man/writeReport.edgeR.Rd @@ -4,10 +4,28 @@ \alias{writeReport.edgeR} \title{Write HTML report for edgeR analyses} \usage{ -writeReport.edgeR(target, counts, out.edgeR, summaryResults, majSequences, - workDir, projectName, author, targetFile, rawDir, featuresToRemove, - varInt, condRef, batch, alpha, pAdjustMethod, cpmCutoff, colors, - gene.selection, normalizationMethod) +writeReport.edgeR( + target, + counts, + out.edgeR, + summaryResults, + majSequences, + workDir, + projectName, + author, + targetFile, + rawDir, + featuresToRemove, + varInt, + condRef, + batch, + alpha, + pAdjustMethod, + cpmCutoff, + colors, + gene.selection, + normalizationMethod +) } \arguments{ \item{target}{target \code{data.frame} of the project returned by \code{loadTargetFile()}} From 175c5ad935eeab45bbbae96bd7a2b0dfd20e3f74 Mon Sep 17 00:00:00 2001 From: hvaret Date: Fri, 22 Nov 2019 12:12:55 +0100 Subject: [PATCH 5/7] bugFixLoadTargetFile --- R/loadTargetFile.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/loadTargetFile.R b/R/loadTargetFile.R index c21db82..de8ba0b 100755 --- a/R/loadTargetFile.R +++ b/R/loadTargetFile.R @@ -16,7 +16,7 @@ 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")) - lev <- c(condRef, unique(target[,varInt])) + lev <- c(condRef, unique(as.character(target[,varInt]))) lev <- lev[!duplicated(lev)] target[,varInt] <- factor(target[,varInt], levels=lev) target <- target[order(target[,varInt]),] From d4aacf6db637f20e411666e35dde13a1370a756f Mon Sep 17 00:00:00 2001 From: hvaret Date: Thu, 28 Nov 2019 20:13:13 +0100 Subject: [PATCH 6/7] newColors --- DESCRIPTION | 2 +- NEWS | 1 + template_script_DESeq2.r | 10 ++++++---- template_script_DESeq2_CL.r | 6 +++--- template_script_edgeR.r | 10 ++++++---- template_script_edgeR_CL.r | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5d55484..f416d80 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: SARTools Type: Package Title: Statistical Analysis of RNA-Seq Tools Version: 1.7.2 -Date: 2019-11-22 +Date: 2019-11-28 Author: Marie-Agnes Dillies and Hugo Varet Maintainer: Hugo Varet Depends: R (>= 3.3.0), diff --git a/NEWS b/NEWS index 236bc1a..7282a31 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ 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 ------------------------ diff --git a/template_script_DESeq2.r b/template_script_DESeq2.r index e9b52ee..5a34b69 100755 --- a/template_script_DESeq2.r +++ b/template_script_DESeq2.r @@ -1,8 +1,8 @@ ################################################################################ ### R script to compare several conditions with the SARTools and DESeq2 packages ### Hugo Varet -### March 20th, 2018 -### designed to be executed with SARTools 1.7.0 +### November 28th, 2019 +### designed to be executed with SARTools 1.7.2 ################################################################################ ################################################################################ @@ -34,8 +34,10 @@ pAdjustMethod <- "BH" # p-value adjustment method typeTrans <- "VST" # transformation for PCA/clustering: "VST" or "rlog" locfunc <- "median" # "median" (default) or "shorth" to estimate the size factors -colors <- c("dodgerblue","firebrick1", # vector of colors of each biological condition on the plots - "MediumVioletRed","SpringGreen") +colors <- c("#f3c300", "#875692", "#f38400", # vector of colors of each biological condition on the plots + "#a1caf1", "#be0032", "#c2b280", + "#848482", "#008856", "#e68fac", + "#0067a5", "#f99379", "#604e97") forceCairoGraph <- FALSE diff --git a/template_script_DESeq2_CL.r b/template_script_DESeq2_CL.r index df5214d..bec5383 100755 --- a/template_script_DESeq2_CL.r +++ b/template_script_DESeq2_CL.r @@ -1,8 +1,8 @@ ################################################################################ ### R script to compare several conditions with the SARTools and DESeq2 packages ### Hugo Varet -### March 20th, 2018 -### designed to be executed with SARTools 1.7.0 +### November 28th, 2019 +### designed to be executed with SARTools 1.7.2 ### run "Rscript template_script_DESeq2_CL.r --help" to get some help ################################################################################ @@ -87,7 +87,7 @@ make_option(c("-l", "--locfunc"), help="median or shorth to estimate the size factors [default: %default]"), make_option(c("-C", "--colors"), - default="dodgerblue,firebrick1,MediumVioletRed,SpringGreen,chartreuse,cyan,darkorchid,darkorange", + default="#f3c300,#875692,#f38400,#a1caf1,#be0032,#c2b280,#848482,#008856,#e68fac,#0067a5", dest="cols", help="colors of each biological condition on the plots\n\t\t\"col1,col2,col3,col4\"\n\t\t[default: %default]"), diff --git a/template_script_edgeR.r b/template_script_edgeR.r index 8985d44..ef44c0e 100755 --- a/template_script_edgeR.r +++ b/template_script_edgeR.r @@ -1,8 +1,8 @@ ################################################################################ ### R script to compare several conditions with the SARTools and edgeR packages ### Hugo Varet -### March 20th, 2018 -### designed to be executed with SARTools 1.7.0 +### November 28th, 2019 +### designed to be executed with SARTools 1.7.2 ################################################################################ ################################################################################ @@ -32,8 +32,10 @@ cpmCutoff <- 1 # counts-per-million cut-of gene.selection <- "pairwise" # selection of the features in MDSPlot normalizationMethod <- "TMM" # normalization method: "TMM" (default), "RLE" (DESeq) or "upperquartile" -colors <- c("dodgerblue","firebrick1", # vector of colors of each biological condition on the plots - "MediumVioletRed","SpringGreen") +colors <- c("#f3c300", "#875692", "#f38400", # vector of colors of each biological condition on the plots + "#a1caf1", "#be0032", "#c2b280", + "#848482", "#008856", "#e68fac", + "#0067a5", "#f99379", "#604e97") forceCairoGraph <- FALSE diff --git a/template_script_edgeR_CL.r b/template_script_edgeR_CL.r index 552bb8c..64fad29 100755 --- a/template_script_edgeR_CL.r +++ b/template_script_edgeR_CL.r @@ -1,8 +1,8 @@ ################################################################################ ### R script to compare several conditions with the SARTools and edgeR packages ### Hugo Varet -### May 16th, 2018 -### designed to be executed with SARTools 1.7.0 +### November 28th, 2019 +### designed to be executed with SARTools 1.7.2 ### run "Rscript template_script_edgeR_CL.r --help" to get some help ################################################################################ @@ -77,7 +77,7 @@ make_option(c("-n", "--normalizationMethod"), help="normalization method in calcNormFactors: \"TMM\", \"RLE\" or \"upperquartile\" [default: %default]"), make_option(c("-C", "--colors"), - default="dodgerblue,firebrick1,MediumVioletRed,SpringGreen,chartreuse,cyan,darkorchid,darkorange", + default="#f3c300,#875692,#f38400,#a1caf1,#be0032,#c2b280,#848482,#008856,#e68fac,#0067a5", dest="cols", help="colors of each biological condition on the plots\n\t\t\"col1,col2,col3,col4\"\n\t\t[default: %default]"), From f519e13ff795596d9a96e85fcea935f4d4f29030 Mon Sep 17 00:00:00 2001 From: hvaret Date: Mon, 13 Jan 2020 13:28:36 +0100 Subject: [PATCH 7/7] group_pairwisescatterplot --- DESCRIPTION | 2 +- R/descriptionPlots.r | 2 +- R/pairwiseScatterPlots.R | 3 +-- man/pairwiseScatterPlots.Rd | 4 +--- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f416d80..b7463bd 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: SARTools Type: Package Title: Statistical Analysis of RNA-Seq Tools Version: 1.7.2 -Date: 2019-11-28 +Date: 2020-01-13 Author: Marie-Agnes Dillies and Hugo Varet Maintainer: Hugo Varet Depends: R (>= 3.3.0), diff --git a/R/descriptionPlots.r b/R/descriptionPlots.r index 017900b..4205cbc 100755 --- a/R/descriptionPlots.r +++ b/R/descriptionPlots.r @@ -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) } diff --git a/R/pairwiseScatterPlots.R b/R/pairwiseScatterPlots.R index b2775c2..5ac1060 100755 --- a/R/pairwiseScatterPlots.R +++ b/R/pairwiseScatterPlots.R @@ -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) diff --git a/man/pairwiseScatterPlots.Rd b/man/pairwiseScatterPlots.Rd index 62a4632..fa2a401 100644 --- a/man/pairwiseScatterPlots.Rd +++ b/man/pairwiseScatterPlots.Rd @@ -4,13 +4,11 @@ \alias{pairwiseScatterPlots} \title{Scatter plots for pairwise comparaisons of log counts} \usage{ -pairwiseScatterPlots(counts, group, outfile = TRUE) +pairwiseScatterPlots(counts, outfile = TRUE) } \arguments{ \item{counts}{\code{matrix} of raw counts} -\item{group}{factor vector of the condition from which each sample belongs} - \item{outfile}{TRUE to export the figure in a png file} } \value{