Contents

1 Intro

shinyngs is a package designed to facilitate downstream analysis of RNA-seq and similar matrix data with various exploratory plots. It’s a work in progress, with new features added on a regular basis. Individual components (heatmaps, pca etc) can function independently and will be useful outside of the RNA-seq context.

Example: the gene page

2 Motivation

It’s not always trivial to quickly assess the results of next-generation sequencing experiment. shinyngs is designed to help fix that by providing a way of instantly producing a visual tool for data mining at the end of an analysis pipeline.

3 Features

4 Installation

4.1 Prerequisites

shinyngs relies heavily on SumamrizedExperiment. Formerly found in the GenomicRanges package, it now has its own package on Bioconductor: http://bioconductor.org/packages/release/bioc/html/SummarizedExperiment.html. This requires a recent version of R.

Graphical enhancements are provided by shinyBS and shinyjs

4.2 Install with devtools

library(devtools)
install_github('pinin4fjords/shinyngs')

5 Concepts and data structures

The data structures used by Shinyngs build on SummarizedExperiment. One SummarizedExperiment can have multiple ‘assays’, essentially matrices with samples in columns and ‘features’ (transcripts or genes) in rows, representing different results for the same features and samples. This is handy to compare results before and after processing, for example. ExploratorySummarizedExperiment extends SummarizedExperiment to include slots relating to annotation, and associated results of ‘tests’, providing p values and q values.

ExploratorySummarizedExperimentList is a container for one or more ExploratorySummarizedExperiment objects, and is intented to describe an overall study, i.e. one or more experiments the same set of samples, but different sets of features in each experiment. The ExploratorySummarizedExperimentListList therefore is used to supply study-wide things such as contrasts, gene sets, url roots for creating links etc.

6 Quickstart: working from a SummarizedExperiment

To see how to quickly build an RNA-seq app from a simple SummarizedExperiment, we can use the example data in the airway package. We just convert the RangedSummarizedExperiment to an ExploratorySummarizedExperiment, and add it to a list of such objects, which represent a study.

library(shinyngs)

data(airway, package = 'airway')
ese <- as(airway, 'ExploratorySummarizedExperiment')
eselist <- ExploratorySummarizedExperimentList(ese)

Then we build and run the app. For example, a basic app just for heatmaps:

app <- prepareApp('heatmap', eselist)
shiny::shinyApp(ui = app$ui, server = app$server)

… or a more comprehensive one with multiple panels aimed at RNA-seq:

app <- prepareApp('rnaseq', eselist)
shiny::shinyApp(ui = app$ui, server = app$server)

Airway provides some info about the dataset, which we can add in to the object before we build the app:

expinfo <- packageDescription('airway')
eselist <- ExploratorySummarizedExperimentList(
  ese,
  title = expinfo$Title,
  author = expinfo$Author,
  description = expinfo$Description
)
app <- prepareApp('rnaseq', eselist)
shiny::shinyApp(ui = app$ui, server = app$server)

All this app knows about is gene IDs, however, which aren’t all that informative for gene expression plots etc. We can add row metadata to fix that:

# Use Biomart to retrieve some annotation, and add it to the object

library(biomaRt)
attributes <- c(
  'ensembl_gene_id', # The sort of ID your results are keyed by
  'entrezgene', # Will be used mostly for gene set based stuff
  'external_gene_name' # Used to annotate gene names on the plot
)

mart <- useMart(biomart = 'ENSEMBL_MART_ENSEMBL', dataset = 'hsapiens_gene_ensembl', host='www.ensembl.org')
annotation <- getBM(attributes = attributes, mart = mart)
annotation <- annotation[order(annotation$entrezgene),]

mcols(ese) <- annotation[match(rownames(ese), annotation$ensembl_gene_id),]

# Tell shinyngs what the ids are, and what field to use as a label

ese@idfield <- 'ensembl_gene_id'
ese@labelfield <- 'external_gene_name'

# Re-build the app

