url
:msList
:EpivizData-class
)typeMap
:msIdCounter
:msList
chartList
:EpivizChart-class
)chartIdCounter
:chartList
activeId
:chartIdMap
:deviceList
:EpivizDevice-class
)deviceIdCounts
:deviceList
server
:EpivizServer-class
encapsulating the websocket connection to appverbose
:nonInteractive
:callbackArray
:IndexedArray-class
containing request callback functionsbindToServer()
: Call the bindManager
function of the server
object passing this object as argument.
isClosed()
: Returns TRUE
if connection to app is closed.
openBrowser(url=NULL)
: Open browser for epiviz web app, if argument url
is NULL
(the default), the url
field is used.
service()
: Service requests from app (this call blocks the R/interactive session until loop is escaped)
stopService()
: Stop the service loop
startServer()
: Start the websocket connection server
stopServer()
: Stops the websocket connection server. Also removes all currently added devices, charts and measurements from web app.
addSeqinfo(x)
: Add sequence space (e.g., chromosome) informationto the web app.
x
should be a Seqinfo-class
object, or a named integer (or numeric) vector.
rmSeqinfo(seqnames)
: Remove sequence spaces (e.g., chromosome) information
from the web app. seqnames
should be a character vector containing chromosome
names.
refresh()
: NOT SUPPORTED YET
navigate(chr, start, end)
: Navigate in web app to give genomic region
getCurrentLocation(callback)
: get current genomic location displayed in the UI. callback
should be a function
called on the response received from UI. The response is a list with a value
component that contains the location in
in a list with components seqName
, start
and end
. For example, the following snippet would save
the current location as a GRanges
object in variable currentLoc
in the global environment:
mgr$getCurrentLocation(function(x) {currentLoc <<- granges(x$value$seqname,="" iranges(x$value$start,="" x$value$end))})<="" code="">
<->
slideshow(granges, n=length(granges))
: Navigate in web app to the first n
regions in GenomicRanges-class
object granges
in succession.
addMeasurements(obj, msName, sendRequest=TRUE, ...)
: Add measurements in obj
, calls the register-methods
on
obj
passing extra arguments in ...
. Measurements are given names derived from msName
. Measurements are added to the web
app itself if sendRequest==TRUE
(the default). This method adds a measuremnt object of class EpivizData-class
, returned
by the register-methods
to the msList
field. Measurement ids are generated automatically using msIdCounter
and are returned by this method.
.clearDatasourceGroupCache(msObj, sendRequest=!nonInteractive)
: Clears data caches in web app using any of the measurements defined by msObj
of class (EpivizData-class
). Only affects web app if sendRequest==TRUE
. This method is for internal use only.
updateMeasurements(oldObject, newObject, sendRequest=TRUE)
: Update the data object wrapped in EpivizData-class
object
oldObject
to newObject
. The class of newObject
depends on the type of data, but is checked for correctness, i.e., the
the classes of the new and current data objects are the same. Argument oldObject
can be a EpivizData-class
object
already added to the session, or a character containing the id of an object. Ids are returned by the addMeasurements
method.
.getMsObject(msObjId)
: Get the EpivizData-class
object corresponding the the id msObjId
. This method is for
internal use only.
rmMeasurements(msObj)
: Remove measurements stored in EpivizData-class
object msObj
. The msObj
argument
can be an EpivizData-class
object added to the session manager, or the id of such an object.
rmAllMeasurements()
: Remove all measurements added to the session manager.
listMeasurements()
: List measurements added to the session manager.
getMeasurements()
: Returns list of currently added measurements in format required by web app. This method is for internal use only.
getMeasurementType(x)
: Returns type of measurement object x
of class EpivizData-class
.
getRows(chr, start, end, metadata, datasource)
: Get genomic location and metadata
for rows in given datasource
that overlap the region defined by chr
,
start
and end
.
getValues(chr, start, end, datasource, measurement)
: Get data values for column
measurement
for rows in datasource
that overlap the region defined by
chr
, start
and end
.
addChart(chartObject, sendRequest=TRUE, ...)
: Adds chart specified by chartObject
of class EpivizChart-class
to the
session manager. The chart is added to the web app if sendRequest==TRUE
(the default). The chartObject
is inserted to the
chartList
field. Chart ids are generated automatically using chartIdCounter
and are returned by this method.
.getChartObject(chartId)
: Returns the EpivizChart-class
object corresponding to id chartId
.
rmChart(chartObj)
: Remove chart corresponding to chartObj
. Argument chartObj
can be an object of class
EpivizChart-class
or the character id of such an object.
rmAllCharts()
: Remove all charts currently in the session manager.
listCharts()
: List all charts currently added to session manager.
blockChart(ms, ...)
: Used to display data in GenomicRanges
objects as genomic regions using rectangles
in a browser track. ms
is a list of lists, each component describing a measurement provided by an object of class EpivizBlockData-class
.
They can be obtained using the getMeasurements
method in the EpivizBlockData-class
. plot
method for EpivizBlockData-class
calls this method.
lineChart(ms, ...)
: Used to display continuous data at base-pair level as a line plot in a browser track.
ms
is a list of lists, each component describing a measurement provided by objects of class EpivizBpData-class
.
They can be obtained using the getMeasurements
method in the EpivizBlockData-class
. The plot
method for
EpivizBpData-class
calls this method.
scatterChart(x, y, ...)
: Used to display genomic feature data in SummarizedExperiment
objects
as a scatter plot. x
and y
are lists for measurements provided by objects of class EpivizFeatureData-class
.
They can be obtained using the getMeasurements
method in the EpivizFeatureData-class
.
The plot
method for EpivizFeatureData-class
calls this method.
heatmapChart(ms, ...)
: Used to display genomic feature data in SummarizedExperiment
objects
as a heatmap. ms
is a list of lists, each component describing a measurement provided by an object of class EpivizFeatureData-class
.
They can be obtained using the getMeasurements
method in the EpivizFeatureData-class
.
genesChart(ms, ...)
: Used to display a gene annotation track. ms
is a list
containing a single entry: a list describing data provided by an object of class
EpivizGeneInfoData-class
. This list can be obtained using the
getMeasurements
method in the EpivizGeneInfoData-class
.
addDevice(obj, devName, sendRequest=TRUE, ...)
: Adds device for object obj
. This method calls the
addMeasurements
method on obj
and calls the plot
method of the resulting EpivizData-class
object.
Measurements and charts added by this called are given names derived from devName
. Arguemnts to addMeasurement
and the
plot-methods
call can be given in ...
. Device ids are generated automatically using devIdCounter
and are returned
by this function. An object of class EpivizDevice-class
is created and inserted into devList
.
rmDevice(devObj)
: Remove the device corresponding to devObj
: an object of class EpivizDevice-class
or
the id for such an object. This removes the corresponding chart and measurement objects from the session manager.
rmAllDevices()
: Remove all devices added to the session manager.
updateDevice(oldObject, newObject, sendRequest=TRUE, ...)
: Update the data object wrapped in EpivizDevice-class
object
oldObject
to newObject
. The class of newObject
depends on the type of data, but is checked for correctness, i.e., the
the classes of the new and current data objects are the same. Argument oldObject
can be a EpivizDevice-class
object
already added to the session, or a character containing the id of an object. Ids are returned by the addDevice
method.
listDevices()
: List all devices added to the session manager.
measurements
encapsulated in EpivizData-class
objects, the latter by charts
encapsulated by EpivizChart-class
objects.
For a user to visualize data stored in an object that can be referenced by genomic location, e.g., a
GRanges
or SummarizedExperiment
objects, they must first indicate
to the session manager which measurements
are provided by this object using the addMeasurements
method. This creates
an object derived from class EpivizData-class
(using register-methods
) which wraps the data object
so that efficient overlap queries are performed (using GIntervalTree
objects) and adds the set of
measurements provided to the web app. This allows users to create charts displaying data from this object
either by using the addChart
method or the web app UI itself. See section 'Measurement management methods' below for more information.
Once measurements
have been declared, users can use the addChart
method to visualize them in one or more different
plot types (see section 'Chart types' below). Objects from classes derived from EpivizData-class
have plot
methods
that use reasonable default chart types. See section 'Chart management methods' below for more information.
We also provide a 'device' interface to simplify the steps above. Users can call the addDevice
method, passing a data object
to be visualized and a chart is added with the default visualization for the object. The same mechanism above is used, so both
a EpivizData-class
and EpivizChart-class
objects are added to the session manager. See section 'Device
management methods' below for more information.
## Not run:
# require(epivizrData)
# data(tcga_colon_example)
#
# mgr <- startEpiviz(openBrowser=interactive())
#
# # using the device interface
# blockDev <- mgr$addDevice(colon_blocks, "blocks_test", type="block")
#
# # using the measurement/chart interface
# # add measurements
# blockMs <- mgr$addMeasurements(colon_blocks, "blocks_test2", type="block")
#
# # add chart
# blockChart <- mgr$blockChart(blockMs$getMeasurements()[1])
#
# # using plot methods
# blockChart2 <- blockMs$plot()
#
# # list devices
# mgr$listDevices()
#
# # list measurements
# mgr$listMeasurements()
#
# # list charts
# mgr$listCharts()
#
# # remove a chart
# mgr$rmChart(blockChart2)
#
# # navigate to genomic region
# mgr$navigate("chr2", 10000000, 30000000)
# mgr$stopServer()
# ## End(Not run)
Run the code above in your browser using DataLab