ahToMySQL: Utility function to import data to a MySQL database from...

Description Usage Arguments Examples

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## 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)

epiviz/epivizrData documentation built on Oct. 9, 2021, 12:19 a.m.