Skip to content

Commit 68894c9

Browse files
committed
ShinyGATOM -> shinyGatom
1 parent ef346d9 commit 68894c9

File tree

12 files changed

+51
-43
lines changed

12 files changed

+51
-43
lines changed

NAMESPACE

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(ShinyGATOM)
3+
export(shinyGatom)
44
import("BioNet")
55
import(RCurl)
66
import(data.table)
7+
import(fgsea)
78
import(gatom)
89
import(igraph)
910
import(logging)

R/app.R

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# load_all("/home/masha/Research/RCode/RShiny/shinyCyJS")
2-
3-
4-
#' starts shiny GATOM application
1+
#' starts Shiny GATOM application
52
#' @import shiny
63
#' @import data.table
74
#' @import gatom
@@ -14,9 +11,9 @@
1411
#' @import fgsea
1512
#' @import markdown
1613
#' @export
17-
ShinyGATOM <- function(config_file=system.file('config.yml', package = 'ShinyGATOM')) {
14+
shinyGatom <- function(config_file=system.file('config.yml', package = 'shinyGatom')) {
1815
addResourcePath('/www',
19-
system.file('www', package = 'ShinyGATOM'))
16+
system.file('www', package = 'shinyGatom'))
2017

2118
shinyApp(app_ui(config_file), app_server(config_file))
2219
}

R/app_server.R

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ app_server <- function(config_file) {
170170
gene.de.meta <- getGeneDEMeta(gene.de.raw, org.gatom.anno)
171171

172172
res <- prepareDE(gene.de.raw, gene.de.meta)
173+
res[, signalRank := NULL] # todo
173174

174175
logdebug(capture.output(str(res)))
175176
if (!all(necessary.gene.de.fields %in% names(res))) {

R/app_ui.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ app_ui <- function(config_file) {
210210

211211
helpPanel <- fixedRow(
212212
mainPanel(id="helpPanel",
213-
includeMarkdown(system.file("help.markdown", package="ShinyGATOM"))))
213+
includeMarkdown(system.file("help.markdown", package="shinyGatom"))))
214214

215215
aboutPanel <- fixedRow(
216-
mainPanel(includeMarkdown(system.file("about.markdown", package="ShinyGATOM"))))
216+
mainPanel(includeMarkdown(system.file("about.markdown", package="shinyGatom"))))
217217

