Package 'epivizrData'

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-10-30 07:47:26 UTC
Source: https://github.com/bioc/epivizrData

Help Index


Create empty Epiviz Measurement

Description

Create empty Epiviz Measurement

Usage

.emptyEpivizMeasurement()

Create empty Epiviz Measurement

Description

Create empty Epiviz Measurement

Usage

.emptyEpivizSparseMeasurement()

Utility function to import data to a MySQL database from Annotation Hub

Description

Utility function to import data to a MySQL database from Annotation Hub

Usage

ahToMySQL(ah, annotations = list(), ...)

Arguments

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)

Examples

## 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

Description

Generic as.data.frame method for EpivizData objects

Usage

## S4 method for signature 'EpivizData'
as.data.frame(x, query = NULL, ...)

Arguments

x

EpivizData object to coerce.

query

GRanges object

...

other param to send to data.frame


Convert EpivizMeasurement object to list

Description

Convert EpivizMeasurement object to list

Usage

## S4 method for signature 'EpivizMeasurement'
as.list(x)

Arguments

x

EpivizMeasurement object to coerce.

Value

a list describing measurement object


Convert SparseEpivizMeasurement object to list

Description

Convert SparseEpivizMeasurement object to list

Usage

## S4 method for signature 'SparseEpivizMeasurement'
as.list(x)

Arguments

x

SparseEpivizMeasurement object to coerce.

Value

a list describing measurement object


Create a data manager for epiviz app

Description

Create a data manager for epiviz app

Usage

createMgr(server = server)

Arguments

server

An object of class EpivizServer

Value

An object of class EpivizDataMgr

Examples

server <- epivizrServer::createServer(port=7123L)
data_mgr <- epivizrData::createMgr(server)

Data container for interval data.

Description

Used to serve data for visualizations of genomic regions only. Wraps GenomicRanges objects.

Methods

get_default_chart_type()

Get name of default chart type for this data type

get_measurements()

Get description of measurements served by this object

See Also

EpivizData


Container for basepair level numeric data

Description

Used to serve data to genomic line tracks. Wraps GenomicRanges objects. Numeric values obtained from mcols slot.

Methods

get_default_chart_type()

Get name of default chart type for this data type

get_measurements()

Get description of measurements served by this object

See Also

EpivizData


Data container for epiviz data server

Description

Data container for epiviz data server

Methods

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

connection

DBIConnection to a database

db_name

Name of MySQL database

annotation

Annotation for index table

batch

Batch size for data sent to the MySQL database

index

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

Description

Class providing data manager for epiviz app

Methods

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)


Data container for RangedSummarizedExperiment objects

Description

Used to serve general data (used in e.g., scatter plots and heatmaps). Wraps RangedSummarizedExperiment objects. Numeric values obtained from assays slot

Methods

get_default_chart_type()

Get name of default chart type for this data type

get_measurements()

Get description of measurements served by this object

See Also

EpivizData


Container for gene annotation data

Description

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).

Methods

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

See Also

EpivizData

register,OrganismDb


Class encapsulating a measurement description for epiviz app.

Description

Class encapsulating a measurement description for epiviz app.


epivizrData

Description

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

Description

Generic method to register data to the data server

Usage

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, ...)

Arguments

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 GenomicRanges object. block: only region data, bp base-pair resolution quantitative data (see columns argument), geneInfo information about gene location.

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

Value

Object inheriting from EpivizData class

Methods (by class)

Examples

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

Description

Display measurement datasourceId and id

Usage

## S4 method for signature 'EpivizMeasurement'
show(object)

Arguments

object

a EpivizMeasurement to display

Value

A string describing measurement


Display measurement datasourceId and id

Description

Display measurement datasourceId and id

Usage

## S4 method for signature 'SparseEpivizMeasurement'
show(object)

Arguments

object

a SparseEpivizMeasurement to display

Value

A string describing measurement


Class encapsulating a measurement description for epiviz app.

Description

Class encapsulating a measurement description for epiviz app.