\n")
+ for (i in 1:nrow(linkData)) {
+ if (grepl("glimma", linkData$Link[i])) {
+ HtmlLink(linkData$Link[i], linkData$Label[i])
+ }
+ }
+
cata("
Alt-click links to download file.
\n")
cata("
Click floppy disc icon associated history item to download ")
cata("all files.
\n")
diff -r 00a42b66e522 -r 4255881bebb1 limma_voom.xml
--- a/limma_voom.xml Tue May 15 02:36:36 2018 -0400
+++ b/limma_voom.xml Tue Jun 05 04:28:56 2018 -0400
@@ -1,4 +1,4 @@
-
+
Perform differential expression with limma-voom or limma-trend
@@ -11,10 +11,11 @@
r-rjsonr-getoptr-gplots
+ bioconductor-glimma /dev/null | grep -v -i "WARNING: ")", edgeR version" $(R --vanilla --slave -e "library(edgeR); cat(sessionInfo()\$otherPkgs\$edgeR\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", statmod version" $(R --vanilla --slave -e "library(statmod); cat(sessionInfo()\$otherPkgs\$statmod\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", scales version" $(R --vanilla --slave -e "library(scales); cat(sessionInfo()\$otherPkgs\$scales\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", rjson version" $(R --vanilla --slave -e "library(rjson); cat(sessionInfo()\$otherPkgs\$rjson\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", getopt version" $(R --vanilla --slave -e "library(getopt); cat(sessionInfo()\$otherPkgs\$getopt\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", gplots version" $(R --vanilla --slave -e "library(gplots); cat(sessionInfo()\$otherPkgs\$gplots\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
+echo $(R --version | grep version | grep -v GNU)", limma version" $(R --vanilla --slave -e "library(limma); cat(sessionInfo()\$otherPkgs\$limma\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", edgeR version" $(R --vanilla --slave -e "library(edgeR); cat(sessionInfo()\$otherPkgs\$edgeR\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", statmod version" $(R --vanilla --slave -e "library(statmod); cat(sessionInfo()\$otherPkgs\$statmod\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", scales version" $(R --vanilla --slave -e "library(scales); cat(sessionInfo()\$otherPkgs\$scales\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", rjson version" $(R --vanilla --slave -e "library(rjson); cat(sessionInfo()\$otherPkgs\$rjson\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", getopt version" $(R --vanilla --slave -e "library(getopt); cat(sessionInfo()\$otherPkgs\$getopt\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", gplots version" $(R --vanilla --slave -e "library(gplots); cat(sessionInfo()\$otherPkgs\$gplots\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", Glimma version" $(R --vanilla --slave -e "library(Glimma); cat(sessionInfo()\$otherPkgs\$Glimma\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
]]>
+ help="If you provide an annotation file, annotations will be added to the table(s) of differential expression results to provide descriptions for each gene, and used to label the top genes in the Volcano plot. An interactive Glimma MD plot and table will also be generated. See Help section below.">
@@ -397,7 +401,11 @@
-
+
@@ -601,7 +609,7 @@
**What it does**
-Given a matrix of counts (e.g. from featureCounts) and optional information about the genes, performs differential expression (DE) using the limma_ Bioconductor package and produces plots and tables useful in DE analysis.
+Given a matrix of counts (e.g. from featureCounts) and optional information about the genes, performs differential expression (DE) using the limma_ Bioconductor package and produces plots and tables useful in DE analysis. If an annotation file is provided, interactive Glimma_ plots and a table of differentially expressed genes will also be generated. See an example workflow here_.
In the `limma approach`_ to RNA-seq, read counts are converted to log2-counts-per-million (logCPM) and the mean-variance relationship is modelled either with precision weights or with an empirical Bayes prior trend. The precision weights approach is called “voom” and the prior trend approach is called “limma-trend”. For more information, see the Help section below.
@@ -647,7 +655,7 @@
**Gene Annotations:**
Optional input for gene annotations, this can contain more
information about the genes than just an ID number. The annotations will
-be available in the differential expression results table and the optional normalised counts table. The file must contain a header row and have the gene IDs in the first column. The second column will be used to label the genes in the Volcano plot instead of the default Gene IDs. The number of rows should match that of the counts files, add NA for any gene IDs with no annotation. The Galaxy tool **annotateMyIDs** can be used to obtain annotations for human, mouse, fly and zebrafish.
+be available in the differential expression results table and the optional normalised counts table. They will also be used to generate interactive Glimma_ MD plots and table of differential expression, a link to the Glimma plots will be provided in the report. The input annotation file must contain a header row and have the gene IDs in the first column. The second column will be used to label the genes in the Volcano plot and interactive Glimma plots, additional columns will be available in the Glimma interactive table. The number of rows should match that of the counts files, add NA for any gene IDs with no annotation. The Galaxy tool **annotateMyIDs** can be used to obtain annotations for human, mouse, fly and zebrafish.
Example:
@@ -783,6 +791,7 @@
* a table of differentially expressed genes for each contrast of interest
* a HTML report with plots and additional information
+ * an interactive Glimma MD plot and table (if annotation file provided)
Optionally, under **Output Options** you can choose to output
@@ -844,6 +853,8 @@
Please report problems or suggestions to: su.s@wehi.edu.au
.. _limma: http://www.bioconductor.org/packages/release/bioc/html/limma.html
+.. _Glimma: https://bioconductor.org/packages/release/bioc/html/Glimma.html
+.. _here: https://f1000research.com/articles/5-1408/v2
.. _limma approach: https://www.ncbi.nlm.nih.gov/pubmed/25605792
.. _limma User's Guide: http://bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf
.. _edgeR: http://www.bioconductor.org/packages/release/bioc/html/edgeR.html
diff -r 00a42b66e522 -r 4255881bebb1 test-data/out_rscript.txt
--- a/test-data/out_rscript.txt Tue May 15 02:36:36 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1211 +0,0 @@
-# This tool takes in a matrix of feature counts as well as gene annotations and
-# outputs a table of top expressions as well as various plots for differential
-# expression analysis
-#
-# ARGS: htmlPath", "R", 1, "character" -Path to html file linking to other outputs
-# outPath", "o", 1, "character" -Path to folder to write all output to
-# filesPath", "j", 2, "character" -JSON list object if multiple files input
-# matrixPath", "m", 2, "character" -Path to count matrix
-# factFile", "f", 2, "character" -Path to factor information file
-# factInput", "i", 2, "character" -String containing factors if manually input
-# annoPath", "a", 2, "character" -Path to input containing gene annotations
-# contrastData", "C", 1, "character" -String containing contrasts of interest
-# cpmReq", "c", 2, "double" -Float specifying cpm requirement
-# cntReq", "z", 2, "integer" -Integer specifying minimum total count requirement
-# sampleReq", "s", 2, "integer" -Integer specifying cpm requirement
-# normCounts", "x", 0, "logical" -String specifying if normalised counts should be output
-# rdaOpt", "r", 0, "logical" -String specifying if RData should be output
-# lfcReq", "l", 1, "double" -Float specifying the log-fold-change requirement
-# pValReq", "p", 1, "double" -Float specifying the p-value requirement
-# pAdjOpt", "d", 1, "character" -String specifying the p-value adjustment method
-# normOpt", "n", 1, "character" -String specifying type of normalisation used
-# robOpt", "b", 0, "logical" -String specifying if robust options should be used
-# trend", "t", 1, "double" -Float for prior.count if limma-trend is used instead of voom
-# weightOpt", "w", 0, "logical" -String specifying if voomWithQualityWeights should be used
-# topgenes", "G", 1, "integer" -Integer specifying no. of genes to highlight in volcano and heatmap
-# treatOpt", "T", 0, "logical" -String specifying if TREAT function should be used
-# plots, "P", 1, "character" -String specifying additional plots to be created
-#
-# OUT:
-# Density Plots (if filtering)
-# Box Plots (if normalising)
-# MDS Plot
-# Voom/SA plot
-# MD Plot
-# Volcano Plot
-# Heatmap
-# Expression Table
-# HTML file linking to the ouputs
-# Optional:
-# Normalised counts Table
-# RData file
-#
-#
-# Author: Shian Su - registertonysu@gmail.com - Jan 2014
-# Modified by: Maria Doyle - Jun 2017, Jan 2018, May 2018
-
-# Record starting time
-timeStart <- as.character(Sys.time())
-
-# Load all required libraries
-library(methods, quietly=TRUE, warn.conflicts=FALSE)
-library(statmod, quietly=TRUE, warn.conflicts=FALSE)
-library(splines, quietly=TRUE, warn.conflicts=FALSE)
-library(edgeR, quietly=TRUE, warn.conflicts=FALSE)
-library(limma, quietly=TRUE, warn.conflicts=FALSE)
-library(scales, quietly=TRUE, warn.conflicts=FALSE)
-library(getopt, quietly=TRUE, warn.conflicts=FALSE)
-library(gplots, quietly=TRUE, warn.conflicts=FALSE)
-
-################################################################################
-### Function Declaration
-################################################################################
-# Function to sanitise contrast equations so there are no whitespaces
-# surrounding the arithmetic operators, leading or trailing whitespace
-sanitiseEquation <- function(equation) {
- equation <- gsub(" *[+] *", "+", equation)
- equation <- gsub(" *[-] *", "-", equation)
- equation <- gsub(" *[/] *", "/", equation)
- equation <- gsub(" *[*] *", "*", equation)
- equation <- gsub("^\\s+|\\s+$", "", equation)
- return(equation)
-}
-
-# Function to sanitise group information
-sanitiseGroups <- function(string) {
- string <- gsub(" *[,] *", ",", string)
- string <- gsub("^\\s+|\\s+$", "", string)
- return(string)
-}
-
-# Function to change periods to whitespace in a string
-unmake.names <- function(string) {
- string <- gsub(".", " ", string, fixed=TRUE)
- return(string)
-}
-
-# Generate output folder and paths
-makeOut <- function(filename) {
- return(paste0(opt$outPath, "/", filename))
-}
-
-# Generating design information
-pasteListName <- function(string) {
- return(paste0("factors$", string))
-}
-
-# Create cata function: default path set, default seperator empty and appending
-# true by default (Ripped straight from the cat function with altered argument
-# defaults)
-cata <- function(..., file = opt$htmlPath, sep = "", fill = FALSE, labels = NULL,
- append = TRUE) {
- if (is.character(file))
- if (file == "")
- file <- stdout()
- else if (substring(file, 1L, 1L) == "|") {
- file <- pipe(substring(file, 2L), "w")
- on.exit(close(file))
- }
- else {
- file <- file(file, ifelse(append, "a", "w"))
- on.exit(close(file))
- }
- .Internal(cat(list(...), file, sep, fill, labels, append))
-}
-
-# Function to write code for html head and title
-HtmlHead <- function(title) {
- cata("\n")
- cata("", title, "\n")
- cata("\n")
-}
-
-# Function to write code for html links
-HtmlLink <- function(address, label=address) {
- cata("", label, " \n")
-}
-
-# Function to write code for html images
-HtmlImage <- function(source, label=source, height=500, width=500) {
- cata("\n")
-}
-
-# Function to write code for html list items
-ListItem <- function(...) {
- cata("
\n")
-cata("Links to PDF copies of plots are in 'Plots' section below \n")
-
-for (i in 1:nrow(imageData)) {
- if (grepl("density|box|mds|mdvol", imageData$Link[i])) {
- HtmlImage(imageData$Link[i], imageData$Label[i], width=1000)
- } else if (wantWeight) {
- HtmlImage(imageData$Link[i], imageData$Label[i], width=1000)
- } else {
- HtmlImage(imageData$Link[i], imageData$Label[i])
- }
-}
-
-cata("
Differential Expression Counts:
\n")
-
-cata("
\n")
-cata("
\n")
-TableItem()
-for (i in colnames(sigDiff)) {
- TableHeadItem(i)
-}
-cata("
\n")
-for (i in 1:nrow(sigDiff)) {
- cata("
\n")
- TableHeadItem(unmake.names(row.names(sigDiff)[i]))
- for (j in 1:ncol(sigDiff)) {
- TableItem(as.character(sigDiff[i, j]))
- }
- cata("
\n")
-}
-cata("
")
-
-cata("
Plots:
\n")
-#PDFs
-for (i in 1:nrow(linkData)) {
- if (grepl("density|cpm|boxplot|mds|mdplots|voomplot|saplot", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
-}
-
-for (i in 1:nrow(linkData)) {
- if (grepl("mdplot_", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
-}
-
-for (i in 1:nrow(linkData)) {
- if (grepl("volplot", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
-}
-
-for (i in 1:nrow(linkData)) {
- if (grepl("heatmap", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
-}
-
-for (i in 1:nrow(linkData)) {
- if (grepl("stripcharts", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
-}
-
-cata("
Tables:
\n")
-for (i in 1:nrow(linkData)) {
- if (grepl(".tsv", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
-}
-
-if (wantRda) {
- cata("
R Data Object:
\n")
- for (i in 1:nrow(linkData)) {
- if (grepl(".RData", linkData$Link[i])) {
- HtmlLink(linkData$Link[i], linkData$Label[i])
- }
- }
-}
-
-cata("
Alt-click links to download file.
\n")
-cata("
Click floppy disc icon associated history item to download ")
-cata("all files.
\n")
-cata("
.tsv files can be viewed in Excel or any spreadsheet program.
\n")
-
-cata("
Additional Information
\n")
-cata("
\n")
-
-if (filtCPM || filtSmpCount || filtTotCount) {
- if (filtCPM) {
- tempStr <- paste("Genes without more than", opt$cpmReq,
- "CPM in at least", opt$sampleReq, "samples are insignificant",
- "and filtered out.")
- } else if (filtSmpCount) {
- tempStr <- paste("Genes without more than", opt$cntReq,
- "counts in at least", opt$sampleReq, "samples are insignificant",
- "and filtered out.")
- } else if (filtTotCount) {
- tempStr <- paste("Genes without more than", opt$cntReq,
- "counts, after summing counts for all samples, are insignificant",
- "and filtered out.")
- }
-
- ListItem(tempStr)
- filterProp <- round(filteredCount/preFilterCount*100, digits=2)
- tempStr <- paste0(filteredCount, " of ", preFilterCount," (", filterProp,
- "%) genes were filtered out for low expression.")
- ListItem(tempStr)
-}
-ListItem(opt$normOpt, " was the method used to normalise library sizes.")
-if (wantTrend) {
- ListItem("The limma-trend method was used.")
-} else {
- ListItem("The limma-voom method was used.")
-}
-if (wantWeight) {
- ListItem("Weights were applied to samples.")
-} else {
- ListItem("Weights were not applied to samples.")
-}
-if (wantTreat) {
- ListItem(paste("Testing significance relative to a fold-change threshold (TREAT) was performed using a threshold of log2 =", opt$lfcReq, "at FDR of", opt$pValReq, "."))
-}
-if (wantRobust) {
- if (wantTreat) {
- ListItem("TREAT was used with robust settings (robust=TRUE).")
- } else {
- ListItem("eBayes was used with robust settings (robust=TRUE).")
- }
-}
-if (opt$pAdjOpt!="none") {
- if (opt$pAdjOpt=="BH" || opt$pAdjOpt=="BY") {
- tempStr <- paste0("MD Plot highlighted genes are significant at FDR ",
- "of ", opt$pValReq," and exhibit log2-fold-change of at ",
- "least ", opt$lfcReq, ".")
- ListItem(tempStr)
- } else if (opt$pAdjOpt=="holm") {
- tempStr <- paste0("MD Plot highlighted genes are significant at adjusted ",
- "p-value of ", opt$pValReq," by the Holm(1979) ",
- "method, and exhibit log2-fold-change of at least ",
- opt$lfcReq, ".")
- ListItem(tempStr)
- }
- } else {
- tempStr <- paste0("MD Plot highlighted genes are significant at p-value ",
- "of ", opt$pValReq," and exhibit log2-fold-change of at ",
- "least ", opt$lfcReq, ".")
- ListItem(tempStr)
-}
-cata("
\n")
-
-cata("
Summary of experimental data:
\n")
-
-cata("
*CHECK THAT SAMPLES ARE ASSOCIATED WITH CORRECT GROUP(S)*
\n")
-
-cata("
\n")
-cata("
\n")
-TableHeadItem("SampleID")
-TableHeadItem(names(factors)[1]," (Primary Factor)")
-
-if (ncol(factors) > 1) {
- for (i in names(factors)[2:length(names(factors))]) {
- TableHeadItem(i)
- }
- cata("
\n")
-}
-
-for (i in 1:nrow(factors)) {
- cata("
\n")
- TableHeadItem(row.names(factors)[i])
- for (j in 1:ncol(factors)) {
- TableItem(as.character(unmake.names(factors[i, j])))
- }
- cata("
\n")
-}
-cata("
")
-
-cit <- character()
-link <- character()
-link[1] <- paste0("", "limma User's Guide", ".")
-
-link[2] <- paste0("", "edgeR User's Guide", "")
-
-cit[1] <- paste("Please cite the following paper for this tool:")
-
-cit[2] <- paste("Liu R, Holik AZ, Su S, Jansz N, Chen K, Leong HS, Blewitt ME,",
- "Asselin-Labat ML, Smyth GK, Ritchie ME (2015). Why weight? ",
- "Modelling sample and observational level variability improves power ",
- "in RNA-seq analyses. Nucleic Acids Research, 43(15), e97.")
-
-cit[3] <- paste("Please cite the paper below for the limma software itself.",
- "Please also try to cite the appropriate methodology articles",
- "that describe the statistical methods implemented in limma,",
- "depending on which limma functions you are using. The",
- "methodology articles are listed in Section 2.1 of the",
- link[1],
- "Cite no. 3 only if sample weights were used.")
-cit[4] <- paste("Smyth GK (2005). Limma: linear models for microarray data.",
- "In: 'Bioinformatics and Computational Biology Solutions using",
- "R and Bioconductor'. R. Gentleman, V. Carey, S. doit,.",
- "Irizarry, W. Huber (eds), Springer, New York, pages 397-420.")
-cit[5] <- paste("Please cite the first paper for the software itself and the",
- "other papers for the various original statistical methods",
- "implemented in edgeR. See Section 1.2 in the", link[2],
- "for more detail.")
-cit[6] <- paste("Robinson MD, McCarthy DJ and Smyth GK (2010). edgeR: a",
- "Bioconductor package for differential expression analysis",
- "of digital gene expression data. Bioinformatics 26, 139-140")
-cit[7] <- paste("Robinson MD and Smyth GK (2007). Moderated statistical tests",
- "for assessing differences in tag abundance. Bioinformatics",
- "23, 2881-2887")
-cit[8] <- paste("Robinson MD and Smyth GK (2008). Small-sample estimation of",
- "negative binomial dispersion, with applications to SAGE data.",
- "Biostatistics, 9, 321-332")
-cit[9] <- paste("McCarthy DJ, Chen Y and Smyth GK (2012). Differential",
- "expression analysis of multifactor RNA-Seq experiments with",
- "respect to biological variation. Nucleic Acids Research 40,",
- "4288-4297")
-cit[10] <- paste("Law CW, Chen Y, Shi W, and Smyth GK (2014). Voom:",
- "precision weights unlock linear model analysis tools for",
- "RNA-seq read counts. Genome Biology 15, R29.")
-cit[11] <- paste("Ritchie ME, Diyagama D, Neilson J, van Laar R,",
- "Dobrovic A, Holloway A and Smyth GK (2006).",
- "Empirical array quality weights for microarray data.",
- "BMC Bioinformatics 7, Article 261.")
-cata("