Title: | Data Management API for epiviz interactive visualization app |
---|---|
Description: | Serve data from Bioconductor Objects through a WebSocket connection. |
Authors: | Hector Corrada Bravo [aut, cre], Florin Chelaru [aut] |
Maintainer: | Hector Corrada Bravo <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.35.0 |
Built: | 2024-11-29 08:01:07 UTC |
Source: | https://github.com/bioc/epivizrData |
Create empty Epiviz Measurement
.emptyEpivizMeasurement()
.emptyEpivizMeasurement()
Create empty Epiviz Measurement
.emptyEpivizSparseMeasurement()
.emptyEpivizSparseMeasurement()
Utility function to import data to a MySQL database from Annotation Hub
ahToMySQL(ah, annotations = list(), ...)
ahToMySQL(ah, annotations = list(), ...)
ah |
[AnnotationHub()] object with records to add to database. |
annotations |
A named list of lists (key/value pairs). Keys must be the AH ID for the corresponding record and the value is a named list representing an annotation. An annotation is automatically inferred by the record's metadata. Any annotation that is passed for a particular record is concatenated to its inferred annotation. If the annotation has a subtype column, it is used to name the data object being added to the db, otherwise the record's tags is used. |
... |
arguments for toMySQL (connection, db_name, batch, index) |
## Not run: library(epivizrData) library(AnnotationHub) library(DBI) library(RMySQL) ah <- AnnotationHub() db_annotations <- list() # Query Patterns roadmap <- "EpigenomeRoadMap" bisulphite <- "bisulphite" esophagus <- query(ah, c("esophagus", "roadmap", "bisulphite")) eso_anno <- list(tissue="Digestive", subtype="Esophagus") eso_id <- names(esophagus) db_annotations[[eso_id]] <- eso_anno connection <- dbConnect(MySQL(), host=host, user=user, password=pass) db_name="my_database" ahToMySQL(ah=record, annotations=db_annotations, connection=connection, db_name=db_name) ## End(Not run)
## Not run: library(epivizrData) library(AnnotationHub) library(DBI) library(RMySQL) ah <- AnnotationHub() db_annotations <- list() # Query Patterns roadmap <- "EpigenomeRoadMap" bisulphite <- "bisulphite" esophagus <- query(ah, c("esophagus", "roadmap", "bisulphite")) eso_anno <- list(tissue="Digestive", subtype="Esophagus") eso_id <- names(esophagus) db_annotations[[eso_id]] <- eso_anno connection <- dbConnect(MySQL(), host=host, user=user, password=pass) db_name="my_database" ahToMySQL(ah=record, annotations=db_annotations, connection=connection, db_name=db_name) ## End(Not run)
Generic as.data.frame method for EpivizData objects
## S4 method for signature 'EpivizData' as.data.frame(x, query = NULL, ...)
## S4 method for signature 'EpivizData' as.data.frame(x, query = NULL, ...)
x |
|
query |
GRanges object |
... |
other param to send to data.frame |
EpivizMeasurement
object to list
Convert EpivizMeasurement
object to list
## S4 method for signature 'EpivizMeasurement' as.list(x)
## S4 method for signature 'EpivizMeasurement' as.list(x)
x |
|
a list
describing measurement object
SparseEpivizMeasurement
object to list
Convert SparseEpivizMeasurement
object to list
## S4 method for signature 'SparseEpivizMeasurement' as.list(x)
## S4 method for signature 'SparseEpivizMeasurement' as.list(x)
x |
|
a list
describing measurement object
Create a data manager for epiviz app
createMgr(server = server)
createMgr(server = server)
server |
An object of class |
An object of class EpivizDataMgr
server <- epivizrServer::createServer(port=7123L) data_mgr <- epivizrData::createMgr(server)
server <- epivizrServer::createServer(port=7123L) data_mgr <- epivizrData::createMgr(server)
Used to serve data for visualizations of genomic regions only. Wraps
GenomicRanges
objects.
get_default_chart_type()
Get name of default chart type for this data type
get_measurements()
Get description of measurements served by this object
EpivizData
Used to serve data to genomic line tracks. Wraps GenomicRanges
objects. Numeric values obtained from mcols
slot.
get_default_chart_type()
Get name of default chart type for this data type
get_measurements()
Get description of measurements served by this object
EpivizData
Data container for epiviz data server
get_default_chart_type()
Get name of default chart type for this data type
get_id()
Get id provided by manager EpivizDataMgr-class
get_measurements()
Get description of measurements served by this object
get_name()
Get datasource name, usually set by manager EpivizDataMgr-class
get_rows(query, metadata, useOffset = FALSE)
Get genomic interval information overlapping query <GenomicRanges
> region
get_source_name()
Get original datasource name provided by manager EpivizDataMgr-class
get_values(query, measurement, round = TRUE)
Get measurement values for features overlapping query region <GenomicRanges
parse_measurement(ms_id = NULL)
Parse a measurement description for data served by this object
set_id(id)
Set id, used by manager EpivizDataMgr-class
set_limits(ylim)
Set plotting limits for continuous data
set_mgr(mgr)
Set data manager, EpivizDataMgr-class
set_name(name)
Set datasource name, usually set by manager EpivizDataMgr-class
set_source_name(source_name)
Set original datasource name, used by manager EpivizDataMgr-class
toMySQL(connection, db_name, annotation = NULL, batch = 50, index = TRUE)
Send EpivizData to a MySQL Database
DBIConnection to a database
Name of MySQL database
Annotation for index table
Batch size for data sent to the MySQL database
Insert into respective index table
update(new_object, send_request = TRUE)
Update underlying data object with new object
Class providing data manager for epiviz app
add_measurements(
obj,
datasource_name = NULL,
datasource_origin_name = deparse(substitute(obj)),
send_request = TRUE,
...
)
register measurements in data manager
is_ms_connected(ms_obj_or_id)
check if measurement object was properly added to JS app
is_server_closed()
Check if underlying server is closed, <logical>
list_measurements()
make a printable list of registered measurements
rm_all_measurements()
remove all registered measurements
rm_measurements(ms_obj_or_id)
remove registered measurments from a given data object
update_measurements(ms_obj_or_id, new_object, send_request = TRUE)
update the underlying data object for a registered measurement (given by object or id)
Used to serve general data (used in e.g., scatter plots and heatmaps). Wraps
RangedSummarizedExperiment
objects. Numeric values obtained from
assays
slot
get_default_chart_type()
Get name of default chart type for this data type
get_measurements()
Get description of measurements served by this object
EpivizData
Used to serve data to gene annotation tracks. Wraps GenomicRanges
objects.
Annotation obtained from columns Gene
(gene symbols) and Exons
(exon start and end locations).
get_default_chart_type()
Get name of default chart type for this data type
get_measurements()
Get description of measurements served by this object
get_rows(query, metadata, useOffset = FALSE)
Get genomic interval information overlapping query <GenomicRanges
> region
EpivizData
register,OrganismDb
Class encapsulating a measurement description for epiviz app.
Infrastructure package for the epivizr interactive visualization system in Bioconductor. It provides connections between Bioconductor infrastructure objects and the epivizr visualization framework.
Generic method to register data to the data server
register(object, columns = NULL, ...) ## S4 method for signature 'GenomicRanges' register(object, columns, type = c("block", "bp", "gene_info"), ...) ## S4 method for signature 'RangedSummarizedExperiment' register(object, columns = NULL, assay = 1, metadata = NULL) ## S4 method for signature 'ExpressionSet' register(object, columns, annotation = NULL, assay = "exprs") ## S4 method for signature 'OrganismDb' register(object, kind = c("gene", "tx"), keepSeqlevels = NULL, ...) ## S4 method for signature 'TxDb' register(object, kind = c("gene", "tx"), keepSeqlevels = NULL, ...) ## S4 method for signature 'EnsDb' register(object, kind = c("gene", "tx"), keepSeqlevels = NULL, ...) ## S4 method for signature 'data.frame' register(object, columns = NULL, ...)
register(object, columns = NULL, ...) ## S4 method for signature 'GenomicRanges' register(object, columns, type = c("block", "bp", "gene_info"), ...) ## S4 method for signature 'RangedSummarizedExperiment' register(object, columns = NULL, assay = 1, metadata = NULL) ## S4 method for signature 'ExpressionSet' register(object, columns, annotation = NULL, assay = "exprs") ## S4 method for signature 'OrganismDb' register(object, kind = c("gene", "tx"), keepSeqlevels = NULL, ...) ## S4 method for signature 'TxDb' register(object, kind = c("gene", "tx"), keepSeqlevels = NULL, ...) ## S4 method for signature 'EnsDb' register(object, kind = c("gene", "tx"), keepSeqlevels = NULL, ...) ## S4 method for signature 'data.frame' register(object, columns = NULL, ...)
object |
The object to register to data server |
columns |
Name of columns containing data to register |
... |
Additonal arguments passed to object constructors |
type |
Which type of data object to register for a |
assay |
Which assay in object to register |
metadata |
Additional metadata about features |
annotation |
Character string indicating platform annotation (only hgu133plus2 supported for now) |
kind |
Make gene or transcript annotation (only gene supported for now) |
keepSeqlevels |
character vector indicating seqlevels in object to keep |
Object inheriting from EpivizData
class
GenomicRanges
: Register a GenomicRanges
object
RangedSummarizedExperiment
: Register a RangedSummarizedExperiment
object
ExpressionSet
: Register an ExpressionSet
object
OrganismDb
: Register an OrganismDb
object
TxDb
: Register a TxDb
object
EnsDb
: Register an EnsDb
object
data.frame
: Register an data.frame
library(GenomicRanges) # create an example GRanges object gr <- GRanges("chr10", IRanges(start=1:1000, width=100), score=rnorm(1000)) # this returns an EpivizData object without adding to data manager # this is not the preferred way of creating these object, but is shown # here for completeness. ms_obj <- epivizrData:::register(gr, type="bp", columns="score") server <- epivizrServer::createServer(port=7123L) data_mgr <- epivizrData::createMgr(server) # This adds a data object to the data manager data_mgr$add_measurements(gr, "example_gr", type="bp", columns="score")
library(GenomicRanges) # create an example GRanges object gr <- GRanges("chr10", IRanges(start=1:1000, width=100), score=rnorm(1000)) # this returns an EpivizData object without adding to data manager # this is not the preferred way of creating these object, but is shown # here for completeness. ms_obj <- epivizrData:::register(gr, type="bp", columns="score") server <- epivizrServer::createServer(port=7123L) data_mgr <- epivizrData::createMgr(server) # This adds a data object to the data manager data_mgr$add_measurements(gr, "example_gr", type="bp", columns="score")
Display measurement datasourceId and id
## S4 method for signature 'EpivizMeasurement' show(object)
## S4 method for signature 'EpivizMeasurement' show(object)
object |
a |
A string describing measurement
Display measurement datasourceId and id
## S4 method for signature 'SparseEpivizMeasurement' show(object)
## S4 method for signature 'SparseEpivizMeasurement' show(object)
object |
a |
A string describing measurement
Class encapsulating a measurement description for epiviz app.