eselist <- ExploratorySummarizedExperimentList(
  ese,
  title = expinfo$Title,
  author = expinfo$Author,
  description = expinfo$Description
)
app <- prepareApp('rnaseq', eselist)
shiny::shinyApp(ui = app$ui, server = app$server)

7 More complex use case: the zhangneurons Example dataset

airway is fine, but it contains no information on differential expression. shinyngs provides extra slots for differential analyses, among other things.

An example ExploratorySummarizedExperimentList based on the Zhang et al study of neurons and glia (http://www.jneurosci.org/content/34/36/11929.long) is included in the package, and this can be used to demonstrate available features. The dataset includes transcript- and gene- level quantification estimates (as ExporatorySummarizedExperiments within an ExploratorySummarizedExperimentList, and three levels of processing (raw, filtered, normalised) in the assays slots of each.

Note: this data was generated while testing Kallisto (https://pachterlab.github.io/kallisto/) for quantification, and results may therefore be slightly different to the authors’ online tool (which did not use Kallisto).

library(shinyngs)
data("zhangneurons")

7.1 Use example data to make some applications

An example ExploratorySummarizedExperimentList based on the Zhang et al study of neurons and glia (http://www.jneurosci.org/content/34/36/11929.long) is included in the package, and this can be used to demonstrate available features.

app <- prepareApp("rnaseq", zhangneurons)
shiny::shinyApp(app$ui, app$server)

Note the use of prepareApp to generate the proper ui and server, which are then passed to Shiny. This example generates the full application designed for RNA-seq analysis. But apps with just individual components can be created too:

app <- prepareApp("heatmap", zhangneurons)
shiny::shinyApp(app$ui, app$server)

8 Building an application from scratch

To demonstrate this, let’s break down zhangneurons into simple datatypes and put it back together again.

8.1 Assays

# Assays is a list of matrices
myassays <- as.list(SummarizedExperiment::assays(zhangneurons[[1]]))
head(myassays[[1]])
##                    SRR1033791 SRR1033797 SRR1033793 SRR1033786 SRR1033799
## ENSMUSG00000000001      66.55      93.42      49.04      82.14      85.29
## ENSMUSG00000000028       3.70       5.63       4.03       2.07       7.38
## ENSMUSG00000000031       0.62       7.10       1.10       0.67       7.08
## ENSMUSG00000000037       0.54       6.08       1.52       4.69       6.60
## ENSMUSG00000000056      77.67      33.23      43.62      29.81      34.58
## ENSMUSG00000000058       2.25      27.20       0.96       7.19      26.55
##                    SRR1033788 SRR1033783 SRR1033784 SRR1033787 SRR1033792
## ENSMUSG00000000001      52.57      80.94     102.30      77.46      58.48
## ENSMUSG00000000028      13.97       6.17       6.41       8.20       1.96
## ENSMUSG00000000031       1.51       2.63       7.71       1.38       0.48
## ENSMUSG00000000037       5.79       5.72      13.14      12.52       1.09
## ENSMUSG00000000056      21.33      23.00      17.60      23.62      72.15
## ENSMUSG00000000058      39.83      15.29      25.56      58.80       3.26
##                    SRR1033785 SRR1033798 SRR1033796 SRR1033794 SRR1033789
## ENSMUSG00000000001      58.85      79.33     160.54      29.84     113.04
## ENSMUSG00000000028       2.11       5.58      14.17       0.77       2.93
## ENSMUSG00000000031       2.36       6.06       5.99       1.04       0.47
## ENSMUSG00000000037       6.02       6.07       1.08       0.18       3.07
## ENSMUSG00000000056      38.68      38.94      44.87      31.35      40.60
## ENSMUSG00000000058       7.42      26.48     144.01       1.92      18.45
##                    SRR1033795 SRR1033790
## ENSMUSG00000000001     174.29      65.92
## ENSMUSG00000000028      11.94       2.87
## ENSMUSG00000000031       4.16       0.62
## ENSMUSG00000000037       1.27       1.21
## ENSMUSG00000000056      46.06      44.69
## ENSMUSG00000000058     150.93      10.22

8.2 colData

colData is your sample information defining groups etc

mycoldata <- data.frame(SummarizedExperiment::colData(zhangneurons[[1]]))
head(mycoldata)
##                source_name    strain          tissue
## SRR1033791 cerebral cortex FVN/Swiss cerebral cortex
## SRR1033797    whole cortex FVN/Swiss cerebral cortex
## SRR1033793 cerebral cortex FVN/Swiss cerebral cortex
## SRR1033786 cerebral cortex FVN/Swiss cerebral cortex
## SRR1033799    whole cortex FVN/Swiss cerebral cortex
## SRR1033788 cerebral cortex FVN/Swiss cerebral cortex
##                                  cell_type BioSampleModel
## SRR1033791    myelinating oligodendrocytes           <NA>
## SRR1033797                            <NA>   whole cortex
## SRR1033793                       microglia           <NA>
## SRR1033786                          neuron           <NA>
## SRR1033799                            <NA>   whole cortex
## SRR1033788 oligodendrocyte precursor cells           <NA>
##            myelinating_oligodendrocytes microglia neuron
## SRR1033791                            1         0      0
## SRR1033797                           NA        NA     NA
## SRR1033793                            0         1      0
## SRR1033786                            0         0      1
## SRR1033799                           NA        NA     NA
## SRR1033788                            0         0      0
##            oligodendrocyte_precursor_cells Astrocyte endothelial_cells
## SRR1033791                               0         0                 0
## SRR1033797                              NA        NA                NA
## SRR1033793                               0         0                 0
## SRR1033786                               0         0                 0
## SRR1033799                              NA        NA                NA
## SRR1033788                               1         0                 0
##            newly_formed_oligodendrocytes
## SRR1033791                             0
## SRR1033797                            NA
## SRR1033793                             0
## SRR1033786                             0
## SRR1033799                            NA
## SRR1033788                             0

8.3 Annotation

Annotation is important to `shinyngs’. You need a data frame with rows corresonding to those in the assays

myannotation <- SummarizedExperiment::mcols(zhangneurons[[1]])
head(myannotation)
## DataFrame with 6 rows and 9 columns
##      ensembl_gene_id entrezgene chromosome_name start_position
##          <character>  <integer>     <character>      <integer>
## 1 ENSMUSG00000000001      14679               3      108107280
## 2 ENSMUSG00000000028      12544              16       18780447
## 3 ENSMUSG00000000031         NA               7      142575529
## 4 ENSMUSG00000000037     107815               X      161117193
## 5 ENSMUSG00000000056      67608              11      121237253
## 6 ENSMUSG00000000058      12390               6       17281185
##   end_position    strand external_gene_name
##      <integer> <integer>        <character>
## 1    108146146        -1              Gnai3
## 2     18811987        -1              Cdc45
## 3    142578143        -1                H19
## 4    161258213         1              Scml2
## 5    121255856         1               Narf
## 6     17289115         1               Cav2
##                                                                                            description
##                                                                                            <character>
## 1 guanine nucleotide binding protein (G protein), alpha inhibiting 3 [Source:MGI Symbol;Acc:MGI:95773]
## 2                                           cell division cycle 45 [Source:MGI Symbol;Acc:MGI:1338073]
## 3                     H19, imprinted maternally expressed transcript [Source:MGI Symbol;Acc:MGI:95891]
## 4                           sex comb on midleg-like 2 (Drosophila) [Source:MGI Symbol;Acc:MGI:1340042]
## 5                            nuclear prelamin A recognition factor [Source:MGI Symbol;Acc:MGI:1914858]
## 6                                                        caveolin 2 [Source:MGI Symbol;Acc:MGI:107571]
##     gene_biotype
##      <character>
## 1 protein_coding
## 2 protein_coding
## 3        lincRNA
## 4 protein_coding
## 5 protein_coding
## 6 protein_coding

8.4 Making an ExploratorySummarizedExperiment

Now we can put these things together to create an ’ExploratorySummarizedExperiment:

myese <- ExploratorySummarizedExperiment(
    assays = SimpleList(
      myassays
    ),
    colData = DataFrame(mycoldata),
    annotation <- myannotation,
    idfield = 'ensembl_gene_id',
    entrezgenefield = "entrezgene",
    labelfield = "external_gene_name"
  )
print(myese)
## class: ExploratorySummarizedExperiment 
## dim: 44563 17 
## metadata(0):
## assays(3): normalised-filtered filtered raw
## rownames(44563): ENSMUSG00000000001 ENSMUSG00000000028 ...
##   ENSMUSG00000108813 ENSMUSG00000108814
## metadata column names(9): ensembl_gene_id entrezgene ...
##   description gene_biotype
## colnames(17): SRR1033791 SRR1033797 ... SRR1033795 SRR1033790
## colData names(12): source_name strain ... endothelial_cells
##   newly_formed_oligodendrocytes

Note the extra fields that mostly tell shinyngs about annotation to help with labelling etc.

8.5 Making an ExploratorySummarizedExperimentList

ExploratorySummarizedExperimentLists are basically a list of ExploratorySummarizedExperiments, with additional metadata slots.

myesel <- ExploratorySummarizedExperimentList(
  eses = list(expression = myese),
  title = "My title",
  author = "My Authors",
  description = 'Look what I gone done'
)

You can use this object to make an app straight away:

app <- prepareApp("rnaseq", myesel)
shiny::shinyApp(app$ui, app$server)

… but it’s of limited usefulness because the sample groupings are not highlighted. We need to specify group_vars for that to happen, picking column names from the colData:

myesel@group_vars <- c('cell_type', 'source_name')

.. then if we re-make the app you should see group highlighting.

app <- prepareApp("rnaseq", myesel)
shiny::shinyApp(app$ui, app$server)

… for example, in the PCA plot

Example: the gene page

8.6 Specifying contrasts for differential outputs

But where are the extra plots for looking at differential expression? For those, we need to supply contrasts. Contrasts are supplied as a list of character vectors describing the variable in colData upon the contrast is based, and the two values of that variable to use in the comparison. We’ll just copy the one over from the original zhangneurons:

zhangneurons@contrasts
## [[1]]
## [1] "myelinating_oligodendrocytes" "0"                           
## [3] "1"                           
## 
## [[2]]
## [1] "microglia" "0"         "1"        
## 
## [[3]]
## [1] "neuron" "0"      "1"     
## 
## [[4]]
## [1] "oligodendrocyte_precursor_cells" "0"                              
## [3] "1"                              
## 
## [[5]]
## [1] "Astrocyte" "0"         "1"        
## 
## [[6]]
## [1] "endothelial_cells" "0"                 "1"                
## 
## [[7]]
## [1] "newly_formed_oligodendrocytes" "0"                            
## [3] "1"
myesel@contrasts <- zhangneurons@contrasts

Run the app again and you should see tables of differential expression, and scatter plots between pairs of conditions.

app <- prepareApp("rnaseq", myesel)
shiny::shinyApp(app$ui, app$server)

But without information on the significance of the fold changes, we can’t make things like volcano plots. For those we need to populate the tests slot. Tests is a list of lists of matrices in the ExploratorySummarizedExperiment objects, with list names matching one or more of the names in assays, second-level names being ‘pvals’ and ‘qvals’ and the columns of each matrix corresponding the the contrasts slot of the containing ExploratorySummarizedExperimentList:

head(zhangneurons[[1]]@tests[[1]]$pvals, n = 10)
##                    myelinating_oligodendrocytes.0.1 microglia.0.1
## ENSMUSG00000000001                       0.47850750   0.056743653
## ENSMUSG00000000028                       0.24991847   0.154576531
## ENSMUSG00000000031                       0.05048976   0.295389334
## ENSMUSG00000000037                       0.06771807   0.070583137
## ENSMUSG00000000056                       0.02208216   0.878797647
## ENSMUSG00000000058                       0.02362989   0.004614716
## ENSMUSG00000000078                       0.03436371   0.734388412
## ENSMUSG00000000085                       0.37694576   0.300080726
## ENSMUSG00000000088                       0.38053520   0.945134257
## ENSMUSG00000000093                       0.13918142   0.303400238
##                    neuron.0.1 oligodendrocyte_precursor_cells.0.1
## ENSMUSG00000000001  0.6733486                           0.5506333
## ENSMUSG00000000028  0.1024362                           0.1627799
## ENSMUSG00000000031  0.5761710                           0.5357782
## ENSMUSG00000000037  0.7145292                           0.1768704
## ENSMUSG00000000056  0.7048541                           0.1674586
## ENSMUSG00000000058  0.1374017                           0.6492619
## ENSMUSG00000000078  0.1504584                           0.1626477
## ENSMUSG00000000085  0.3802327                           0.8644854
## ENSMUSG00000000088  0.9487188                           0.3213803
## ENSMUSG00000000093  0.5392341                           0.2456431
##                    Astrocyte.0.1 endothelial_cells.0.1
## ENSMUSG00000000001    0.81475266          1.160932e-02
## ENSMUSG00000000028    0.88684704          4.710562e-02
## ENSMUSG00000000031    0.06844833          7.588844e-02
## ENSMUSG00000000037    0.15221201          1.441416e-01
## ENSMUSG00000000056    0.09094363          6.958057e-01
## ENSMUSG00000000058    0.56709919          3.825394e-04
## ENSMUSG00000000078    0.14563145          1.195709e-02
## ENSMUSG00000000085    0.88522425          7.467989e-01
## ENSMUSG00000000088    0.05432401          1.076220e-01
## ENSMUSG00000000093    0.46805628          4.528361e-11
##                    newly_formed_oligodendrocytes.0.1
## ENSMUSG00000000001                        0.86714613
## ENSMUSG00000000028                        0.26892526
## ENSMUSG00000000031                        0.04616106
## ENSMUSG00000000037                        0.43090656
## ENSMUSG00000000056                        0.84652660
## ENSMUSG00000000058                        0.36493392
## ENSMUSG00000000078                        0.10386860
## ENSMUSG00000000085                        0.61100807
## ENSMUSG00000000088                        0.90073790
## ENSMUSG00000000093                        0.21124484

Again, we’ll just copy those data from zhangneurons for demonstration purposes:

myesel[[1]]@tests <- zhangneurons[[1]]@tests

Now the RNA-seq app is more or less complete, and you should see volcano plots under ‘Differential’:

app <- prepareApp("rnaseq", myesel)
shiny::shinyApp(app$ui, app$server)

9 Gene sets

Many displays are more useful if they can be limited to biologically meaningful sets of genes. The gene_sets slot is designed to allow that. Gene sets are stored as lists of character vectors of gene identifiers, each list keyed by the name of the metadata column to which they pertain.

9.1 Adding gene sets to enable gene set filtering

The constructor for ExploratorySummarizedExperimentList assumes that gene sets are represented by Entrez IDs, as is common with resources such as the Molecular Signatures Database, and that they are specified as a list of GeneSetCollections. You might generate such a list as follows:

genesets_files = list(
  'KEGG' =  "/path/to/MSigDB/c2.cp.kegg.v5.0.entrez.gmt",
  'MSigDB canonical pathway' = "/path/to/MSigDB/c2.cp.v5.0.entrez.gmt",
  'GO biological process' = "/path/to/MSigDB/c5.bp.v5.0.entrez.gmt",
  'GO cellular component' = "/path/to/MSigDB/c5.cc.v5.0.entrez.gmt",
  'GO molecular function' = "/path/to/MSigDB/c5.mf.v5.0.entrez.gmt",
  'MSigDB hallmark'= "/path/to/MSigDB/h.all.v5.0.entrez.gmt"
)

gene_sets <- lapply(genesets_files, GSEABase::getGmt)

Then provide them during object creation:

myesel <- ExploratorySummarizedExperimentList(
  eses = list(expression = myese),
  title = "My title",
  author = "My Authors",
  description = 'Look what I gone done',
  gene_sets = gene_sets
)

These are then converted internally to a list of lists of character vectors of gene IDs. The top level is keyed by the type of gene ID to be used for labelling (stored in labelfield' onExploratorySummarisedExperiments`, the next level by the type of gene set.

For the zhangneurons example, gene sets are stored by external_gene_name:

names(zhangneurons@gene_sets)
## [1] "external_gene_name"

6 types of gene set are used. For example, KEGG:

names(zhangneurons@gene_sets$external_gene_name$KEGG)[1:10]
##  [1] "KEGG_GLYCOLYSIS_GLUCONEOGENESIS"              
##  [2] "KEGG_CITRATE_CYCLE_TCA_CYCLE"                 
##  [3] "KEGG_PENTOSE_PHOSPHATE_PATHWAY"               
##  [4] "KEGG_PENTOSE_AND_GLUCURONATE_INTERCONVERSIONS"
##  [5] "KEGG_FRUCTOSE_AND_MANNOSE_METABOLISM"         
##  [6] "KEGG_GALACTOSE_METABOLISM"                    
##  [7] "KEGG_ASCORBATE_AND_ALDARATE_METABOLISM"       
##  [8] "KEGG_FATTY_ACID_METABOLISM"                   
##  [9] "KEGG_STEROID_BIOSYNTHESIS"                    
## [10] "KEGG_PRIMARY_BILE_ACID_BIOSYNTHESIS"

We can find the list of KEGG gluconeogenesis genes, keyed by the original Entrez ID:

zhangneurons@gene_sets$external_gene_name$KEGG$KEGG_GLYCOLYSIS_GLUCONEOGENESIS
##     13382     14751     68263    110695     18534     72157     74551 
##     "Dld"    "Gpi1"    "Pdhb" "Aldh7a1"    "Pck1"    "Pgm2"    "Pck2" 
##     60525     66681    235339    230163     14377     18642     26876 
##   "Acss2"    "Pgm1"    "Dlat"   "Aldob"    "G6pc"    "Pfkm"    "Adh4" 
##     11670     56421     11676     18655     16833     15277     18770 
## "Aldh3a1"    "Pfkp"   "Aldoc"    "Pgk1"    "Ldhc"     "Hk2"    "Pklr" 
##     11529     18648     18746     14378    103988     11671     14121 
##    "Adh7"   "Pgam1"     "Pkm"   "G6pc2"     "Gck" "Aldh3a2"    "Fbp1" 
##     11669     56752     12183    212032     16832     18641     14120 
##   "Aldh2" "Aldh9a1"    "Bpgm"     "Hk3"    "Ldhb"    "Pfkl"    "Fbp2" 
##     68738     56012     16828     18663     11532     56847     13808 
##   "Acss1"   "Pgam2"    "Ldha"    "Pgk2"    "Adh5" "Aldh1a3"    "Eno3" 
##    106557    319625     11522     67689     13807     58810     15275 
## "Ldhal6b"    "Galm"    "Adh1" "Aldh3b1"    "Eno2"  "Akr1a1"     "Hk1" 
##     14433     72535     18597     11674     21991     13806 
##   "Gapdh" "Aldh1b1"   "Pdha1"   "Aldoa"    "Tpi1"   "Eno1b"

Of course if you want to avoid the constructor, you can replicate that data structure and set the @gene_sets directly.

9.2 Gene set analysis

Gene set analyses can be stored as a list of tables in the @gene_set_analyses slot of an ExploratorySummarizedExperiment, supplied via the gene_set_analyses argument to its constructor. The list is keyed at three levels representing the assay, the gene set type and contrast involved. Illustrated with zhangneurons again:

names(zhangneurons$gene@gene_set_analyses)
## [1] "normalised-filtered"
names(zhangneurons$gene@gene_set_analyses$`normalised-filtered`)
## [1] "KEGG"                     "MSigDB canonical pathway"
## [3] "GO biological process"    "GO cellular component"   
## [5] "GO molecular function"    "MSigDB hallmark"
names(zhangneurons$gene@gene_set_analyses$`normalised-filtered`$KEGG)
## [1] "myelinating_oligodendrocytes:0-1"   
## [2] "microglia:0-1"                      
## [3] "neuron:0-1"                         
## [4] "oligodendrocyte_precursor_cells:0-1"
## [5] "Astrocyte:0-1"                      
## [6] "endothelial_cells:0-1"              
## [7] "newly_formed_oligodendrocytes:0-1"
head(zhangneurons$gene@gene_set_analyses$`normalised-filtered`$KEGG$`myelinating_oligodendrocytes:0-1`)
##                                                   NGenes PropDown PropUp
## KEGG_METABOLISM_OF_XENOBIOTICS_BY_CYTOCHROME_P450     36     0.14   0.36
## KEGG_P53_SIGNALING_PATHWAY                            62     0.44   0.05
## KEGG_PYRUVATE_METABOLISM                              37     0.11   0.35
## KEGG_REGULATION_OF_AUTOPHAGY                          19     0.11   0.37
## KEGG_COLORECTAL_CANCER                                61     0.25   0.10
## KEGG_MTOR_SIGNALING_PATHWAY                           51     0.24   0.06
##                                                   Direction PValue
## KEGG_METABOLISM_OF_XENOBIOTICS_BY_CYTOCHROME_P450        Up 0.0003
## KEGG_P53_SIGNALING_PATHWAY                             Down 0.0004
## KEGG_PYRUVATE_METABOLISM                                 Up 0.0006
## KEGG_REGULATION_OF_AUTOPHAGY                             Up 0.0009
## KEGG_COLORECTAL_CANCER                                 Down 0.0009
## KEGG_MTOR_SIGNALING_PATHWAY                            Down 0.0016
##                                                          FDR
## KEGG_METABOLISM_OF_XENOBIOTICS_BY_CYTOCHROME_P450 0.03162000
## KEGG_P53_SIGNALING_PATHWAY                        0.03162000
## KEGG_PYRUVATE_METABOLISM                          0.03162000
## KEGG_REGULATION_OF_AUTOPHAGY                      0.03162000
## KEGG_COLORECTAL_CANCER                            0.03162000
## KEGG_MTOR_SIGNALING_PATHWAY                       0.04480909

This data struture is a bit cumbersome, and I’m thinking of ways of better representing such data and the associated contrasts.

10 Other options

Further options are available - for example supplying url_roots in the ExploratorySummarizedExperimentList will add link-outs where appropriate, and the description slot is handy for providing details of analysis to the user.

11 Included modules

shinyngs is build on a number of components built using Shiny’s module framework, many of which are used multiple times in complex applications such as the one described above for RNA-seq.

Included modules are currently:

So for example heatmap uses selectmatrix to provide the UI controls to subselect the supplied matrices as well as the code which reads the output of those controls to actually derive the subsetted matrix. Shiny modules make this recycling of code much, much simpler than it would be otherwise.

Many of these can be called individually, for example to make an app for dendrograms only:

app <- prepareApp('dendro', eselist)
shiny::shinyApp(ui = app$ui, server = app$server)

12 Technical information

For technical information on package layout and functions, consult the package documentation:

?shinyngs

13 Running on a shiny server

Just use the commands sets above with shinyApp() in a file called app.R in a directory of its own on your Shiny server. For example, If you’re created an ExploratorySummarizedExperiment and saved it to a file called ‘data.rds’:

library(shinyngs)

mydata <- readRDS("data.rds")

app <- prepareApp("rnaseq", mydata)
shiny::shinyApp(app$ui, app$server)