Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shiny-timecourse-inspector
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pertz-lab
shiny-timecourse-inspector
Commits
445892c5
Commit
445892c5
authored
Oct 04, 2019
by
dmattek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dist and link methods directly from UI
parent
1b5446c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
modules/tabClHierSpar.R
modules/tabClHierSpar.R
+32
-30
No files found.
modules/tabClHierSpar.R
View file @
445892c5
...
...
@@ -17,7 +17,7 @@ helpText.clHierSpar = c(alImportance = paste0("<p>Weight factors (WF) calculated
"Journal of the American Statistical Association 105(490): 713-726.</p>"
))
# UI ----
clustHierSparUI
<-
function
(
id
,
label
=
"Sparse Hierarchical C
L
ustering"
)
{
clustHierSparUI
<-
function
(
id
,
label
=
"Sparse Hierarchical C
l
ustering"
)
{
ns
<-
NS
(
id
)
tagList
(
...
...
@@ -30,32 +30,32 @@ clustHierSparUI <- function(id, label = "Sparse Hierarchical CLustering") {
br
(),
fluidRow
(
column
(
4
,
3
,
selectInput
(
ns
(
"selectPlotHierSparDiss"
),
label
=
(
"
Select type of dissimilarity measure:
"
),
choices
=
list
(
"Euclidean"
=
1
,
"Manhattan"
=
2
),
label
=
(
"
Dissimilarity measure
"
),
choices
=
list
(
"Euclidean"
=
"squared.distance"
,
"Manhattan"
=
"absolute.value"
),
selected
=
1
),
selectInput
(
ns
(
"selectPlotHierSparLinkage"
),
label
=
(
"
Select linkage method:
"
),
label
=
(
"
Linkage method
"
),
choices
=
list
(
"Average"
=
1
,
"Complete"
=
2
,
"Single"
=
3
,
"Centroid"
=
4
"Average"
=
"average"
,
"Complete"
=
"complete"
,
"Single"
=
"single"
,
"Centroid"
=
"centroid"
),
selected
=
2
selected
=
1
)
),
column
(
4
,
6
,
sliderInput
(
ns
(
'inPlotHierSparNclust'
),
'
#dendrogram branches to colour
'
,
'
Number of dendrogram branches to cut
'
,
min
=
1
,
max
=
20
,
value
=
1
,
...
...
@@ -294,15 +294,15 @@ clustHierSpar <- function(input, output, session,
dm.t
,
wbounds
=
NULL
,
nperms
=
ifelse
(
input
$
inHierSparAdv
,
input
$
inPlotHierSparNperms
,
1
),
dissimilarity
=
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
dissimilarity
=
input
$
selectPlotHierSparDiss
)
sparsehc
<-
HierarchicalSparseCluster
(
dists
=
perm.out
$
dists
,
wbound
=
perm.out
$
bestw
,
niter
=
ifelse
(
input
$
inHierSparAdv
,
input
$
inPlotHierSparNiter
,
1
),
method
=
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
dissimilarity
=
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
method
=
input
$
selectPlotHierSparLinkage
,
dissimilarity
=
input
$
selectPlotHierSparDiss
)
#cat('=============\nsparsehc:\n')
...
...
@@ -433,9 +433,9 @@ clustHierSpar <- function(input, output, session,
output
$
downCellClSpar
<-
downloadHandler
(
filename
=
function
()
{
paste0
(
'clust_hierchSpar_data_'
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
'_'
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
'.csv'
)
input
$
selectPlotHierSparLinkage
,
'.csv'
)
},
content
=
function
(
file
)
{
...
...
@@ -530,9 +530,9 @@ clustHierSpar <- function(input, output, session,
breaks.arg
=
loc.col.bounds
,
title.arg
=
paste
(
"Distance measure: "
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
"\nLinkage method: "
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
input
$
selectPlotHierSparLinkage
))
return
(
loc.p
)
...
...
@@ -545,45 +545,45 @@ clustHierSpar <- function(input, output, session,
createFnameHeatMap
=
reactive
({
paste0
(
'clust_hierchSparse_heatMap_'
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
'_'
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
input
$
selectPlotHierSparLinkage
,
'.png'
)
})
createFnameTrajPlot
=
reactive
({
paste0
(
'clust_hierchSparse_tCourses_'
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
'_'
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
input
$
selectPlotHierSparLinkage
,
'.pdf'
)
})
createFnameRibbonPlot
=
reactive
({
paste0
(
'clust_hierchSparse_tCoursesMeans_'
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
'_'
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
input
$
selectPlotHierSparLinkage
,
'.pdf'
)
})
createFnamePsdPlot
=
reactive
({
paste0
(
'clust_hierchSparse_tCoursesPsd_'
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
'_'
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
input
$
selectPlotHierSparLinkage
,
'.pdf'
)
})
createFnameDistPlot
=
reactive
({
paste0
(
'clust_hierchSparse_clDist_'
,
s.cl.spar.diss
[
as.numeric
(
input
$
selectPlotHierSparDiss
)]
,
input
$
selectPlotHierSparDiss
,
'_'
,
s.cl.spar.linkage
[
as.numeric
(
input
$
selectPlotHierSparLinkage
)]
,
'.pdf'
)
})
input
$
selectPlotHierSparLinkage
,
'.pdf'
)
})
...
...
@@ -634,6 +634,8 @@ clustHierSpar <- function(input, output, session,
plotHierSpar
()
},
height
=
getPlotHierSparHeatMapHeight
)
# Pop-overs ----
addPopover
(
session
,
ns
(
"alImportance"
),
title
=
"Variable importance"
,
...
...
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