annotate 16_fgsea/.Rhistory @ 5:4af6a6558160 draft default tip

Deleted selected files
author dktanwar
date Mon, 11 Dec 2017 09:49:16 -0500
parents d91ddc13f8a8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
1 setwd("/Volumes/BINF1_Raid/home/dtanwar/projects/H3K4me3_McMasterU/exp/20171026-GO_analysis_232_changed_genes-11/20171027-ranked_genes_232")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
2 table <- read.delim("./input/20170722-genes_info_TSS_500bp.txt.xz", sep = "\t", header = T,
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
3 stringsAsFactors = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
4 View(table)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
5 table <- read.delim("./input/20170722-genes_info_TSS_500bp.txt.xz", sep = "\t", header = T,
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
6 stringsAsFactors = F)[,c(22,7)]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
7 View(table)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
8 sp_table <- split(x = table, f = table$SYMBOL)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
9 genes <- lapply(sp_table, function(x){
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
10 a <- x[1,]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
11 a[,2] <- mean(x[,2])
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
12 return(a)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
13 })
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
14 library(plyr)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
15 gl <- ldply(genes, data.frame)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
16 View(gl)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
17 gl <- ldply(genes, data.frame)[,-1]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
18 View(gl)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
19 gl[,1] <- toupper(gl[,1])
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
20 View(gl)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
21 write.table(gl, "./output/ranked_genes_list_232.rnk", quote = F, sep = "\t", row.names = F, col.names = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
22 setwd("/Volumes/BINF1_Raid/home/dtanwar/projects/H3K4me3_McMasterU/exp/20171026-GO_analysis_232_changed_genes-11/20171027-01_ranked_genes_232")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
23 library(plyr)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
24 table <- read.delim("./input/20170722-genes_info_TSS_500bp.txt.xz", sep = "\t", header = T,
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
25 stringsAsFactors = F)[,c(22,7)]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
26 sp_table <- split(x = table, f = table$SYMBOL)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
27 genes <- lapply(sp_table, function(x){
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
28 a <- x[1,]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
29 a[,2] <- mean(x[,2])
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
30 return(a)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
31 })
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
32 gl <- ldply(genes, data.frame)[,-1]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
33 write.table(gl, "./output/20171029-original_ranked_genes_list_232.rnk", quote = F, sep = "\t", row.names = F, col.names = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
34 gl[,1] <- toupper(gl[,1])
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
35 write.table(gl, "./output/ranked_genes_list_232.rnk", quote = F, sep = "\t", row.names = F, col.names = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
36 library(plyr)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
37 table <- read.delim("./input/20170722-genes_info_TSS_500bp.txt.xz", sep = "\t", header = T,
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
38 stringsAsFactors = F)[,c(22,7)]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
39 sp_table <- split(x = table, f = table$SYMBOL)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
40 genes <- lapply(sp_table, function(x){
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
41 a <- x[1,]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
42 a[,2] <- mean(x[,2])
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
43 return(a)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
44 })
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
45 gl <- ldply(genes, data.frame)[,-1]
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
46 gl
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
47 write.table(gl, "./output/20171029-original_ranked_genes_list_232.rnk", quote = F, sep = "\t", row.names = F, col.names = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
48 gl[,1] <- toupper(gl[,1])
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
49 write.table(gl, "./output/ranked_genes_list_232.rnk", quote = F, sep = "\t", row.names = F, col.names = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
50 # Send R errors to stderr
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
51 options(show.error.messages = F, error = function(){cat(geterrmessage(), file = stderr()); q("no", 1, F)})
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
52 # Avoid crashing Galaxy with an UTF8 error on German LC settings
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
53 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
54 # Import libraries
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
55 library("GenomicRanges")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
56 source("https://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
57 biocLite()
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
58 source("http://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
59 biocLite()
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
60 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
61 library("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
62 library("openxlsx")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
63 library("data.table")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
64 biocLite("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
65 # biocLite("openxlsx")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
66 biocLite("data.table")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
67 # Send R errors to stderr
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
68 options(show.error.messages = F, error = function(){cat(geterrmessage(), file = stderr()); q("no", 1, F)})
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
69 # Avoid crashing Galaxy with an UTF8 error on German LC settings
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
70 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
71 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
72 library("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
73 biocLite("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
74 source("http://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
75 biocLite()
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
76 biocLite("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
77 biocLite("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
78 biocLite("Rcpp")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
79 biocLite("limma")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
80 biocLite("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
81 biocLite("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
82 source("http://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
83 biocLite()
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
84 biocLite("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
85 biocLite("GenomicRanges")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
86 biocLite("Rsamtools")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
87 # Import libraries
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
88 library("GenomicRanges")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
89 library("Rsamtools")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
90 library("rtracklayer")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
91 library("parallel")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
92 library("foreach")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
93 library("doParallel")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
94 library("GenomicFeatures")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
95 library("Gviz")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
96 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
97 library("data.table")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
98 library("BSgenome")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
99 library("Biobase")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
100 library("iterators")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
101 library("Biostrings")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
102 library("IRanges")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
103 library("BiocGenerics")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
104 library("AnnotationDbi")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
105 library("XVector")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
106 library("GenomeInfoDb")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
107 library("S4Vectors")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
108 library("GenomicAlignments")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
109 library("BSgenome.Hsapiens.UCSC.hg19")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
110 library("org.Hs.eg.db")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
111 library("BSgenome.Mmusculus.UCSC.mm10")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
112 library("org.Mm.eg.db")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
113 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
114 library("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
115 # library("openxlsx")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
116 library("data.table")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
117 options(stringAsfactors = FALSE, useFancyQuotes = FALSE)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
118 source("https://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
119 biocLite()
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
120 source("https://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
121 biocLite()
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
122 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
123 library("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
124 # library("openxlsx")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
125 library("data.table")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
126 source("https://bioconductor.org/biocLite.R")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
127 biocLite("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
128 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
129 library("edgeR")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
130 # library("openxlsx")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
131 library("data.table")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
132 options(stringAsfactors = FALSE, useFancyQuotes = FALSE)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
133 # Take in trailing command line arguments
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
134 args <- commandArgs(trailingOnly = TRUE)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
135 # Get options using the spec as defined by the enclosed list
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
136 # Options are read from the default: commandArgs(TRUE)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
137 option_specification = matrix(c(
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
138 'input1', 'i1', 2, 'character',
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
139 'input2', 'i2', 2, 'character',
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
140 'input3', 'i3', 2, 'integer',
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
141 'input4', 'i4', 2, 'integer',
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
142 'output', 'o', 2, 'character'
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
143 ), byrow=TRUE, ncol=4);
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
144 # Parse options
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
145 options = getopt(option_specification)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
146 library("rworldmap")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
147 install.packages("rworldmap")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
148 library("rworldmap")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
149 theCountries <- c("DEU", "COD", "BFA")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
150 malDF <- data.frame(country = c("DEU", "COD", "BFA"),
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
151 malaria = c(1, 1, 1))
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
152 malMap <- joinCountryData2Map(malDF, joinCode = "ISO3",
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
153 nameJoinColumn = "country")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
154 mapCountryData(malMap, nameColumnToPlot="malaria", catMethod = "categorical",
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
155 missingCountryCol = gray(.8))
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
156 require(rgdal)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
157 require(rgeos)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
158 require(ggplot2)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
159 install.packages("rgdal")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
160 install.packages("rgeos")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
161 require(rgdal)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
162 require(rgeos)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
163 require(ggplot2)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
164 655 + 290 + 658
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
165 235+38+186
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
166 370+357+50+37+59+386+30+112+300
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
167 750+22+49+25+317
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
168 750+22+49+25+317 +6
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
169 239 + 61+760
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
170 1060+1169+1701
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
171 235+38+186
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
172 3930+459
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
173 653+571+546+211+
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
174 0
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
175 1981+1235+1148
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
176 4364+43
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
177 1701-40
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
178 459+1661+1060
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
179 459+1661+1060 +1169
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
180 459-27
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
181 370+205+6+179+360+455
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
182 432+1575+1060+1169
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
183 mat <- matrix(data = c(1:9), nrow = 3, ncol = 3, byrow = T)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
184 mat
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
185 apply(mat, 1, mean)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
186 apply(mat, 2, mean)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
187 vec <- 1:10
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
188 apply(X = vec, 1, print)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
189 apply(X = vec, 2, print)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
190 sapply(X = vec, FUN = print)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
191 sapply(X = vec, FUN = print, simplify = T)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
192 sapply(X = vec, FUN = print, simplify = F)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
193 sapply(X = vec, FUN = function(x) x -1)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
194 as.integer(c(4.1, 5.2, 6.3, 6.4))
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
195 as.numeric(c(4.1, 5.2, 6.3, 6.4))
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
196 ?quantile
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
197 ?read.table
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
198 ?hist
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
199 ?boxplot
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
200 ?read.csv
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
201 ?quantile
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
202 quantile(x <- rnorm(1001)) # Extremes & Quartiles by default
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
203 res <- matrix(as.numeric(NA), 9, 7)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
204 res
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
205 for(type in 1:9) res[type, ] <- y <- quantile(x, p, type = type)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
206 dimnames(res) <- list(1:9, names(y))
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
207 for(type in 1:9) res[type, ] <- y <- quantile(x, p, type = type)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
208 setwd("~/Desktop/planemo_tools/16_fgsea")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
209 # Send R errors to stderr
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
210 options(show.error.messages = F, error = function(){cat(geterrmessage(), file = stderr()); q("no", 1, F)})
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
211 # Avoid crashing Galaxy with an UTF8 error on German LC settings
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
212 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
213 # Import library
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
214 library("getopt")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
215 library("fgsea")
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
216 options(stringAsfactors = FALSE, useFancyQuotes = FALSE)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
217 # Take in trailing command line arguments
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
218 args <- commandArgs(trailingOnly = TRUE)
d91ddc13f8a8 Uploaded
dktanwar
parents:
diff changeset
219 sessionInfo()