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')
source('modules/dispTrackStats.R')
source('modules/trajPlot.R')
source('modules/trajRibbonPlot.R')
source('modules/trajPsdPlot.R')
source('modules/boxPlot.R')
source('modules/tabAUC.R')
source('modules/clDistPlot.R')
......
......@@ -53,6 +53,7 @@ FCSVOUTLIERS = 'outliers.csv'
FCSVTCCLEAN = 'tCoursesSelected_clean.csv'
FPDFTCMEAN = "tCoursesMeans.pdf"
FPDFTCSINGLE = "tCourses.pdf"
FPDFTCPSD = 'tCoursesPsd.pdf'
FPDFBOXAUC = 'boxplotAUC.pdf'
FPDFBOXTP = 'boxplotTP.pdf'
FPDFSCATTER = 'scatter.pdf'
......
......@@ -172,6 +172,9 @@ clustHierUI <- function(id, label = "Hierarchical CLustering") {
tabPanel('Time-courses',
modTrajPlotUI(ns('modPlotHierTraj'))),
tabPanel('PSD',
modPSDPlotUI(ns('modPlotHierPsd'))),
tabPanel('Cluster dist.',
modClDistPlotUI(ns('hierClDistPlot'), 'xxx'))
......@@ -528,13 +531,22 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i
'.pdf')
})
createFnamePsdPlot = reactive({
paste0('clust_hierch_tCoursesPsd_',
s.cl.diss[as.numeric(input$selectPlotHierDiss)],
'_',
s.cl.linkage[as.numeric(input$selectPlotHierLinkage)],
'.pdf')
})
createFnameDistPlot = reactive({
paste0('clust_hierch_clDist_',
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
......@@ -556,6 +568,13 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i
in.facet.color = getClColHier,
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
callModule(modClDistPlot, 'hierClDistPlot',
in.data = data4clDistPlot,
......
require(DT)
# UI ----
modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
ns <- NS(id)
......@@ -44,12 +45,14 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
)
}
# Server ----
modPSDPlot = function(input, output, session,
in.data,
in.data,
in.fname,
in.facet = 'group',
in.facet.color = NULL,
in.fname) {
in.facet.color = NULL
) {
ns <- session$ns
......@@ -105,7 +108,7 @@ modPSDPlot = function(input, output, session,
in.fname = in.fname,
plotTraj, TRUE)
plotPSD <- function() {
plotTraj <- function() {
cat(file = stderr(), 'plotPSD: in\n')
locBut = input$butPlotTraj
......
......@@ -823,6 +823,11 @@ shinyServer(function(input, output, session) {
in.data.stim = data4stimPlot,
in.fname = function() {return(FPDFTCSINGLE)})
# Trajectory plotting - PSD
callModule(modPSDPlot, 'modPSDPlot',
in.data = data4trajPlotNoOut,
in.fname = function() {return(FPDFTCPSD)})
# Tabs ----
###### AUC calculation and plotting
......
......@@ -118,6 +118,12 @@ shinyUI(fluidPage(
uiOutput('varSelHighlight'),
br(),
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