yoloHandleMake: Create an 'seHandle/rseHandle' object

Description Usage Arguments Details Value Examples

Description

yoloHandleMake takes the a minimum of three parameters specified below and creates either a seHandle or an rseHandle object which can be subset and manipulated without reading any data off the disk. At a minimum, the rowData, colData, and backend file are needed. By default, we assume that the file format will be an sqlite file and the format will be sparse, but these can be differentially specified to an HDF5 file.

Usage

1
2
3
4
5
6
7
yoloHandleMake(rowData, colData, lookupFileName, lookupTableName = "data",
  lookupFileType = "sqlite", lookupFileFormat = "sparse")

## S4 method for signature 'ANY,ANY,character'
yoloHandleMake(rowData, colData, lookupFileName,
  lookupTableName = "data", lookupFileType = "sparse",
  lookupFileFormat = "sqlite")

Arguments

rowData

A GRanges object is when constructing an rseHandle. Otherwise,

colData

A data frame of per-sample annotations

lookupFileName

String pointing to the file backend

lookupTableName

= "data" Name of data table in file backend

lookupFileType

= "sparse" can also be "normal". The type of matrix contained in the file/table.

lookupFileFormat

= "sqlite" can also be "HDF5". The format of the file providing the data backend of this constructed object.

Details

A series of QC measures will be called when running this function. First, if the rowData input is a GRanges object, then the output will be an rseHandle. If the rowData input is a DataFrame object, then the resulting object will be an seHandle object. The length of the rowData input after coercion must be equal to the maximum index of the row in the particular file/table.

Next, the colData length must be equal to the maximum index of the column in the linked file/table.

These maximums will be pulled on constuction, which ensures that the table name, by default is 'data' exists in the sql file.

The sparse format demands that there are three columns in the file/table being referenced; two of which contain 'row' and 'column' as labels that indicate the index of the row and column elements.

The normal format demands that there are n columns in the file/table being referenced where n is the numerb of samples and the columns are named

Value

Returns either a seHandle or rseHandle object.

Examples

1
2
3
4
5
6
7
library(GenomicRanges)
nm <- c("chr", "start", "stop")
rt <- read.table(system.file("extdata", "dat1_row.bed", package="yolo"))
rowData <- GRanges(setNames(rt, nm))
colData <- read.table(system.file("extdata", "dat1_col.txt", package="yolo"))
sqlf <- system.file("extdata", "dat1.sqlite", package="yolo")
d1 <- yoloHandleMake(rowData, colData, lookupFileName=sqlf)

yinscapital/yolo-caleblareau-reference documentation built on May 19, 2019, 4:06 p.m.