R/module_ideas.R

Defines functions module_ideas_server parse_vector_to_bullets setup_ideas_ui

setup_ideas_ui <- function(id) {
    ns <- shiny::NS(id)
    tabPanel(
        id,
        fluidPage(
            fluidRow(
                column(8,
                       h4("Important points"),
                       htmlOutput(ns("important_points")),
                       h4("Medium points"),
                       htmlOutput(ns("priority_points")),
                       h4("Potential points"),
                       htmlOutput(ns("potential_points"))
                )
            )
        )
    )
}

parse_vector_to_bullets <- function(vect, number=TRUE) {
    html_string <- paste0(
        "<li>",
        paste(vect, collapse="</li><li>"),
        "</li>"
    )
    
    if (!number) {
        list_style <- "ul"
    }
    else {
        list_style <- "ol"
    }
    
    sprintf("<%s>%s</%s>", list_style, html_string, list_style)
}

module_ideas_server <- function(input, output, session, module_name) {
    
    output$important_points <- renderUI({
        
        HTML(parse_vector_to_bullets(c(
            "More flexible way to assign statistical columns",
            "PCA: Allowing selection of subsets for which a recalculated PCA is shown - For instance omission of outliers",
            "Download tables",
            "Download figures buttons",
            "For datasets with redundant IDs - should more clever ways of mapping being allowed?"
        )))
    })
    
    output$priority_points <- renderUI({
        HTML(parse_vector_to_bullets(c(
            "Could consider allowing sample-matched comparisons, which would enable direct comparison in for instance PCA plot and calculating correlations",
            "PCA: Allow filtering to view subsets of PCA in efficient way (can be done by sample selection, but could be more useful)",
            "PCA: Facet view!",
            "Think about error messages, making sure they are clear, coherent and timely",
            "Plotly: Could allow selecting additional annotation information column for hover",
            "Think: How should sample mapping be performed? Design matrix, manual clicking or both (as now)?",
            "For volcano / MA - Allow fixing x/y axis to same range for all four plots"
        )))
    })
    
    output$potential_points <- renderUI({
        HTML(parse_vector_to_bullets(c(
            "More advanced ID mapping system would be beneficial (now required to uniquely match)",
            "Could use hexbins for summarizing scatter distribution when number of datapoints is huge",
            "Could do heatmap to illustrate feature expression / missing values",
            "Alternative view for scatter plot: Full screen one of the plots",
            "Think about documentation: Work through the help page, and do video at some point",
            "PCA: Illustrating PC distributions",
            "Histogram: Binning of continuous as alternative for coloring",
            "Histogram: Interatively show what type each column is for rapid overview",
            "PCA: Integrate more closely with scatter distribution by showing at same page",
            "Performing Hive plot or Circular plot as 'master illustration' overviewing the two datasets globally",
            "Do measures of similarity across datasets, such as correlation of fold changes or p-value orders",
            "Consider if limited unit testing is needed",
            "For Venn comparisons - compare presence of features, allowing for identifying features missing in certain dataset or conditions"
        )))
    })
}
ComputationalProteomics/OmicLoupe documentation built on Feb. 12, 2023, 3:57 p.m.