218218
fluidPage(
219219
fluidPage(
@@ -224,11 +224,11 @@ app_ui <- function(config_file) {
224224
#tags$script(src="www/d3.v3.js"),
225225
tags$script(src="www/gam.js"),
226226
tags$link(rel="stylesheet", href="www/gam.css"),
227-
includeScript(system.file("ga.js", package="ShinyGATOM")),
227+
includeScript(system.file("ga.js", package="shinyGatom")),
228228
tags$title("Shiny GATOM")
229229
),
230230

231-
includeHTML(system.file("misc.xhtml", package="ShinyGATOM")),
231+
includeHTML(system.file("misc.xhtml", package="shinyGatom")),
232232
div(id="updateEsParameters", class="js-output"),
233233

234234
titlePanel("Shiny GATOM: integrated analysis of genes and metabolites"),

app.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# for compatibility with Shiny Server
22
pkgload::load_all(export_all = FALSE, helpers = FALSE, attach_testthat = FALSE)
3-
ShinyGATOM::ShinyGATOM()
3+
shinyGatom::shinyGatom()
44

inst/www/img/data_summary.png

92 KB
Loading

inst/www/img/module.png

82.2 KB
Loading

man/ShinyGATOM.Rd

-11
This file was deleted.

run.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Sys.setenv("CPLEX_HOME"="/home/masha/cplex")
1717

1818
## Running app
1919
load_all()
20-
ShinyGATOM()
20+
shinyGatom()
2121

2222

2323
## Testing

tests/testthat.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
library(testthat)
2-
library(ShinyGATOM)
2+
library(shinyGatom)
33

4-
test_check("ShinyGATOM")
4+
test_check("shinyGatom")

tests/testthat/test-functions.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ example.gene.de <- gene.de.rawEx
88
data("met.kegg.dbEx")
99
met.kegg.db <- met.kegg.dbEx
1010

11-
conf <- config::get(file=system.file('config.yml', package = 'ShinyGATOM'),
11+
conf <- config::get(file=system.file('config.yml', package = 'shinyGatom'),
1212
use_parent = FALSE)
1313

1414
test_that("lazyReadRDS works with remote files", {
@@ -21,23 +21,23 @@ test_that("lazyReadRDS works with remote files", {
2121

2222

2323
test_that("Node attributes are created", {
24-
load(system.file('testdata/moduleEx.Rda', package = 'ShinyGATOM'))
24+
load(system.file('testdata/moduleEx.Rda', package = 'shinyGatom'))
2525
vertex.table <- as_data_frame(module, what="vertices")
2626
res <- getJsNodeStyleAttributes(vertex.table)
2727
expect_true(!is.null(res$tooltip))
2828
})
2929

3030

3131
test_that("Edge attributes are created", {
32-
load(system.file('testdata/moduleEx.Rda', package = 'ShinyGATOM'))
32+
load(system.file('testdata/moduleEx.Rda', package = 'shinyGatom'))
3333
edge.table <- as_data_frame(module, what="edges")
3434
res <- getJsEdgeStyleAttributes(edge.table)
3535
expect_true(!is.null(res$tooltip))
3636
})
3737

3838

3939
test_that("ShinyCyJs data is created", {
40-
load(system.file('testdata/moduleEx.Rda', package = 'ShinyGATOM'))
40+
load(system.file('testdata/moduleEx.Rda', package = 'shinyGatom'))
4141
res <- prepareForShinyCyJS(module)
4242
expect_true(!is.null(res))
4343
})

tests/testthat/test-server.R

+33-13
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ library(shiny)
99
# Sys.setenv("GATOM_LOCAL_DATA"="/home/masha/Research/RCode/RShiny/data")
1010
# Sys.setenv("CPLEX_HOME"="/home/masha/cplex")
1111

12-
conf <- config::get(file=system.file('config.yml', package = 'ShinyGATOM'),
12+
conf <- config::get(file=system.file('config.yml', package = 'shinyGatom'),
1313
use_parent = FALSE)
1414

1515

1616
## Data is loaded & annotated with KEGG network
1717
context("Data loads & annotates with KEGG network")
18-
testServer(ShinyGATOM(), {
18+
testServer(shinyGatom(), {
1919
session$setInputs(loadExampleGeneDE = TRUE)
2020
session$setInputs(loadExampleMetDE = TRUE)
2121
session$setInputs(loadExampleLipidDE = FALSE)
@@ -27,27 +27,27 @@ testServer(ShinyGATOM(), {
2727

2828
## Data is read & annotated with KEGG network
2929
context("Data is read & annotated with KEGG network")
30-
testServer(ShinyGATOM(), {
30+
testServer(shinyGatom(), {
3131
session$setInputs(loadExampleGeneDE = FALSE)
3232
session$setInputs(loadExampleMetDE = FALSE)
3333
session$setInputs(loadExampleLipidDE = FALSE)
34-
34+
3535
session$setInputs(network = "kegg")
3636
session$setInputs(organism = "mmu")
3737
session$setInputs(nodesAs = "atoms")
38-
39-
session$setInputs(geneDE=data.frame(datapath=conf$example.gene.de.path,
38+
39+
session$setInputs(geneDE=data.frame(datapath=conf$example.gene.de.path,
4040
name="Ctrl.vs.MandLPSandIFNg.met.de.tsv"))
41-
session$setInputs(metDE=data.frame(datapath=conf$example.met.de.path,
41+
session$setInputs(metDE=data.frame(datapath=conf$example.met.de.path,
4242
name="Ctrl.vs.MandLPSandIFNg.met.de.tsv"))
43-
43+
4444
expect_equal(metIdsType(), "HMDB")
4545
})
4646

4747

4848
## Data is loaded & annotated with Rhea network
4949
context("Data is loaded & annotated with Rhea network")
50-
testServer(ShinyGATOM(), {
50+
testServer(shinyGatom(), {
5151
session$setInputs(loadExampleGeneDE = TRUE)
5252
session$setInputs(loadExampleMetDE = TRUE)
5353
session$setInputs(loadExampleLipidDE = FALSE)
@@ -59,7 +59,7 @@ testServer(ShinyGATOM(), {
5959

6060
## Network is created with KEGG network and nodes as atoms
6161
context("Network is created with KEGG network and nodes as atoms")
62-
testServer(ShinyGATOM(), {
62+
testServer(shinyGatom(), {
6363
session$setInputs(loadExampleGeneDE = TRUE)
6464
session$setInputs(loadExampleMetDE = TRUE)
6565
session$setInputs(loadExampleLipidDE = FALSE)
@@ -76,7 +76,7 @@ testServer(ShinyGATOM(), {
7676

7777
## Network is created with Rhea network and nodes as metabolites
7878
context("Network is created with Rhea network and nodes as metabolites")
79-
testServer(ShinyGATOM(), {
79+
testServer(shinyGatom(), {
8080
session$setInputs(loadExampleGeneDE = TRUE)
8181
session$setInputs(loadExampleMetDE = TRUE)
8282
session$setInputs(loadExampleLipidDE = FALSE)
@@ -90,10 +90,30 @@ testServer(ShinyGATOM(), {
9090
expect_true(!is.null(V(g)))
9191
})
9292

93+
testServer(shinyGatom(), {
94+
session$setInputs(loadExampleGeneDE = FALSE)
95+
session$setInputs(loadExampleMetDE = FALSE)
96+
session$setInputs(loadExampleLipidDE = FALSE)
97+
98+
session$setInputs(network = "kegg")
99+
session$setInputs(organism = "hsa")
100+
session$setInputs(nodesAs = "metabolites")
101+
102+
session$setInputs(geneDE=data.frame(datapath="https://artyomovlab.wustl.edu/publications/supp_materials/GAM/MCF10A.Ctrl.vs.2DG.gene.de.tsv",
103+
name="MCF10A.Ctrl.vs.2DG.gene.de.tsv"))
104+
105+
session$setInputs(preprocess = TRUE)
106+
session$setInputs(runStep1 = "click")
107+
108+
g <- gInput()
109+
expect_true(!is.null(V(g)))
110+
})
111+
112+
93113

94114
# ## Module is found
95115
# context("Module is found")
96-
# testServer(ShinyGATOM(), {
116+
# testServer(shinyGatom(), {
97117
# session$setInputs(loadExampleGeneDE = TRUE)
98118
# session$setInputs(loadExampleMetDE = TRUE)
99119
# session$setInputs(network = "kegg")
@@ -121,4 +141,4 @@ testServer(ShinyGATOM(), {
121141
# })
122142

123143

124-
# context("")
144+
# context("")

0 commit comments

Comments
 (0)