Commit 09033ebd authored by majpark21's avatar majpark21

Working PSD in main tab and hierarchical tab

parent 899e0590
...@@ -6,6 +6,7 @@ source('modules/dispStats.R') ...@@ -6,6 +6,7 @@ source('modules/dispStats.R')
source('modules/dispTrackStats.R') source('modules/dispTrackStats.R')
source('modules/trajPlot.R') source('modules/trajPlot.R')
source('modules/trajRibbonPlot.R') source('modules/trajRibbonPlot.R')
source('modules/trajPsdPlot.R')
source('modules/boxPlot.R') source('modules/boxPlot.R')
source('modules/tabAUC.R') source('modules/tabAUC.R')
source('modules/clDistPlot.R') source('modules/clDistPlot.R')
......
...@@ -53,6 +53,7 @@ FCSVOUTLIERS = 'outliers.csv' ...@@ -53,6 +53,7 @@ FCSVOUTLIERS = 'outliers.csv'
FCSVTCCLEAN = 'tCoursesSelected_clean.csv' FCSVTCCLEAN = 'tCoursesSelected_clean.csv'
FPDFTCMEAN = "tCoursesMeans.pdf" FPDFTCMEAN = "tCoursesMeans.pdf"
FPDFTCSINGLE = "tCourses.pdf" FPDFTCSINGLE = "tCourses.pdf"
FPDFTCPSD = 'tCoursesPsd.pdf'
FPDFBOXAUC = 'boxplotAUC.pdf' FPDFBOXAUC = 'boxplotAUC.pdf'
FPDFBOXTP = 'boxplotTP.pdf' FPDFBOXTP = 'boxplotTP.pdf'
FPDFSCATTER = 'scatter.pdf' FPDFSCATTER = 'scatter.pdf'
......
...@@ -172,6 +172,9 @@ clustHierUI <- function(id, label = "Hierarchical CLustering") { ...@@ -172,6 +172,9 @@ clustHierUI <- function(id, label = "Hierarchical CLustering") {
tabPanel('Time-courses', tabPanel('Time-courses',
modTrajPlotUI(ns('modPlotHierTraj'))), modTrajPlotUI(ns('modPlotHierTraj'))),
tabPanel('PSD',
modPSDPlotUI(ns('modPlotHierPsd'))),
tabPanel('Cluster dist.', tabPanel('Cluster dist.',
modClDistPlotUI(ns('hierClDistPlot'), 'xxx')) modClDistPlotUI(ns('hierClDistPlot'), 'xxx'))
...@@ -528,13 +531,22 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i ...@@ -528,13 +531,22 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i
'.pdf') '.pdf')
}) })
createFnamePsdPlot = reactive({
paste0('clust_hierch_tCoursesPsd_',
s.cl.diss[as.numeric(input$selectPlotHierDiss)],
'_',
s.cl.linkage[as.numeric(input$selectPlotHierLinkage)],
'.pdf')
})
createFnameDistPlot = reactive({ createFnameDistPlot = reactive({
paste0('clust_hierch_clDist_', paste0('clust_hierch_clDist_',
s.cl.diss[as.numeric(input$selectPlotHierDiss)], s.cl.diss[as.numeric(input$selectPlotHierDiss)],
'_', '_',
s.cl.linkage[as.numeric(input$selectPlotHierLinkage)], '.pdf') }) s.cl.linkage[as.numeric(input$selectPlotHierLinkage)], '.pdf')
})
# Hierarchical - Heat Map - download pdf # Hierarchical - Heat Map - download pdf
...@@ -556,6 +568,13 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i ...@@ -556,6 +568,13 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i
in.facet.color = getClColHier, in.facet.color = getClColHier,
in.fname = createFnameRibbonPlot) in.fname = createFnameRibbonPlot)
# plot cluster PSD
callModule(modPSDPlot, 'modPlotHierPsd',
in.data = data4trajPlotCl,
in.facet = 'cl',
in.facet.color = getClColHier,
in.fname = createFnamePsdPlot)
# plot distribution barplot # plot distribution barplot
callModule(modClDistPlot, 'hierClDistPlot', callModule(modClDistPlot, 'hierClDistPlot',
in.data = data4clDistPlot, in.data = data4clDistPlot,
......
require(DT) require(DT)
# UI ----
modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") { modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
ns <- NS(id) ns <- NS(id)
...@@ -44,12 +45,14 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") { ...@@ -44,12 +45,14 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
) )
} }
# Server ----
modPSDPlot = function(input, output, session, modPSDPlot = function(input, output, session,
in.data, in.data,
in.fname,
in.facet = 'group', in.facet = 'group',
in.facet.color = NULL, in.facet.color = NULL
in.fname) { ) {
ns <- session$ns ns <- session$ns
...@@ -105,7 +108,7 @@ modPSDPlot = function(input, output, session, ...@@ -105,7 +108,7 @@ modPSDPlot = function(input, output, session,
in.fname = in.fname, in.fname = in.fname,
plotTraj, TRUE) plotTraj, TRUE)
plotPSD <- function() { plotTraj <- function() {
cat(file = stderr(), 'plotPSD: in\n') cat(file = stderr(), 'plotPSD: in\n')
locBut = input$butPlotTraj locBut = input$butPlotTraj
......
...@@ -823,6 +823,11 @@ shinyServer(function(input, output, session) { ...@@ -823,6 +823,11 @@ shinyServer(function(input, output, session) {
in.data.stim = data4stimPlot, in.data.stim = data4stimPlot,
in.fname = function() {return(FPDFTCSINGLE)}) in.fname = function() {return(FPDFTCSINGLE)})
# Trajectory plotting - PSD
callModule(modPSDPlot, 'modPSDPlot',
in.data = data4trajPlotNoOut,
in.fname = function() {return(FPDFTCPSD)})
# Tabs ---- # Tabs ----
###### AUC calculation and plotting ###### AUC calculation and plotting
......
...@@ -118,6 +118,12 @@ shinyUI(fluidPage( ...@@ -118,6 +118,12 @@ shinyUI(fluidPage(
uiOutput('varSelHighlight'), uiOutput('varSelHighlight'),
br(), br(),
modTrajPlotUI('modTrajPlot') modTrajPlotUI('modTrajPlot')
),
tabPanel(
"Power Spectral Density",
br(),
modPSDPlotUI('modPSDPlot')
) )
) )
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment