Launch Sashimi R-shiny application
Usage
launchSashimiApp(
...,
envir = parent.frame(),
options = list(width = 1200),
verbose = FALSE
)Arguments
- ...
additional arguments are passed to
sashimiAppConstants().- envir
environmentdefaultparent.frame()uses the environment which called this function. The environment contains data needed for sashimi plots. Ifenvir=NULLby default it will useparent.frame(). Otherwise callsashimiDataConstants()orsashimiAppConstants()which returns anenvironmentwith the necessary data objects, and that can be passed to this function.- options
listof R-shiny app options, for example two common options are:hostto indicate the host or IP address the R-shiny app will bind to respond to requests; andportfor the port number. For example:launchSashimiApp(options=list(host="0.0.0.0", port=8080))whereport="0.0.0.0"will listen to any request sent to the current machine, whether by host name, or any valid IP address; andport=8080will only listen to port 8080.
Value
shiny::shiny.appobj which is a Shiny App object,
suitable to run an R-shiny app by printing to console.
output from shiny::shinyApp() which is an object of
class "shiny.appobj", whose default print method is to run
the app.
Details
This function launches the Sashimi visualization R-shiny app.
The key input data should be supplied through argument
envir which should be prepared using
sashimiDataConstants(). It will prepare all the
necessary data to use.
Custom Parameters
The environment envir may have additional visual
customizations, which recognize the following names:
'panel_height', default
200pixels'gene_panel_height', default
400pixels'layout_ncol', default 1
'min_junction_reads', default
100'share_y_axis', default
FALSE'use_exon_range', default NULL
'gene_coords_default', default NULL
'label_junctions', default
TRUE'show_gene_model', default
TRUE'show_tx_model', default
TRUE'show_detected_tx', default
TRUE'font_sizing', default "Default", note it must match available choices in the UI: "-4 smaller" to "+4 larger".
'exon_font_sizing', default "Default", see comment for 'font-sizing', the same applies.
'junction_alpha', default
0.7for 70% opacity'junction_arc_factor', default "Default", note it must match available choices in the UI: "-2 flat" to "+3 higher".
'junction_arc_minimum', default
500'aboutExtra', default is html tag data suitable to render in an HTML section of the R-shiny web page. This entry is useful to describe the data or experiment underlying the Splicejam visualizations shown.
The environment is prepared by calling sashimiAppConstants()
which also defines aboutExtra and other UI elements.
It calls sashimiDataConstants() which will verify the
environment is usable.
Running within shiny-server
Create a file 'app.R' and include lines which create
the environment, for example:
# Prepare data
sjenv <- sashimiDataConstants(gtf=gtf, filesDF=filesDF)
# Add any customizations
sjenv$default_gene <- "Gria1";
sjenv$panel_height <- 100;
sjenv$gene_panel_height <- 200;
# Launch the app
launchSashimiApp()This file should be suitable to run the shiny server.
Note that the default will load Farris et al data into the
environment, controlled by empty_uses_farrisdata=TRUE.
Other data notes
The filesDF object should be a data.frame with
at least three colnames:
"sample_id""type"(with values either"bw"or"junction")"url"(a URL or file path to each file.)
In addition, it recognizes "scale_factor" with numeric
values used to scale (by multiplication) the corresponding
scores.
If coverage or junctions are available in multiple files for
the same 'sample_id', for example when using
replicates, use the same sample_id for each file, and
the coverage and junctions will be combined by taking the sum.
The optional "scale_factor" is applied to each file first,
which permits adjusting the files upfront.
The reason for using the sum is that the Splicejam visualization is intended to show the evidence supporting particular exons and junctions, and this evidence is built up across replicates.
For more direct control over the data preparation, including
tx2geneDF, detectedTx, exonsByGene, and flatExonsByGene,
see sashimiAppConstants() which calls sashimiDataConstants(),
both of these functions return an environment that contains the
required data.
When the R-shiny app is created, the ui and server components
have their environments set to envir - so their context will
include the variables defined in that environment.
Troubleshooting
Error
"SSL peer certificate or SSH remote key was not OK"or"SSL certificate problem: unable to get local issuer certificate"seen in the console output of the R shiny app.This error occurs when
launchSashimiApp()references coverage data on an external web server, for example when usingfarrisdataexample data. The remote web server certificates used withhttpsweb address are using a certificate whose issuer is not recognized.It means the authority that signed the certificate is not recognized as an approved authority.
There may be two workarounds to this issue:
If the certificate authority should be approved, sometimes on linux hosts it is enough to add certificate extensions, for example on Ubuntu, or Ubuntu Docker images, one may run
Other linux systems may require a different installation.
The certificate verification can be skipped temporarily. Define this option within the same R session:
Of course, this option should only be used in trusted circumstances, for example when accessing a local and trusted host.
Error
"covNames must be in colnames(GenomicRanges::values(gr))", or other error related tonames(covNames)ornames(covNamesL).These errors ultimately mean there was no available coverage data, which is usually caused by inability to access the coverage file itself. The web server may be offline, or may be denying connection. The path to the file may be incorrect.
Typically the coverage data is obtained from memoise cached data, and only when the cache is not available, or somehow incorrect, the data is retrieved from the file or remote server.
See also
Other Splicejam core functions:
sashimiDataConstants(),
splicejamDataFromTxDb(),
splicejamFigure()