annotate limma_voom.R @ 4:a61a6e62e91f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
author iuc
date Sun, 29 Apr 2018 17:36:42 -0400
parents 38aab66ae5cb
children d8a55b5f0de0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
1 # This tool takes in a matrix of feature counts as well as gene annotations and
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
2 # outputs a table of top expressions as well as various plots for differential
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
3 # expression analysis
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
4 #
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
5 # ARGS: htmlPath", "R", 1, "character" -Path to html file linking to other outputs
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
6 # outPath", "o", 1, "character" -Path to folder to write all output to
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
7 # filesPath", "j", 2, "character" -JSON list object if multiple files input
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
8 # matrixPath", "m", 2, "character" -Path to count matrix
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
9 # factFile", "f", 2, "character" -Path to factor information file
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
10 # factInput", "i", 2, "character" -String containing factors if manually input
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
11 # annoPath", "a", 2, "character" -Path to input containing gene annotations
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
12 # contrastData", "C", 1, "character" -String containing contrasts of interest
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
13 # cpmReq", "c", 2, "double" -Float specifying cpm requirement
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
14 # cntReq", "z", 2, "integer" -Integer specifying minimum total count requirement
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
15 # sampleReq", "s", 2, "integer" -Integer specifying cpm requirement
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
16 # normCounts", "x", 0, "logical" -String specifying if normalised counts should be output
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
17 # rdaOpt", "r", 0, "logical" -String specifying if RData should be output
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
18 # lfcReq", "l", 1, "double" -Float specifying the log-fold-change requirement
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
19 # pValReq", "p", 1, "double" -Float specifying the p-value requirement
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
20 # pAdjOpt", "d", 1, "character" -String specifying the p-value adjustment method
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
21 # normOpt", "n", 1, "character" -String specifying type of normalisation used
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
22 # robOpt", "b", 0, "logical" -String specifying if robust options should be used
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
23 # trend", "t", 1, "double" -Float for prior.count if limma-trend is used instead of voom
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
24 # weightOpt", "w", 0, "logical" -String specifying if voomWithQualityWeights should be used
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
25 #
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
26 # OUT:
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
27 # MDS Plot
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
28 # Voom/SA plot
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
29 # MD Plot
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
30 # Expression Table
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
31 # HTML file linking to the ouputs
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
32 # Optional:
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
33 # Normalised counts Table
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
34 # RData file
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
35 #
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
36 #
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
37 # Author: Shian Su - registertonysu@gmail.com - Jan 2014
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
38 # Modified by: Maria Doyle - Jun 2017, Jan 2018
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
39
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
40 # Record starting time
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
41 timeStart <- as.character(Sys.time())
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
42
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
43 # Load all required libraries
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
44 library(methods, quietly=TRUE, warn.conflicts=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
45 library(statmod, quietly=TRUE, warn.conflicts=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
46 library(splines, quietly=TRUE, warn.conflicts=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
47 library(edgeR, quietly=TRUE, warn.conflicts=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
48 library(limma, quietly=TRUE, warn.conflicts=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
49 library(scales, quietly=TRUE, warn.conflicts=FALSE)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
50 library(getopt, quietly=TRUE, warn.conflicts=FALSE)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
51
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
52 if (packageVersion("limma") < "3.20.1") {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
53 stop("Please update 'limma' to version >= 3.20.1 to run this tool")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
54 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
55
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
56 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
57 ### Function Delcaration
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
58 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
59 # Function to sanitise contrast equations so there are no whitespaces
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
60 # surrounding the arithmetic operators, leading or trailing whitespace
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
61 sanitiseEquation <- function(equation) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
62 equation <- gsub(" *[+] *", "+", equation)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
63 equation <- gsub(" *[-] *", "-", equation)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
64 equation <- gsub(" *[/] *", "/", equation)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
65 equation <- gsub(" *[*] *", "*", equation)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
66 equation <- gsub("^\\s+|\\s+$", "", equation)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
67 return(equation)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
68 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
69
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
70 # Function to sanitise group information
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
71 sanitiseGroups <- function(string) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
72 string <- gsub(" *[,] *", ",", string)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
73 string <- gsub("^\\s+|\\s+$", "", string)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
74 return(string)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
75 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
76
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
77 # Function to change periods to whitespace in a string
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
78 unmake.names <- function(string) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
79 string <- gsub(".", " ", string, fixed=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
80 return(string)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
81 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
82
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
83 # Generate output folder and paths
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
84 makeOut <- function(filename) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
85 return(paste0(opt$outPath, "/", filename))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
86 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
87
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
88 # Generating design information
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
89 pasteListName <- function(string) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
90 return(paste0("factors$", string))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
91 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
92
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
93 # Create cata function: default path set, default seperator empty and appending
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
94 # true by default (Ripped straight from the cat function with altered argument
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
95 # defaults)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
96 cata <- function(..., file = opt$htmlPath, sep = "", fill = FALSE, labels = NULL,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
97 append = TRUE) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
98 if (is.character(file))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
99 if (file == "")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
100 file <- stdout()
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
101 else if (substring(file, 1L, 1L) == "|") {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
102 file <- pipe(substring(file, 2L), "w")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
103 on.exit(close(file))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
104 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
105 else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
106 file <- file(file, ifelse(append, "a", "w"))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
107 on.exit(close(file))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
108 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
109 .Internal(cat(list(...), file, sep, fill, labels, append))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
110 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
111
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
112 # Function to write code for html head and title
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
113 HtmlHead <- function(title) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
114 cata("<head>\n")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
115 cata("<title>", title, "</title>\n")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
116 cata("</head>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
117 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
118
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
119 # Function to write code for html links
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
120 HtmlLink <- function(address, label=address) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
121 cata("<a href=\"", address, "\" target=\"_blank\">", label, "</a><br />\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
122 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
123
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
124 # Function to write code for html images
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
125 HtmlImage <- function(source, label=source, height=600, width=600) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
126 cata("<img src=\"", source, "\" alt=\"", label, "\" height=\"", height)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
127 cata("\" width=\"", width, "\"/>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
128 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
129
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
130 # Function to write code for html list items
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
131 ListItem <- function(...) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
132 cata("<li>", ..., "</li>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
133 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
134
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
135 TableItem <- function(...) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
136 cata("<td>", ..., "</td>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
137 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
138
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
139 TableHeadItem <- function(...) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
140 cata("<th>", ..., "</th>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
141 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
142
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
143 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
144 ### Input Processing
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
145 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
146
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
147 # Collect arguments from command line
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
148 args <- commandArgs(trailingOnly=TRUE)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
149
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
150 # Get options, using the spec as defined by the enclosed list.
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
151 # Read the options from the default: commandArgs(TRUE).
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
152 spec <- matrix(c(
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
153 "htmlPath", "R", 1, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
154 "outPath", "o", 1, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
155 "filesPath", "j", 2, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
156 "matrixPath", "m", 2, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
157 "factFile", "f", 2, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
158 "factInput", "i", 2, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
159 "annoPath", "a", 2, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
160 "contrastData", "C", 1, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
161 "cpmReq", "c", 1, "double",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
162 "totReq", "y", 0, "logical",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
163 "cntReq", "z", 1, "integer",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
164 "sampleReq", "s", 1, "integer",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
165 "normCounts", "x", 0, "logical",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
166 "rdaOpt", "r", 0, "logical",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
167 "lfcReq", "l", 1, "double",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
168 "pValReq", "p", 1, "double",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
169 "pAdjOpt", "d", 1, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
170 "normOpt", "n", 1, "character",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
171 "robOpt", "b", 0, "logical",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
172 "trend", "t", 1, "double",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
173 "weightOpt", "w", 0, "logical"),
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
174 byrow=TRUE, ncol=4)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
175 opt <- getopt(spec)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
176
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
177
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
178 if (is.null(opt$matrixPath) & is.null(opt$filesPath)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
179 cat("A counts matrix (or a set of counts files) is required.\n")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
180 q(status=1)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
181 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
182
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
183 if (is.null(opt$cpmReq)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
184 filtCPM <- FALSE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
185 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
186 filtCPM <- TRUE
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
187 }
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
188
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
189 if (is.null(opt$cntReq) || is.null(opt$sampleReq)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
190 filtSmpCount <- FALSE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
191 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
192 filtSmpCount <- TRUE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
193 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
194
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
195 if (is.null(opt$totReq)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
196 filtTotCount <- FALSE
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
197 } else {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
198 filtTotCount <- TRUE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
199 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
200
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
201 if (is.null(opt$rdaOpt)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
202 wantRda <- FALSE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
203 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
204 wantRda <- TRUE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
205 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
206
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
207 if (is.null(opt$annoPath)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
208 haveAnno <- FALSE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
209 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
210 haveAnno <- TRUE
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
211 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
212
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
213 if (is.null(opt$normCounts)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
214 wantNorm <- FALSE
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
215 } else {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
216 wantNorm <- TRUE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
217 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
218
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
219 if (is.null(opt$robOpt)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
220 wantRobust <- FALSE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
221 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
222 wantRobust <- TRUE
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
223 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
224
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
225 if (is.null(opt$weightOpt)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
226 wantWeight <- FALSE
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
227 } else {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
228 wantWeight <- TRUE
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
229 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
230
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
231 if (is.null(opt$trend)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
232 wantTrend <- FALSE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
233 deMethod <- "limma-voom"
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
234 } else {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
235 wantTrend <- TRUE
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
236 deMethod <- "limma-trend"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
237 priorCount <- opt$trend
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
238 }
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
239
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
240
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
241 if (!is.null(opt$filesPath)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
242 # Process the separate count files (adapted from DESeq2 wrapper)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
243 library("rjson")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
244 parser <- newJSONParser()
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
245 parser$addData(opt$filesPath)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
246 factorList <- parser$getObject()
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
247 factors <- sapply(factorList, function(x) x[[1]])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
248 filenamesIn <- unname(unlist(factorList[[1]][[2]]))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
249 sampleTable <- data.frame(sample=basename(filenamesIn),
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
250 filename=filenamesIn,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
251 row.names=filenamesIn,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
252 stringsAsFactors=FALSE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
253 for (factor in factorList) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
254 factorName <- factor[[1]]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
255 sampleTable[[factorName]] <- character(nrow(sampleTable))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
256 lvls <- sapply(factor[[2]], function(x) names(x))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
257 for (i in seq_along(factor[[2]])) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
258 files <- factor[[2]][[i]][[1]]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
259 sampleTable[files,factorName] <- lvls[i]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
260 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
261 sampleTable[[factorName]] <- factor(sampleTable[[factorName]], levels=lvls)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
262 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
263 rownames(sampleTable) <- sampleTable$sample
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
264 rem <- c("sample","filename")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
265 factors <- sampleTable[, !(names(sampleTable) %in% rem), drop=FALSE]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
266
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
267 #read in count files and create single table
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
268 countfiles <- lapply(sampleTable$filename, function(x){read.delim(x, row.names=1)})
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
269 counts <- do.call("cbind", countfiles)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
270
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
271 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
272 # Process the single count matrix
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
273 counts <- read.table(opt$matrixPath, header=TRUE, sep="\t", stringsAsFactors=FALSE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
274 row.names(counts) <- counts[, 1]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
275 counts <- counts[ , -1]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
276 countsRows <- nrow(counts)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
277
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
278 # Process factors
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
279 if (is.null(opt$factInput)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
280 factorData <- read.table(opt$factFile, header=TRUE, sep="\t")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
281 factors <- factorData[, -1, drop=FALSE]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
282 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
283 factors <- unlist(strsplit(opt$factInput, "|", fixed=TRUE))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
284 factorData <- list()
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
285 for (fact in factors) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
286 newFact <- unlist(strsplit(fact, split="::"))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
287 factorData <- rbind(factorData, newFact)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
288 } # Factors have the form: FACT_NAME::LEVEL,LEVEL,LEVEL,LEVEL,... The first factor is the Primary Factor.
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
289
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
290 # Set the row names to be the name of the factor and delete first row
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
291 row.names(factorData) <- factorData[, 1]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
292 factorData <- factorData[, -1]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
293 factorData <- sapply(factorData, sanitiseGroups)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
294 factorData <- sapply(factorData, strsplit, split=",")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
295 factorData <- sapply(factorData, make.names)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
296 # Transform factor data into data frame of R factor objects
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
297 factors <- data.frame(factorData)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
298 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
299 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
300
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
301 # if annotation file provided
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
302 if (haveAnno) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
303 geneanno <- read.table(opt$annoPath, header=TRUE, sep="\t", stringsAsFactors=FALSE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
304 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
305
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
306 #Create output directory
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
307 dir.create(opt$outPath, showWarnings=FALSE)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
308
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
309 # Split up contrasts seperated by comma into a vector then sanitise
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
310 contrastData <- unlist(strsplit(opt$contrastData, split=","))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
311 contrastData <- sanitiseEquation(contrastData)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
312 contrastData <- gsub(" ", ".", contrastData, fixed=TRUE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
313
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
314
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
315 mdsOutPdf <- makeOut("mdsplot_nonorm.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
316 mdsOutPng <- makeOut("mdsplot_nonorm.png")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
317 nmdsOutPdf <- makeOut("mdsplot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
318 nmdsOutPng <- makeOut("mdsplot.png")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
319 maOutPdf <- character() # Initialise character vector
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
320 maOutPng <- character()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
321 topOut <- character()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
322 for (i in 1:length(contrastData)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
323 maOutPdf[i] <- makeOut(paste0("maplot_", contrastData[i], ".pdf"))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
324 maOutPng[i] <- makeOut(paste0("maplot_", contrastData[i], ".png"))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
325 topOut[i] <- makeOut(paste0(deMethod, "_", contrastData[i], ".tsv"))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
326 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
327 normOut <- makeOut(paste0(deMethod, "_normcounts.tsv"))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
328 rdaOut <- makeOut(paste0(deMethod, "_analysis.RData"))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
329 sessionOut <- makeOut("session_info.txt")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
330
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
331 # Initialise data for html links and images, data frame with columns Label and
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
332 # Link
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
333 linkData <- data.frame(Label=character(), Link=character(),
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
334 stringsAsFactors=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
335 imageData <- data.frame(Label=character(), Link=character(),
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
336 stringsAsFactors=FALSE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
337
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
338 # Initialise vectors for storage of up/down/neutral regulated counts
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
339 upCount <- numeric()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
340 downCount <- numeric()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
341 flatCount <- numeric()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
342
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
343 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
344 ### Data Processing
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
345 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
346
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
347 # Extract counts and annotation data
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
348 print("Extracting counts")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
349 data <- list()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
350 data$counts <- counts
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
351 if (haveAnno) {
4
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
352 # order annotation by genes in counts (assumes gene ids are in 1st column of geneanno)
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
353 annoord <- geneanno[match(row.names(counts), geneanno[,1]), ]
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
354 data$genes <- annoord
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
355 } else {
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
356 data$genes <- data.frame(GeneID=row.names(counts))
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
357 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
358
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
359 # If filter crieteria set, filter out genes that do not have a required cpm/counts in a required number of
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
360 # samples. Default is no filtering
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
361 preFilterCount <- nrow(data$counts)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
362
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
363 if (filtCPM || filtSmpCount || filtTotCount) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
364
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
365 if (filtTotCount) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
366 keep <- rowSums(data$counts) >= opt$cntReq
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
367 } else if (filtSmpCount) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
368 keep <- rowSums(data$counts >= opt$cntReq) >= opt$sampleReq
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
369 } else if (filtCPM) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
370 keep <- rowSums(cpm(data$counts) >= opt$cpmReq) >= opt$sampleReq
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
371 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
372
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
373 data$counts <- data$counts[keep, ]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
374 data$genes <- data$genes[keep, , drop=FALSE]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
375 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
376
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
377 postFilterCount <- nrow(data$counts)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
378 filteredCount <- preFilterCount-postFilterCount
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
379
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
380 # Creating naming data
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
381 samplenames <- colnames(data$counts)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
382 sampleanno <- data.frame("sampleID"=samplenames, factors)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
383
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
384
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
385 # Generating the DGEList object "data"
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
386 print("Generating DGEList object")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
387 data$samples <- sampleanno
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
388 data$samples$lib.size <- colSums(data$counts)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
389 data$samples$norm.factors <- 1
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
390 row.names(data$samples) <- colnames(data$counts)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
391 data <- new("DGEList", data)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
392
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
393 print("Generating Design")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
394 # Name rows of factors according to their sample
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
395 row.names(factors) <- names(data$counts)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
396 factorList <- sapply(names(factors), pasteListName)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
397 formula <- "~0"
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
398 for (i in 1:length(factorList)) {
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
399 formula <- paste(formula,factorList[i], sep="+")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
400 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
401 formula <- formula(formula)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
402 design <- model.matrix(formula)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
403 for (i in 1:length(factorList)) {
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
404 colnames(design) <- gsub(factorList[i], "", colnames(design), fixed=TRUE)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
405 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
406
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
407 # Calculating normalising factors
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
408 print("Calculating Normalisation Factors")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
409 data <- calcNormFactors(data, method=opt$normOpt)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
410
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
411 # Generate contrasts information
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
412 print("Generating Contrasts")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
413 contrasts <- makeContrasts(contrasts=contrastData, levels=design)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
414
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
415 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
416 ### Data Output
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
417 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
418 # Plot MDS
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
419 print("Generating MDS plot")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
420 labels <- names(counts)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
421 png(mdsOutPng, width=600, height=600)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
422 # Currently only using a single factor
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
423 plotMDS(data, labels=labels, col=as.numeric(factors[, 1]), cex=0.8, main="MDS Plot (unnormalised)")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
424 imageData[1, ] <- c("MDS Plot (unnormalised)", "mdsplot_nonorm.png")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
425 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
426
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
427 pdf(mdsOutPdf)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
428 plotMDS(data, labels=labels, cex=0.5)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
429 linkData[1, ] <- c("MDS Plot (unnormalised).pdf", "mdsplot_nonorm.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
430 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
431
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
432 if (wantTrend) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
433 # limma-trend approach
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
434 logCPM <- cpm(data, log=TRUE, prior.count=opt$trend)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
435 fit <- lmFit(logCPM, design)
4
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
436 fit$genes <- data$genes
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
437 fit <- contrasts.fit(fit, contrasts)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
438 if (wantRobust) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
439 fit <- eBayes(fit, trend=TRUE, robust=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
440 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
441 fit <- eBayes(fit, trend=TRUE, robust=FALSE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
442 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
443 # plot fit with plotSA
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
444 saOutPng <- makeOut("saplot.png")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
445 saOutPdf <- makeOut("saplot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
446
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
447 png(saOutPng, width=600, height=600)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
448 plotSA(fit, main="SA Plot")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
449 imgName <- "SA Plot.png"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
450 imgAddr <- "saplot.png"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
451 imageData <- rbind(imageData, c(imgName, imgAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
452 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
453
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
454 pdf(saOutPdf, width=14)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
455 plotSA(fit, main="SA Plot")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
456 linkName <- paste0("SA Plot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
457 linkAddr <- paste0("saplot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
458 linkData <- rbind(linkData, c(linkName, linkAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
459 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
460
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
461 plotData <- logCPM
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
462
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
463 # Save normalised counts (log2cpm)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
464 if (wantNorm) {
4
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
465 write.table(logCPM, file=normOut, row.names=TRUE, sep="\t", quote=FALSE)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
466 linkData <- rbind(linkData, c((paste0(deMethod, "_", "normcounts.tsv")), (paste0(deMethod, "_", "normcounts.tsv"))))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
467 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
468 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
469 # limma-voom approach
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
470 voomOutPdf <- makeOut("voomplot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
471 voomOutPng <- makeOut("voomplot.png")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
472
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
473 if (wantWeight) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
474 # Creating voom data object and plot
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
475 png(voomOutPng, width=1000, height=600)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
476 vData <- voomWithQualityWeights(data, design=design, plot=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
477 imgName <- "Voom Plot.png"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
478 imgAddr <- "voomplot.png"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
479 imageData <- rbind(imageData, c(imgName, imgAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
480 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
481
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
482 pdf(voomOutPdf, width=14)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
483 vData <- voomWithQualityWeights(data, design=design, plot=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
484 linkName <- paste0("Voom Plot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
485 linkAddr <- paste0("voomplot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
486 linkData <- rbind(linkData, c(linkName, linkAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
487 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
488
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
489 # Generating fit data and top table with weights
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
490 wts <- vData$weights
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
491 voomFit <- lmFit(vData, design, weights=wts)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
492
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
493 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
494 # Creating voom data object and plot
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
495 png(voomOutPng, width=600, height=600)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
496 vData <- voom(data, design=design, plot=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
497 imgName <- "Voom Plot"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
498 imgAddr <- "voomplot.png"
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
499 imageData <- rbind(imageData, c(imgName, imgAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
500 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
501
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
502 pdf(voomOutPdf)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
503 vData <- voom(data, design=design, plot=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
504 linkName <- paste0("Voom Plot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
505 linkAddr <- paste0("voomplot.pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
506 linkData <- rbind(linkData, c(linkName, linkAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
507 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
508
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
509 # Generate voom fit
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
510 voomFit <- lmFit(vData, design)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
511 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
512
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
513 # Save normalised counts (log2cpm)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
514 if (wantNorm) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
515 norm_counts <- data.frame(vData$genes, vData$E)
4
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
516 write.table(norm_counts, file=normOut, row.names=FALSE, sep="\t", quote=FALSE)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
517 linkData <- rbind(linkData, c((paste0(deMethod, "_", "normcounts.tsv")), (paste0(deMethod, "_", "normcounts.tsv"))))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
518 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
519
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
520 # Fit linear model and estimate dispersion with eBayes
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
521 voomFit <- contrasts.fit(voomFit, contrasts)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
522 if (wantRobust) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
523 fit <- eBayes(voomFit, robust=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
524 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
525 fit <- eBayes(voomFit, robust=FALSE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
526 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
527 plotData <- vData
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
528 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
529
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
530 print("Generating normalised MDS plot")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
531 png(nmdsOutPng, width=600, height=600)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
532 # Currently only using a single factor
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
533 plotMDS(plotData, labels=labels, col=as.numeric(factors[, 1]), cex=0.8, main="MDS Plot (normalised)")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
534 imgName <- "MDS Plot (normalised)"
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
535 imgAddr <- "mdsplot.png"
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
536 imageData <- rbind(imageData, c(imgName, imgAddr))
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
537 invisible(dev.off())
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
538
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
539 pdf(nmdsOutPdf)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
540 plotMDS(plotData, labels=labels, cex=0.5)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
541 linkName <- paste0("MDS Plot (normalised).pdf")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
542 linkAddr <- paste0("mdsplot.pdf")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
543 linkData <- rbind(linkData, c(linkName, linkAddr))
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
544 invisible(dev.off())
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
545
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
546
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
547 print("Generating DE results")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
548 status = decideTests(fit, adjust.method=opt$pAdjOpt, p.value=opt$pValReq,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
549 lfc=opt$lfcReq)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
550 sumStatus <- summary(status)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
551
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
552 for (i in 1:length(contrastData)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
553 # Collect counts for differential expression
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
554 upCount[i] <- sumStatus["Up", i]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
555 downCount[i] <- sumStatus["Down", i]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
556 flatCount[i] <- sumStatus["NotSig", i]
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
557
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
558 # Write top expressions table
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
559 top <- topTable(fit, coef=i, number=Inf, sort.by="P")
4
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
560 write.table(top, file=topOut[i], row.names=FALSE, sep="\t", quote=FALSE)
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
561
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
562 linkName <- paste0(deMethod, "_", contrastData[i], ".tsv")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
563 linkAddr <- paste0(deMethod, "_", contrastData[i], ".tsv")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
564 linkData <- rbind(linkData, c(linkName, linkAddr))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
565
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
566 # Plot MA (log ratios vs mean average) using limma package on weighted
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
567 pdf(maOutPdf[i])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
568 limma::plotMD(fit, status=status, coef=i,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
569 main=paste("MA Plot:", unmake.names(contrastData[i])),
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
570 col=alpha(c("firebrick", "blue"), 0.4), values=c("1", "-1"),
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
571 xlab="Average Expression", ylab="logFC")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
572
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
573 abline(h=0, col="grey", lty=2)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
574
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
575 linkName <- paste0("MA Plot_", contrastData[i], " (.pdf)")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
576 linkAddr <- paste0("maplot_", contrastData[i], ".pdf")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
577 linkData <- rbind(linkData, c(linkName, linkAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
578 invisible(dev.off())
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
579
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
580 png(maOutPng[i], height=600, width=600)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
581 limma::plotMD(fit, status=status, coef=i,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
582 main=paste("MA Plot:", unmake.names(contrastData[i])),
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
583 col=alpha(c("firebrick", "blue"), 0.4), values=c("1", "-1"),
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
584 xlab="Average Expression", ylab="logFC")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
585
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
586 abline(h=0, col="grey", lty=2)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
587
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
588 imgName <- paste0("MA Plot_", contrastData[i])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
589 imgAddr <- paste0("maplot_", contrastData[i], ".png")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
590 imageData <- rbind(imageData, c(imgName, imgAddr))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
591 invisible(dev.off())
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
592 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
593 sigDiff <- data.frame(Up=upCount, Flat=flatCount, Down=downCount)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
594 row.names(sigDiff) <- contrastData
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
595
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
596 # Save relevant items as rda object
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
597 if (wantRda) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
598 print("Saving RData")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
599 if (wantWeight) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
600 save(data, status, plotData, labels, factors, wts, fit, top, contrasts,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
601 design,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
602 file=rdaOut, ascii=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
603 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
604 save(data, status, plotData, labels, factors, fit, top, contrasts, design,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
605 file=rdaOut, ascii=TRUE)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
606 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
607 linkData <- rbind(linkData, c((paste0(deMethod, "_analysis.RData")), (paste0(deMethod, "_analysis.RData"))))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
608 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
609
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
610 # Record session info
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
611 writeLines(capture.output(sessionInfo()), sessionOut)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
612 linkData <- rbind(linkData, c("Session Info", "session_info.txt"))
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
613
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
614 # Record ending time and calculate total run time
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
615 timeEnd <- as.character(Sys.time())
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
616 timeTaken <- capture.output(round(difftime(timeEnd,timeStart), digits=3))
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
617 timeTaken <- gsub("Time difference of ", "", timeTaken, fixed=TRUE)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
618 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
619 ### HTML Generation
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
620 ################################################################################
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
621
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
622 # Clear file
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
623 cat("", file=opt$htmlPath)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
624
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
625 cata("<html>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
626
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
627 cata("<body>\n")
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
628 cata("<h3>Limma Analysis Output:</h3>\n")
4
a61a6e62e91f planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 6a458881c0819b75e55e64b3f494679d43bb9ee8
iuc
parents: 3
diff changeset
629 cata("Links to PDF copies of plots are in 'Plots' section below />\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
630 if (wantWeight) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
631 HtmlImage(imageData$Link[1], imageData$Label[1], width=1000)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
632 } else {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
633 HtmlImage(imageData$Link[1], imageData$Label[1])
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
634 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
635
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
636 for (i in 2:nrow(imageData)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
637 HtmlImage(imageData$Link[i], imageData$Label[i])
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
638 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
639
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
640 cata("<h4>Differential Expression Counts:</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
641
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
642 cata("<table border=\"1\" cellpadding=\"4\">\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
643 cata("<tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
644 TableItem()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
645 for (i in colnames(sigDiff)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
646 TableHeadItem(i)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
647 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
648 cata("</tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
649 for (i in 1:nrow(sigDiff)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
650 cata("<tr>\n")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
651 TableHeadItem(unmake.names(row.names(sigDiff)[i]))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
652 for (j in 1:ncol(sigDiff)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
653 TableItem(as.character(sigDiff[i, j]))
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
654 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
655 cata("</tr>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
656 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
657 cata("</table>")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
658
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
659 cata("<h4>Plots:</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
660 for (i in 1:nrow(linkData)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
661 if (grepl(".pdf", linkData$Link[i])) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
662 HtmlLink(linkData$Link[i], linkData$Label[i])
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
663 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
664 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
665
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
666 cata("<h4>Tables:</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
667 for (i in 1:nrow(linkData)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
668 if (grepl(".tsv", linkData$Link[i])) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
669 HtmlLink(linkData$Link[i], linkData$Label[i])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
670 }
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
671 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
672
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
673 if (wantRda) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
674 cata("<h4>R Data Object:</h4>\n")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
675 for (i in 1:nrow(linkData)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
676 if (grepl(".RData", linkData$Link[i])) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
677 HtmlLink(linkData$Link[i], linkData$Label[i])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
678 }
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
679 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
680 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
681
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
682 cata("<p>Alt-click links to download file.</p>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
683 cata("<p>Click floppy disc icon associated history item to download ")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
684 cata("all files.</p>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
685 cata("<p>.tsv files can be viewed in Excel or any spreadsheet program.</p>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
686
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
687 cata("<h4>Additional Information</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
688 cata("<ul>\n")
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
689
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
690 if (filtCPM || filtSmpCount || filtTotCount) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
691 if (filtCPM) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
692 tempStr <- paste("Genes without more than", opt$cmpReq,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
693 "CPM in at least", opt$sampleReq, "samples are insignificant",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
694 "and filtered out.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
695 } else if (filtSmpCount) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
696 tempStr <- paste("Genes without more than", opt$cntReq,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
697 "counts in at least", opt$sampleReq, "samples are insignificant",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
698 "and filtered out.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
699 } else if (filtTotCount) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
700 tempStr <- paste("Genes without more than", opt$cntReq,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
701 "counts, after summing counts for all samples, are insignificant",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
702 "and filtered out.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
703 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
704
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
705 ListItem(tempStr)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
706 filterProp <- round(filteredCount/preFilterCount*100, digits=2)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
707 tempStr <- paste0(filteredCount, " of ", preFilterCount," (", filterProp,
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
708 "%) genes were filtered out for low expression.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
709 ListItem(tempStr)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
710 }
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
711 ListItem(opt$normOpt, " was the method used to normalise library sizes.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
712 if (wantTrend) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
713 ListItem("The limma-trend method was used.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
714 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
715 ListItem("The limma-voom method was used.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
716 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
717 if (wantWeight) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
718 ListItem("Weights were applied to samples.")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
719 } else {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
720 ListItem("Weights were not applied to samples.")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
721 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
722 if (wantRobust) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
723 ListItem("eBayes was used with robust settings (robust=TRUE).")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
724 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
725 if (opt$pAdjOpt!="none") {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
726 if (opt$pAdjOpt=="BH" || opt$pAdjOpt=="BY") {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
727 tempStr <- paste0("MA-Plot highlighted genes are significant at FDR ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
728 "of ", opt$pValReq," and exhibit log2-fold-change of at ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
729 "least ", opt$lfcReq, ".")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
730 ListItem(tempStr)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
731 } else if (opt$pAdjOpt=="holm") {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
732 tempStr <- paste0("MA-Plot highlighted genes are significant at adjusted ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
733 "p-value of ", opt$pValReq," by the Holm(1979) ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
734 "method, and exhibit log2-fold-change of at least ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
735 opt$lfcReq, ".")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
736 ListItem(tempStr)
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
737 }
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
738 } else {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
739 tempStr <- paste0("MA-Plot highlighted genes are significant at p-value ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
740 "of ", opt$pValReq," and exhibit log2-fold-change of at ",
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
741 "least ", opt$lfcReq, ".")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
742 ListItem(tempStr)
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
743 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
744 cata("</ul>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
745
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
746 cata("<h4>Summary of experimental data:</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
747
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
748 cata("<p>*CHECK THAT SAMPLES ARE ASSOCIATED WITH CORRECT GROUP(S)*</p>\n")
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
749
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
750 cata("<table border=\"1\" cellpadding=\"3\">\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
751 cata("<tr>\n")
1
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
752 TableHeadItem("SampleID")
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
753 TableHeadItem(names(factors)[1]," (Primary Factor)")
76d01fe0ec36 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 58c05c0ce9334f8b9c800283cfd1f40573546edd
iuc
parents: 0
diff changeset
754
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
755 if (ncol(factors) > 1) {
2
a330ddf43861 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 346319bd01bfd51f02d656e653a93f0bd1e954aa
iuc
parents: 1
diff changeset
756 for (i in names(factors)[2:length(names(factors))]) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
757 TableHeadItem(i)
2
a330ddf43861 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 346319bd01bfd51f02d656e653a93f0bd1e954aa
iuc
parents: 1
diff changeset
758 }
a330ddf43861 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 346319bd01bfd51f02d656e653a93f0bd1e954aa
iuc
parents: 1
diff changeset
759 cata("</tr>\n")
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
760 }
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
761
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
762 for (i in 1:nrow(factors)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
763 cata("<tr>\n")
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
764 TableHeadItem(row.names(factors)[i])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
765 for (j in 1:ncol(factors)) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
766 TableItem(as.character(unmake.names(factors[i, j])))
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
767 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
768 cata("</tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
769 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
770 cata("</table>")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
771
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
772 cit <- character()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
773 link <- character()
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
774 link[1] <- paste0("<a href=\"",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
775 "http://www.bioconductor.org/packages/release/bioc/",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
776 "vignettes/limma/inst/doc/usersguide.pdf",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
777 "\">", "limma User's Guide", "</a>.")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
778
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
779 link[2] <- paste0("<a href=\"",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
780 "http://www.bioconductor.org/packages/release/bioc/",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
781 "vignettes/edgeR/inst/doc/edgeRUsersGuide.pdf",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
782 "\">", "edgeR User's Guide", "</a>")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
783
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
784 cit[1] <- paste("Please cite the following paper for this tool:")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
785
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
786 cit[2] <- paste("Liu R, Holik AZ, Su S, Jansz N, Chen K, Leong HS, Blewitt ME,",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
787 "Asselin-Labat ML, Smyth GK, Ritchie ME (2015). Why weight? ",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
788 "Modelling sample and observational level variability improves power ",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
789 "in RNA-seq analyses. Nucleic Acids Research, 43(15), e97.")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
790
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
791 cit[3] <- paste("Please cite the paper below for the limma software itself.",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
792 "Please also try to cite the appropriate methodology articles",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
793 "that describe the statistical methods implemented in limma,",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
794 "depending on which limma functions you are using. The",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
795 "methodology articles are listed in Section 2.1 of the",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
796 link[1],
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
797 "Cite no. 3 only if sample weights were used.")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
798 cit[4] <- paste("Smyth GK (2005). Limma: linear models for microarray data.",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
799 "In: 'Bioinformatics and Computational Biology Solutions using",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
800 "R and Bioconductor'. R. Gentleman, V. Carey, S. doit,.",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
801 "Irizarry, W. Huber (eds), Springer, New York, pages 397-420.")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
802 cit[5] <- paste("Please cite the first paper for the software itself and the",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
803 "other papers for the various original statistical methods",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
804 "implemented in edgeR. See Section 1.2 in the", link[2],
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
805 "for more detail.")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
806 cit[6] <- paste("Robinson MD, McCarthy DJ and Smyth GK (2010). edgeR: a",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
807 "Bioconductor package for differential expression analysis",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
808 "of digital gene expression data. Bioinformatics 26, 139-140")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
809 cit[7] <- paste("Robinson MD and Smyth GK (2007). Moderated statistical tests",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
810 "for assessing differences in tag abundance. Bioinformatics",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
811 "23, 2881-2887")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
812 cit[8] <- paste("Robinson MD and Smyth GK (2008). Small-sample estimation of",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
813 "negative binomial dispersion, with applications to SAGE data.",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
814 "Biostatistics, 9, 321-332")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
815 cit[9] <- paste("McCarthy DJ, Chen Y and Smyth GK (2012). Differential",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
816 "expression analysis of multifactor RNA-Seq experiments with",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
817 "respect to biological variation. Nucleic Acids Research 40,",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
818 "4288-4297")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
819 cit[10] <- paste("Law CW, Chen Y, Shi W, and Smyth GK (2014). Voom:",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
820 "precision weights unlock linear model analysis tools for",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
821 "RNA-seq read counts. Genome Biology 15, R29.")
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
822 cit[11] <- paste("Ritchie ME, Diyagama D, Neilson J, van Laar R,",
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
823 "Dobrovic A, Holloway A and Smyth GK (2006).",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
824 "Empirical array quality weights for microarray data.",
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
825 "BMC Bioinformatics 7, Article 261.")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
826 cata("<h3>Citations</h3>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
827 cata(cit[1], "\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
828 cata("<br>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
829 cata(cit[2], "\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
830
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
831 cata("<h4>limma</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
832 cata(cit[3], "\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
833 cata("<ol>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
834 ListItem(cit[4])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
835 ListItem(cit[10])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
836 ListItem(cit[11])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
837 cata("</ol>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
838
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
839 cata("<h4>edgeR</h4>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
840 cata(cit[5], "\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
841 cata("<ol>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
842 ListItem(cit[6])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
843 ListItem(cit[7])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
844 ListItem(cit[8])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
845 ListItem(cit[9])
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
846 cata("</ol>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
847
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
848 cata("<p>Please report problems or suggestions to: su.s@wehi.edu.au</p>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
849
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
850 for (i in 1:nrow(linkData)) {
3
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
851 if (grepl("session_info", linkData$Link[i])) {
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
852 HtmlLink(linkData$Link[i], linkData$Label[i])
38aab66ae5cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 1640914b9812b0482a3cf684f05465f8d9cfdc65
iuc
parents: 2
diff changeset
853 }
0
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
854 }
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
855
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
856 cata("<table border=\"0\">\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
857 cata("<tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
858 TableItem("Task started at:"); TableItem(timeStart)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
859 cata("</tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
860 cata("<tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
861 TableItem("Task ended at:"); TableItem(timeEnd)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
862 cata("</tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
863 cata("<tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
864 TableItem("Task run time:"); TableItem(timeTaken)
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
865 cata("<tr>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
866 cata("</table>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
867
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
868 cata("</body>\n")
bdebdea5f6a7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 2f34a215c35f08c3666f314a87d235437baa1d21
iuc
parents:
diff changeset
869 cata("</html>")