Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Midoux Cedric
easy16S
Commits
50b4099e
Commit
50b4099e
authored
Feb 25, 2020
by
Midoux Cedric
Browse files
fonctions dans internals.R
parent
30aa79da
Changes
3
Hide whitespace changes
Inline
Side-by-side
internals.R
View file @
50b4099e
...
...
@@ -59,3 +59,72 @@
## Unhappy paths: everything else
return
()
}
###
checkNull
<-
function
(
x
)
{
if
(
!
exists
(
as.character
(
substitute
(
x
))))
{
return
(
NULL
)
}
else
if
(
is.null
(
x
))
{
return
(
NULL
)
}
else
if
(
length
(
x
)
>
1
)
{
return
(
x
)
}
else
if
(
x
%in%
c
(
0
,
""
,
NA
,
"NULL"
))
{
return
(
NULL
)
}
else
{
return
(
x
)
}
}
beautifulTable
<-
function
(
data
)
{
DT
::
datatable
(
data
=
data
,
rownames
=
FALSE
,
filter
=
"top"
,
extensions
=
c
(
"Buttons"
,
"ColReorder"
,
"FixedColumns"
),
options
=
list
(
dom
=
"lBtip"
,
pageLength
=
10
,
lengthMenu
=
list
(
c
(
10
,
25
,
50
,
100
,
-1
),
list
(
'10'
,
'25'
,
'50'
,
'100'
,
'All'
)),
buttons
=
list
(
'colvis'
,
list
(
extend
=
'collection'
,
buttons
=
c
(
'copy'
,
'csv'
,
'excel'
,
'pdf'
),
text
=
'Download'
)
),
colReorder
=
TRUE
,
scrollX
=
TRUE
,
fixedColumns
=
list
(
leftColumns
=
1
,
rightColumns
=
0
)
),
width
=
"auto"
,
height
=
"auto"
)
}
collapsedBox
<-
function
(
data
,
title
=
title
)
{
box
(
title
=
title
,
width
=
NULL
,
status
=
"primary"
,
collapsible
=
TRUE
,
collapsed
=
TRUE
,
data
)
}
scriptHead
<-
c
(
"# Loading packages"
,
"library(phyloseq.extended)"
,
""
,
"# Loading data"
,
glue
(
"load(\"Easy16S-data.{Sys.Date()}.RData\") # if necessary, adapt the file path"
),
""
,
"# View data"
,
"data"
,
""
)
server.R
View file @
50b4099e
...
...
@@ -10,7 +10,9 @@ library(factoextra)
shinyServer
(
function
(
input
,
output
,
session
)
{
{
source
(
"internals.R"
)
source
(
"panels/dataInput.R"
,
local
=
TRUE
)
source
(
"panels/Sidebar-server.R"
,
local
=
TRUE
)
source
(
"panels/Summary-server.R"
,
local
=
TRUE
)
source
(
"panels/barplot-server.R"
,
local
=
TRUE
)
...
...
@@ -23,61 +25,6 @@ shinyServer
source
(
"panels/tree-server.R"
,
local
=
TRUE
)
source
(
"panels/cluster-server.R"
,
local
=
TRUE
)
checkNull
<-
function
(
x
)
{
if
(
!
exists
(
as.character
(
substitute
(
x
))))
{
return
(
NULL
)
}
else
if
(
is.null
(
x
))
{
return
(
NULL
)
}
else
if
(
length
(
x
)
>
1
)
{
return
(
x
)
}
else
if
(
x
%in%
c
(
0
,
""
,
NA
,
"NULL"
))
{
return
(
NULL
)
}
else
{
return
(
x
)
}
}
beautifulTable
<-
function
(
data
)
{
DT
::
datatable
(
data
=
data
,
rownames
=
FALSE
,
filter
=
"top"
,
extensions
=
c
(
"Buttons"
,
"ColReorder"
,
"FixedColumns"
),
options
=
list
(
dom
=
"lBtip"
,
pageLength
=
10
,
lengthMenu
=
list
(
c
(
10
,
25
,
50
,
100
,
-1
),
list
(
'10'
,
'25'
,
'50'
,
'100'
,
'All'
)),
buttons
=
list
(
'colvis'
,
list
(
extend
=
'collection'
,
buttons
=
c
(
'copy'
,
'csv'
,
'excel'
,
'pdf'
),
text
=
'Download'
)
),
colReorder
=
TRUE
,
scrollX
=
TRUE
,
fixedColumns
=
list
(
leftColumns
=
1
,
rightColumns
=
0
)
),
width
=
"auto"
,
height
=
"auto"
)
}
collapsedBox
<-
function
(
data
,
title
=
title
)
{
box
(
title
=
title
,
width
=
NULL
,
status
=
"primary"
,
collapsible
=
TRUE
,
collapsed
=
TRUE
,
data
)
}
source
(
"internals.R"
)
data16S
<-
reactive
({
## BIOM input
if
(
input
$
dataset
==
"input"
)
...
...
@@ -138,18 +85,4 @@ shinyServer
isolate
(
data
<<-
data16S
())
})
}
scriptHead
<-
c
(
"# Loading packages"
,
"library(phyloseq.extended)"
,
""
,
"# Loading data"
,
glue
(
"load(\"Easy16S-data.{Sys.Date()}.RData\") # if necessary, adapt the file path"
),
""
,
"# View data"
,
"data"
,
""
)
})
ui.R
View file @
50b4099e
...
...
@@ -14,8 +14,9 @@ source("panels/cluster-ui.R", local = TRUE)
source
(
"panels/Help-ui.R"
,
local
=
TRUE
)
shinyUI
(
dashboardPage
(
dashboardHeader
(
title
=
"Easy16S"
),
dashboardHeader
(
title
=
"Easy16S"
),
dashboardSidebar
(
actionButton
(
"dataButton"
,
"Select your data"
),
sidebarMenu
(
menuItem
(
"Data"
,
tabName
=
"Data"
,
icon
=
icon
(
"dashboard"
)),
menuItem
(
"Summary"
,
tabName
=
"Summary"
,
icon
=
icon
(
"dashboard"
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment