-
Notifications
You must be signed in to change notification settings - Fork 47
/
.Rhistory
512 lines (512 loc) · 14.6 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
devtools::install_github("rstudio/shinyapps", force=TRUE)
runApp()
runApp()
install.packages("shinydashboard")
install.packages("shinydashboard")
library(shinydashboard)
runApp()
runApp()
runApp()
require(shinydashboard)
runApp()
rsconnect::deployApp(appFileManifest = “manifest.txt”)
rsconnect::deployApp(appFileManifest = "manifest.txt")
rsconnect::deployApp(appFileManifest = "manifest.txt")
runApp()
install.packages(c("devtools", "plotly", "R.utils", "sp", "swirl", "testthat"))
session_info()
rsconnect::deployApp(appFileManifest = "manifest.txt")
shiny::runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
shiny::runApp()
runApp(appFileManifest="manifest.txt")
runApp()
library(shinydashboard)
runApp()
runApp()
runApp()
shiny::runApp()
shiny::runApp()
shiny::runApp()
runApp()
runApp()
runApp()
library(shiny)
runApp()
runApp()
runApp()
library(shiny)
runApp()
library(shinydashboard)
runApp()
library(devtools)
devtools::document()
devtools::document()
devtools::use_build_ignore(c("1200x592.png", "jasmine_dumas_user2016_poster_update.pdf", ))
devtools::use_build_ignore(c("1200x592.png", "jasmine_dumas_user2016_poster_update.pdf", "jasmine_dumas_user2016_poster_update.pptx", "jasmine_dumas_user2016_poster.pptx"))
use_build_ignore(".travis.yml")
cat("Platforms updated .../n")
cat("Platforms updated ...\n")
?source
source("inst/shiny-apps/shinyGEO/platforms/geo-platform-update.sh")
?system
?load
system("inst/shiny-apps/shinyGEO/platforms/geo-platform-update.sh", intern=T)
system("inst/shiny-apps/shinyGEO/platforms/geo-platform-update.sh", intern=F)
system("inst/shiny-apps/shinyGEO/series/geo-series-update.sh")
install.packages("httr")
install.packages("httr")
library(httr)
data <- httr::GET("https://www.ncbi.nlm.nih.gov/geo/browse/")
data
system("echo "Update GEO data..."
data=$(curl --silent "https://www.ncbi.nlm.nih.gov/geo/browse/" | grep "total_count")
")
system("inst/shiny-apps/shinyGEO/series/geo-series-update.sh")
q()
source('~/Desktop/R-directory/shinyGEO/R/runshinyGEO.R')
runshinyGEO()
runshinyGEO()
appDir <- system.file("shiny-apps", "shinyGEO", package = "shinyGEO")
library(limma)
source("https://bioconductor.org/biocLite.R")
?BiocUpgrade
source("https://bioconductor.org/biocLite.R")
biocLite("BiocUpgrade")
q()
library(ggplot2)
library(devtools)
session_info()
BiocInstaller::biocLite(c("limma", "affy"))
devtools::document()
use_build_ignore("rsconnect")
use_build_ignore("ui.dashboard.body.R~master")
library(shinyGEO)
runshinyGEO()
runshinyGEO()
Q
library(shinyGEO)
runshinyGEO()
getwd()
home <- getwd()
setwd("/home/user")
setwd("\home\user")
data = system("curl --silent 'https://www.ncbi.nlm.nih.gov/geo/browse/' | grep 'total_count'")
library(RCurl)
library(httr)
?GET
?grep
r = GET(url = 'https://www.ncbi.nlm.nih.gov/geo/browse/')
grep('total_count', r)
r
headers(r)
content(r, 'total_count')
content(r, 'text')
grep('total_count', content(r, 'text'))
r
headers(r)
r$`content-type`
r = curl_fetch_memory('https://www.ncbi.nlm.nih.gov/geo/browse/')
library(curl)
r = curl_fetch_memory('https://www.ncbi.nlm.nih.gov/geo/browse/')
r
?getURL
r = getURL('https://www.ncbi.nlm.nih.gov/geo/browse/')
r
r_httr = GET(url = 'https://www.ncbi.nlm.nih.gov/geo/browse/')
r_httr
r_RCurl = getURL('https://www.ncbi.nlm.nih.gov/geo/browse/')
r_RCurl
str(r_httr)
r_httr$`content-type`
str(content(r_httr))
grep('count', r_httr)
r_httr$request$headers
content_type_json(r_httr)
content(r_httr)
c = content(r_httr)
c[2]
c$node
c
grep('count', c)
print(c)
str(c)
c[1:2]
attr(c)
grep('total_count', content(r_httr))
library(RCurl)
r_RCurl = getURL('https://www.ncbi.nlm.nih.gov/geo/browse/')
r_RCurl
grep("total_count", r_RCurl)
grep("total_count", r_RCurl, value = T)
r_httr = GET(url = 'https://www.ncbi.nlm.nih.gov/geo/browse/')
library(httr)
r_httr
grep('total_count', content(r_httr))
grep("total_count", r_RCurl, value = T)
grep("^nation", r_RCurl, value = T)
grep("^national", r_RCurl, value = T)
grep("database", r_RCurl, value = T)
class(r_RCurl)
?xml2
?XML
library(XML)
parsed <- htmlParse(r_RCurl)
parsed
top_table <- readHTMLTable(parsed)[[1]]
top_table
View(top_table)
str(parsed)
class(parsed)
View(r_httr)
content(r_httr)
content(r_httr)[[1]]
content(r_httr)[1]
?system
data = grep("total_count", getURL('https://www.ncbi.nlm.nih.gov/geo/browse/'), value = T)
data
data = grep("[0-9] series", getURL('https://www.ncbi.nlm.nih.gov/geo/browse/'), value = T)
data
data = grep("count", getURL('https://www.ncbi.nlm.nih.gov/geo/browse/'), value = T)
data
grep("count", readHTMLTable(data))
grep("count", readHTMLTable(data), value = T)
grep("count", readHTMLList(data), value = T)
library(rvest)
series_count <- html('https://www.ncbi.nlm.nih.gov/geo/browse/')
series_count <- read_html('https://www.ncbi.nlm.nih.gov/geo/browse/')
series_count %>%
html_node("count") %>%
html_text() %>%
as.numeric()
series_count %>%
html_node("#count") %>%
html_text() %>%
as.numeric()
series_count %>%
html_nodes("#count") %>%
html_text() %>%
as.numeric()
series_count %>%
html_nodes("//*[(@id = 'count')]") %>%
html_text() %>%
as.numeric()
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.numeric()
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]")
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text()
?gsub
count = gsub("series", "", series_count)
count
series_count <- read_html('https://www.ncbi.nlm.nih.gov/geo/browse/')
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text()
count = gsub("series", "", series_count)
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
count = gsub("series", "", series_count)
count
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character() %>%
gsub("series", "") %>%
as.numeric()
series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
str(series_count)
series$doc
series$node
count <- series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
as.numeric(gsub("series", "", count) )
series_count <- series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
series_count <- as.numeric(gsub("series", "", count) )
?ceiling
as.integer(ceiling(series_count/5000.0))
cat("Getting GEO Data...")
cat("Using count = ", series_count)
?for
()
?loop
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=series&zsort=date&mode=csv&page=", series_count, "&display=5000")
url
5 <= 10
library(readr)
data2 <- read_csv("https://www.ncbi.nlm.nih.gov/geo/browse/?view=series&zsort=date&mode=csv&page=1&display=5000")
View(data2)
cat("Getting GEO Data...\n")
series_count = 5
series <- data.frame()
for(i <= series_count) {
if(i != 1) {
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=series&zsort=date&mode=csv&page=", i, "&display=5000")
series_data <- read_csv(url)
series <- rbind(series, series_data)
}
}
for(i in series_count) {
if(i != 1) {
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=series&zsort=date&mode=csv&page=", i, "&display=5000")
series_data <- read_csv(url)
series <- rbind(series, series_data)
}
}
View(series)
series_count
series_count <- read_html('https://www.ncbi.nlm.nih.gov/geo/browse/')
series_count <- series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
series_count <- as.numeric(gsub("series", "", count) )
series_count <- as.integer(ceiling(series_count/5000.0))
cat("Getting GEO Data...\n")
cat("Using count = ", series_count, "\n")
series <- data.frame()
series_count
for(i in 1:series_count) {
if(i != 1) {
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=series&zsort=date&mode=csv&page=", i, "&display=5000")
series_data <- read_csv(url)
series <- rbind(series, series_data)
}
}
rm("data2")
rm("top_data")
rm("top_table")
View(series)
?rbind
series_count <- series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
series_count <- as.numeric(gsub("series", "", series_count) )
# there are only 5000 views on each page - this get the amount of pages to loop
series_count <- as.integer(ceiling(series_count/5000.0))
series_count <- read_html('https://www.ncbi.nlm.nih.gov/geo/browse/')
series_count <- series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
series_count <- as.numeric(gsub("series", "", series_count) )
# there are only 5000 views on each page - this get the amount of pages to loop
series_count <- as.integer(ceiling(series_count/5000.0))
series_count
?write_csv
getwd()
?load_all
library(devtools)
load_all
?load_all
View(series)
write_csv(series, "series.csv")
cat("Finished update...data saved to -> series.csv\n")
series = read.table("series.csv", header = TRUE, sep = ",")
View(series)
g = grep("Expression profiling by array", series$Series.Type)
series = read_csv("series.csv")
View(series)
g = grep("Expression profiling by array", series$`Series Type`)
series = series[g,]
View(series)
series.accession = as.character(series$Accession)
series.description = as.character(series$Title)
o = order(series.accession)
series.accession = series.accession[o]
series.description = series.description[o]
save(series.accession, series.description, file = "series.RData")
getwd()
series_count <- read_html('https://www.ncbi.nlm.nih.gov/geo/browse/')
series_count <- series_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
series_count <- as.numeric(gsub("series", "", series_count) )
series_count <- as.integer(ceiling(series_count/5000.0))
cat("Getting GEO Data...\n")
cat("Using count = ", series_count, "\n")
# this will hold the binded series meta data
series <- data.frame()
for(i in 1:series_count) {
if(i != 1) {
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=series&zsort=date&mode=csv&page=", i, "&display=5000")
series_data <- read_csv(url)
series <- rbind(series, series_data)
}
}
write_csv(series, "inst/extdata/series.csv")
series = read_csv("inst/extdata/series.csv")
g = grep("Expression profiling by array", series$`Series Type`)
series = series[g,]
series.accession = as.character(series$Accession)
series.description = as.character(series$Title)
o = order(series.accession)
series.accession = series.accession[o]
series.description = series.description[o]
save(series.accession, series.description, file = "data/series.RData")
platform_count <- read_html("https://www.ncbi.nlm.nih.gov/geo/browse/?view=platforms")
platform_count <- platform_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
platform_count <- as.numeric(gsub("series", "", platform_count) )
platform_count
platform_count <- as.numeric(gsub("platforms", "", platform_count) )
platform_count <- read_html("https://www.ncbi.nlm.nih.gov/geo/browse/?view=platforms")
platform_count <- platform_count %>%
html_nodes(xpath="//*[(@id = 'count')]") %>%
html_text() %>%
as.character()
platform_count <- as.numeric(gsub("platforms", "", platform_count) )
platform_count
platform_count <- as.integer(ceiling(platform_count/5000.0))
platform_count
cat("Using count = ", platform_count, "\n")
platform <- data.frame()
for(i in 1:platform_count) {
if(i != 1) {
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=platforms&zsort=date&mode=csv&page=", i, "&display=5000")
platform_data <- read_csv(url)
series <- rbind(platform, platform_data)
}
}
# save raw data in external folder
write_csv(platform, "inst/extdata/platform.csv")
cat("Finished update...raw data saved to -> inst/extdata/platform.csv")
platform <- data.frame()
for(i in 1:platform_count) {
if(i != 1) {
url <- paste0("https://www.ncbi.nlm.nih.gov/geo/browse/?view=platforms&zsort=date&mode=csv&page=", i, "&display=5000")
platform_data <- read_csv(url)
platform <- rbind(platform, platform_data)
}
}
# save raw data in external folder
write_csv(platform, "inst/extdata/platform.csv")
cat("Finished update...raw data saved to -> inst/extdata/platform.csv")
platforms = read_csv("inst/extdata/platform.csv")
g1 = grep("oligonucleotide", platforms$Technology)
g2 = grep("spotted DNA", platforms$Technology)
g = c(g1,g2)
platforms = platforms[g,]
platforms.accession = as.character(platforms$Accession)
platforms.description = paste0(platforms$Title, " (", platforms$Data.Rows, " probes)")
View(platforms)
platforms.description = paste0(platforms$Title, " (", platforms$`Data Rows`, " probes)")
o = order(platforms.accession)
platforms.accession = platforms.accession[o]
platforms.description = platforms.description[o]
save(platforms.accession, platforms.description, file = "data/platforms.RData")
devtools::document()
runshinyGEO()
load("data/series.RData")
load("data/series.RData")
appDir <- system.file("shiny-apps", "shinyGEO", package = "shinyGEO")
appDir
load("~/data/series.RData")
getwd()
paste0(getwd(), "data/series.RData")
paste0(getwd(), "/data/series.RData")
load( paste0(getwd(), "/data/series.RData") )
runshinyGEO()
appDir
seriesDir <- system.file("data", "series.RData")
seriesDir
?system.file
seriesDir <- system.file("data", "series.RData", package = "shinyGEO")
seriesDir
load(seriesDir)
runshinyGEO()
Q
tools::checkRdaFiles()
?checkRdaFiles?
?checkRdaFiles
tools::checkRdaFiles("data/series.RData")
tools::checkRdaFiles("data/platforms.RData")
tools::resaveRdaFiles("data/series.RData")
tools::resaveRdaFiles("data/platforms.RData")
devtools::document()
devtools::use_build_ignore("inst/extdata/series.csv")
devtools::use_build_ignore("inst/extdata/platform.csv")
library(magrittr)
document()
devtools::use_build_ignore("inst/shiny-apps/shinyGEO/platforms")
devtools::use_build_ignore("inst/shiny-apps/shinyGEO/series")
document()
devtools::use_build_ignore("inst/shiny-apps/shinyGEO/RData")
devtools::use_build_ignore("inst/shiny-apps/shinyGEO/series/series.RData")
devtools::use_build_ignore("inst/shiny-apps/shinyGEO/series/platforms.RData")
?"%>%"
devtools::document()
?read_html
library(rvest)
?read_html
document()
document()
rm(list=ls())
session_info()
use_build_ignore("cran-comments.md")
rm("platforms.accession")
rm(platforms.accession)
load("~/Desktop/R-directory/shinyGEO/data/platforms.RData")
load("~/Desktop/R-directory/shinyGEO/data/series.RData")
?devtools::load_data
?devtools::load_all
citation("shinyGEO")
rm(ls=lsit())
rm(ls=list())
rm(list=ls())
load_data()
load_data("shinyGEO")
library("shinyGEO", lib.loc="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
load_data("shinyGEO")
runshinyGEO()
Q
runshinyGEO()
load("~/Desktop/R-directory/shinyGEO/data/series.RData")
document()
document()
document()
document()
document()
q()
shiny::runApp('inst/shiny-apps/shinyGEO')
runshinyGEO()
library(shinyGEO)
session_info()
q()
sessionInfo()
update.packages()
library(devtools)
session_info()
devtools::use_code_of_conduct()
library(shinyGEO)
runshinyGEO()
Q
library(shinyGEO)
q()
devtools::document()
devtools::document()
devtools::document()
q()