mgGeneSetSummaryByGene: A module to show a tabular view of genesets that contain...

View source: R/mgGeneSetSummaryByGenes-module.R

mgGeneSetSummaryByGeneR Documentation

A module to show a tabular view of genesets that contain genes of interest.

Description

This provides a shiny module over the [sparrow::geneSetSummaryByGenes()] functionality. It accepts a SparrowResult and a feature query and will enumerate the other genesets in the SparrowResult that include those genes.

Usage

mgGeneSetSummaryByGene(input, output, session, src, features, method, fdr)

mgGeneSetSummaryByGeneUI(id)

Arguments

input, output, session

shiny bits

src

A [SparrowResultContainer()]

features

a character vector of feature id's to query

method, fdr

the GSEA method and FDR threshold used to filter the returned gene sets against. Gene sets with features found in 'features' who don't make the 'fdr' cutoff under the specific GSEA 'method' will not be returned

id

the namespace for the UI element

Details

This is useful when you are exploring GSEA hits and find esoteric results there. You can select some of the "more extreme" genes in that geneset, for instance to see if they belong to another one that makes more sense to you given the biological context of your experiment.

When the 'genesets_sigonly' checkbox is selected, gene sets with an FDR below the indicated 'fdr' are returned, otherwise all gene sets that include any of the feautures in the query are returned.

Value

a reactive list that contains the following reactives

$others

the result from [sparrow::geneSetSummaryByGenes()] given the query params

$selected

the key of the user-selected geneset from the table

Functions

  • mgGeneSetSummaryByGeneUI: the UI for the module

Examples

# Retrieve some genes to query the result so we can identify other gene sets
# they belong to.
sres <- sparrow::exampleSparrowResult()
set.seed(0xBEEF)
query <- sample(sparrow::featureIds(sparrow::geneSetDb(sres)), 10)
app <- shiny::shinyApp(
  ui = shiny::shinyUI(shiny::fluidPage(
    exampleUISetup(),
    title = "Gene Set Summary by Gene",
    mgGeneSetSummaryByGeneUI("mod"))),
  server = function(input, output, session) {
    src <- shiny::reactive(SparrowResultContainer(sres))
    ftrs <- shiny::reactive(query)
    method <- reactive("camera")
    fdr <- reactive(0.10)
    shiny::callModule(mgGeneSetSummaryByGene, "mod", src, ftrs, method, fdr)
  })
if (interactive()) {
  shiny::runApp(app)
}

lianos/sparrow.shiny documentation built on Oct. 12, 2023, 2:43 a.m.