Title: | R Interface to epiviz web app |
---|---|
Description: | This package provides connections to the epiviz web app (http://epiviz.cbcb.umd.edu) for interactive visualization of genomic data. Objects in R/bioc interactive sessions can be displayed in genome browser tracks or plots to be explored by navigation through genomic regions. Fundamental Bioconductor data structures are supported (e.g., GenomicRanges and RangedSummarizedExperiment objects), while providing an easy mechanism to support other data structures (through package epivizrData). Visualizations (using d3.js) can be easily added to the web app as well. |
Authors: | Hector Corrada Bravo, Florin Chelaru, Llewellyn Smith, Naomi Goldstein, Jayaram Kancherla, Morgan Walter, Brian Gottfried |
Maintainer: | Hector Corrada Bravo <[email protected]> |
License: | Artistic-2.0 |
Version: | 2.37.0 |
Built: | 2024-12-17 06:23:58 UTC |
Source: | https://github.com/bioc/epivizr |
Class managing connection to epiviz application.
server
An object of class EpivizServer
used to communicate with epiviz app.
data_mgr
An object of class EpivizDataMgr
used to serve data to epiviz app.
chart_mgr
An object of class EpivizChartMgr
used to manage charts added to epiviz app session.
get_current_location(callback)
Obtain current genome location on epiviz app and evaluate callback function on result.
A callback function to evaluate on response data.
Response data will be a list with slots seqName
, start
and end
get_ms_object(chart_id_or_object, index = 1)
Get object of class EpivizData
used as a data source
in a given chart.
An object of class EpivizChart
or an id for
a chart loaded to the epiviz app.
Index into .measurements
list of chart object to obtain data object for.
is_server_closed()
Check if underlying server connection is closed.
load_remote_measurements()
Load remote measurements into R session.
load_workspace(workspace_id = NULL)
load an epiviz workspace.
Workspace id to load from the database.
navigate(chr, start, end)
Navigate to given position on the epiviz app.
plot(
data_object,
datasource_name = NULL,
send_request = TRUE,
settings = NULL,
colors = NULL,
...
)
Visualize data on epiviz app using its default chart type. Measurements from the data-object
are first added to the epiviz app using the add_measurements
method for class
EpivizData
. See documentation for register
for information on supported data types and the EpivizData
class
encapsulating this type of data. Once measurements are loaded, the plot
method
of class EpivizChartMgr
is used to plot the data, using the default chart type
for this type of data.
An object to plot in epiviz app.
Name to use for datasource, parses data_object
if missing or NULL
Additional arguments passed to add_measurements
method for class
EpivizData
print_workspace(file_name = NULL, file_type = "pdf")
Save epiviz workspace as a pdf or png.
save(file, include_data = TRUE)
Save EpivizApp object representation of a workspace into .RData file.
(character) The name of the file to save the EpivizApp object into, ending in .rda.
(logical) Stop the EpivizApp session.
(logical) Include EpivizApp's data when saving the EpivizApp object.
service(verbose = TRUE)
Block interactive R session to service websocket requests.
slideshow(granges, n = length(granges), .callback = NULL)
Navigate on epiviz app successively to given positions.
An object of class GenomicRanges
indicating
set of genomic regions to navigate in epiviz app.
(integer) The number of regions in granges
to navigate to.
(function) function to call after navigating to each region. Used for testing purposes.
stop_app()
stop and clean connection to epiviz app.
Class encapsulating a chart in epiviz app
get_app_id(id)
Get chart's id assigned by epiviz app.
get_colors()
Get color palette applied to the chart.
get_id()
Get chart's id assigned by chart manager
get_measurements()
Get measurements for the chart.
get_settings()
Get custom settings for the chart.
get_source_name()
Get chart's id assigned by chart manager
is_connected()
Returns TRUE
if chart is connected to a chart on epiviz app.
print_info()
Print settings and color currently used in chart object.
set(settings = NULL, colors = NULL)
Set settings and colors used in chart.
List of settings to apply.
Character vector of HEX colors to use in chart.
set_app_id(id)
Set chart's id assigned by epiviz app.
set_colors(colors)
Set custom colors for the chart.
set_id(id)
Set chart's id assigned by chart manager.
set_settings(settings)
Set custom settings for the chart. Returns subset of valid settings.
List of settings to apply.
Class providing chart manager for epiviz app
add_chart(chart_object, send_request = TRUE)
Add a chart to the chart manager.
an object of class EpivizChart
send request to app through websocket
get_chart_colors(chart_object_or_id)
List colors used in a specific chart object.
An object of class EpivizChart
or a
string indicating the chart's id assigned by chart manager
get_chart_settings(chart_object_or_id)
List chart settings for a specific chart object.
An object of class EpivizChart
or a
string indicating the chart's id assigned by chart manager
is_server_closed()
Returns TRUE
if underlying server is closed.
See is_closed
method in class EpivizServer
.
list_chart_type_colors(chart_type)
List colors currently used in given chart type
list_chart_type_settings(chart_type)
List available settings for a specific chart type.
the name for a chart type in R (e.g., 'BlocksTrack', 'StackedLineTrack')
list_chart_types(col_width = 80)
List charts types registered in epivizr with their default settings and colors.
Returns a data.frame
listing available chart types and a summary of the
settings that can be modified.
Maximum length of settings list displayed.
list_charts()
Return data.frame
describing charts loaded by chart manager
num_charts()
Return the number of charts currently loaded through manager.
plot(measurement_object, settings = NULL, colors = NULL, send_request = TRUE)
Visualize data in an EpivizData
object using its default chart type.
The method get_default_chart_type
in class EpivizData
is used
to determine which chart type is used.
an object of class EpivizData
list of settings to use in chart (uses default chart settings if NULL)
character vector of HEX colors to use in chart (uses default chart colors if NULL)
print_chart(chart_object_or_id, file_name = NULL, file_type = c("pdf", "png"))
Print specific chart to file.
An object of class EpivizChart
or a
string indicating the chart's id assigned by chart manager.
Name of file to print to.
Type of file to print. One of pdf
or png
.
print_chart_info(chart_object_or_id)
Print settings and colors used in a specific chart object.
An object of class EpivizChart
or a
string indicating the chart's id assigned by chart manager
print_chart_type_info(chart_type)
Print settings and color information for a given chart type
the name for a chart type in R (e.g., 'BlocksTrack', 'StackedLineTrack')
register_chart_type(
chart_type,
js_chart_type = paste0("epiviz.plugins.charts.", chart_type),
js_chart_settings = list(),
js_chart_colors = character()
)
Register a chart type name to a JavaScript chart type in the epiviz app.
the name to use for chart type in R (e.g., 'BlocksTrack')
the full JavaScript class name of the corresponding chart type
(e.g. 'epiviz.plugins.charts.BlocksTrack'). If missing it is taken from the chart_type
argument
custom settings that can be applied to this chart type in JS.
default color palette applied to this chart type in JS.
revisualize(chart_type, chart, ...)
Revisualize uses data the given chart and replots it in the given chart type. The argument chart
must be non-NULL
.
a chart type registered using the register_chart_type
method
a chart that includes measurements to be used in a new chart
rm_all_charts()
Remove all charts loaded by chart manager.
rm_chart(chart_object_or_id)
Remove chart from chart manager.
An object of class EpivizChart
or a
string indicating the chart's id assigned by chart manager
set_chart_settings(chart_object_or_id, settings = NULL, colors = NULL)
Apply custom chart settings or colors to a chart object.
An object of class EpivizChart
or a
string indicating the chart's id assigned by chart manager
a list of settings to apply to the chart
a list of (HEX code) colors to use in the chart
visualize(
chart_type,
measurements = NULL,
datasource = NULL,
settings = NULL,
colors = NULL,
send_request = TRUE,
...
)
Visualize data use the given chart type. One of arguments measurements
or datasource
must be non-NULL
. If measurements
is NULL
, the get_measurements
method in class EpivizData
is used to decide which measurements are used in the chart
a chart type registered using the register_chart_type
method
a list of EpivizMeasurement
objects
describing measurements to include in the chart
an object of class EpivizData
, all available
measurements from datasource are used as appropriate
Restart epiviz app connection and workspace.
restartEpiviz(file, open_browser = TRUE, host = NULL, envir = parent.frame())
restartEpiviz(file, open_browser = TRUE, host = NULL, envir = parent.frame())
file |
(character) The name of the file that holds the EpivizApp object to be restarted, ending in .rda. |
open_browser |
(logical) browse to the epiviz URL before exiting function. |
host |
(character) name of epiviz app host to open at restart |
envir |
(environment) environment in which to evaluate expressions needed to reconstruct data sources |
An object of class EpivizApp
# see package vignette for example usage app <- startEpiviz(non_interactive=TRUE, open_browser=TRUE) file_name <- tempfile(fileext=".rda") app$save(file=file_name) app$stop_app() app <- restartEpiviz(file=file_name, open_browser=FALSE)
# see package vignette for example usage app <- startEpiviz(non_interactive=TRUE, open_browser=TRUE) file_name <- tempfile(fileext=".rda") app$save(file=file_name) app$stop_app() app <- restartEpiviz(file=file_name, open_browser=FALSE)
Print information about EpivizChart
## S4 method for signature 'EpivizChart' show(object)
## S4 method for signature 'EpivizChart' show(object)
object |
an |
Nothing, this function is called for its side-effects
EpivizApp
object to manage connection.Start epiviz app and create EpivizApp
object to manage connection.
startEpiviz( host = NULL, http_port = NULL, path = NULL, use_devel = FALSE, chr = "chr11", start = 99800000, end = 103383180, debug = FALSE, workspace = NULL, scripts = NULL, gists = NULL, use_cookie = TRUE, register_function = .register_all_the_epiviz_things, open_browser = TRUE, server = NULL, browser_fun = utils::browseURL, ws_host = "localhost", ... )
startEpiviz( host = NULL, http_port = NULL, path = NULL, use_devel = FALSE, chr = "chr11", start = 99800000, end = 103383180, debug = FALSE, workspace = NULL, scripts = NULL, gists = NULL, use_cookie = TRUE, register_function = .register_all_the_epiviz_things, open_browser = TRUE, server = NULL, browser_fun = utils::browseURL, ws_host = "localhost", ... )
host |
(character) use a host for the epiviz app other than the cbcb.umd.edu hosts. |
http_port |
(integer) port at host serving the epiviz app. |
path |
(character) path at host where epiviz app is located. |
use_devel |
(logical) use the devel epiviz application server (http://epiviz-dev.cbcb.umd.edu). |
chr |
(character) chromosome to browse to on app startup. |
start |
(integer) start location to browse to on app startup. |
end |
(integer) end location to browse to on app startup. |
debug |
(logical) start epiviz app in debug mode. |
workspace |
(character) a workspace id to load in the epiviz app on startup. |
scripts |
(character) URLs for JavaScript plugin scripts to be imported when epiviz is loaded (see http://epiviz.cbcb.umd.edu/help for details). |
gists |
(character) Ids for github gists (http://gist.github.com) containing JavaScript plugin scripts to be imported when epiviz is loaded (see http://epiviz.cbcb.umd.edu/help for details). |
use_cookie |
(logical) use cookies within the epiviz app. |
register_function |
(function) function used to register actions and charts on the epiviz app. |
open_browser |
(logical) browse to the epiviz URL before exiting function. |
server |
(EpivizServer) if not |
browser_fun |
(function) function used to browse to URL ( |
ws_host |
(character) host address to use for websocket connection ("localhost" by default) |
... |
additional parameters passed to |
An object of class EpivizApp
# see package vignete for example usage app <- startEpiviz(non_interactive=TRUE, open_browser=TRUE) app$stop_app()
# see package vignete for example usage app <- startEpiviz(non_interactive=TRUE, open_browser=TRUE) app$stop_app()
Example results from methylation analysis of human chromosome 11 using the minfi::minfi-package
package
of TCGA 450k beadarray samples. This object contains large regions of methylation difference between tumor
and normal samples obtained from minfi::blockFinder()
.
data(tcga_colon_blocks)
data(tcga_colon_blocks)
A GRanges
object with 129 and mcols
:
value
average smooth methylation difference within block
area
block area estimate (abs(value) * length)
cluster
id of cluster blockgroup within which block occurs
indexStart
index of first cluster in block
indexEnd
index of last cluster in block
L
number of clusters in block
clusterL
number of probes in block
p.value
permutation p.value based on difference conditioned on length
fwer
family-wise error rate estimate based on difference conditioned on length
p.valueArea
permutation p.value based on area
fwerArea
family-wise error rate estimate based on area
TCGA project: https://tcga-data.nci.nih.gov/tcga/
Example results from methylation analysis of human chromosome 11 using the minfi::minfi-package
package
of TCGA 450k beadarray samples. This object contains probe cluster level methylation estimates from
minfi::blockFinder()
.
data(tcga_colon_curves)
data(tcga_colon_curves)
A GRanges
object with 7135 ranges and mcols
:
id
probe cluster id
type
probe cluster type
blockgroup
probe cluster block group
diff
raw methylation percentage difference between normal and tumor
smooth
smooth methylation percentage difference between normal and tumor
normalMean
mean methylation estimate for normal samples
cancerMean
mean methylation estimate for cancer samples
TCGA project: https://tcga-data.nci.nih.gov/tcga/
A SummarizedExperiment::RangedSummarizedExperiment
object containing exon-level
counts from RNAseq data for colon tumor and normal tissue from the TCGA project.
Only exons in human chromosome 11 are included.
data(tcga_colon_expression)
data(tcga_colon_expression)
A SummarizedExperiment::RangedSummarizedExperiment
object with 12,800 rows (exons) and 40 samples.
assay(tcga_colon_expression)
exon-level count matrix
colData(tcga_colon_expression)
a DataFrame
containing sample information.
Normal/Tumor status is given in column sample_type
A SummarizedExperiment::RangedSummarizedExperiment
object.
TCGA project: https://tcga-data.nci.nih.gov/tcga/