Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize app into multiple pages #8

Closed
ArtPoon opened this issue Jul 24, 2017 · 6 comments
Closed

Reorganize app into multiple pages #8

ArtPoon opened this issue Jul 24, 2017 · 6 comments
Assignees

Comments

@ArtPoon
Copy link
Contributor

ArtPoon commented Jul 24, 2017

Currently the entire analysis setup is contained on a single page, two columns (interface on left and feedback on right). This looks quite overwhelming for the user, and I think it would be simpler and cleaner to partition this workflow into separate pages as follows:

  1. Splash page and tree input
  • Brief explanation of what Kaphi does
  • Interface for loading a tree (explain what kind of tree needs to be uploaded, i.e., rooted binary)
  • next button
  1. SMC settings
  • Brief explanation of SMC
  • interface for SMC settings
  • previous and next buttons to switch left and right, respectively
  1. Prior settings
  • Brief explanation of Bayesian inference and prior distributions
  • interface for prior distributions
  • same previous and next buttons as before
  1. Review and run
  • summary of tree, SMC and prior settings to review (can navigate back to previous pages)
  • user executes run, starts getting feedback
@0ldM4j0r
Copy link
Collaborator

The following link shows the app layouts achievable via shiny.

The app layouts are:

  • Sidebar Layout
  • Grid Layout
  • Tabsets (The layout used right now)
  • Navlists
  • Navbar Pages (The layout I believe is closest to the separate pages concept above)

@0ldM4j0r 0ldM4j0r self-assigned this Sep 7, 2017
@0ldM4j0r
Copy link
Collaborator

A basic implementation of a multipage app is on the multiPageApp branch, now i need to automate graph generation from the tsv file.

@0ldM4j0r
Copy link
Collaborator

0ldM4j0r commented Oct 2, 2017

I am trying to generate graphs from the tsv file after its creation (just to reduce complexity, eventually this will happen during creation), but I get the error:Error in xy.coords: 'x' is a list, but does not have components 'x' and 'y' when using the following code:

observe(
        lapply(seq_len(length(parameters[[input$specificModel]])), function(i) {
          output[[paste0("meanTrajectoryOf", parameters[[input$specificModel]][[i]])]] <- renderPlot(
            plot(
              sapply(split(trace[[parameters[[input$specificModel]][[i]]]]*trace$weight, trace$n), sum),
              ylim=c(0, 2),
              type='o',
              xlab='Iteration',
              ylab=paste0('Mean', parameters[[input$specificModel]][[i]]),
              cex.lab=1,
              main=paste0('Trajectory of Mean ',  parameters[[input$specificModel]][[i]], ' (',  input$specificModel, ' Model)')
            )
          )
        })
      )

which is based on the following code from the example-yule.R file:

plot(
  sapply(split(trace$lambda*trace$weight, trace$n), sum), 
  ylim=c(0, 2), 
  type='o',
  xlab='Iteration', 
  ylab='Mean lambda',
  cex.lab=1,
  main='Trajectory of Mean Lambda (Yule Model, 1000 particles)'
)

@0ldM4j0r
Copy link
Collaborator

0ldM4j0r commented Oct 2, 2017

I commented out the following four lines but that didn't change the error:

ylim=c(0, 2),
type='o',
xlab='Iteration',
ylab=paste0('Mean', parameters[[input$specificModel]][[i]]),
cex.lab=1,
main=paste0('Trajectory of Mean ',  parameters[[input$specificModel]][[i]], ' (',  input$specificModel, ' Model)')

I plotted rnorm(100) just to check that the plot outputting is working fine and it is.
After that I hard coded it and the error still occurs, code used:

output[[paste0("meanTrajectoryOflambda")]] <- renderPlot(
        plot( sapply(split(trace$lambda*trace$weight, trace$n), sum))
)

@gtng92
Copy link
Collaborator

gtng92 commented Oct 4, 2017

A comment on the error below mentioned earlier in this thread:

Error in xy.coords(x, y, xlabel, ylabel, log) : 
  'x' is a list, but does not have components 'x' and 'y'

This occurs when the .tsv file contains only the header row, and no data. Usually when either the run breaks, or the run isn't finished and hasn't fully completed creating the file.

@0ldM4j0r
Copy link
Collaborator

0ldM4j0r commented Oct 7, 2017

I will be closing this issue since I managed to reorganize the app in multiple pages. I also managed to plot the mean trajectory of the parameters after the tsv generation.

I will be opening two issues one to workout the errors from the posterior approximation graphs, and the other to implement plotting mean trajectory and posterior approximation graphs during tsv generation.

@0ldM4j0r 0ldM4j0r closed this as completed Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants