Title: | Delayed operation on DataFrame using standard DataFrame metaphor |
---|---|
Description: | Based on the standard DataFrame metaphor, we are trying to implement the feature of delayed operation on the DelayedDataFrame, with a slot of lazyIndex, which saves the mapping indexes for each column of DelayedDataFrame. Methods like show, validity check, [/[[ subsetting, rbind/cbind are implemented for DelayedDataFrame to be operated around lazyIndex. The listData slot stays untouched until a realization call e.g., DataFrame constructor OR as.list() is invoked. |
Authors: | Qian Liu [aut, cre], Hervé Pagès [aut], Martin Morgan [aut] |
Maintainer: | Qian Liu <[email protected]> |
License: | GPL-3 |
Version: | 1.23.0 |
Built: | 2024-11-29 05:24:51 UTC |
Source: | https://github.com/bioc/DelayedDataFrame |
as.list
, rbind
would incur realization
of the lazyIndex
slot in DelayedDataFrame
object.
cbind
for DelayedDataFrame inherits the
lazyIndex's if inputs have any DelayedDataFrame
objects. Otherwise, return a new DelayedDataFrame with NULL
lazyIndexes.
## S4 method for signature 'DelayedDataFrame' as.list(x, use.names = TRUE) ## S4 method for signature 'DelayedDataFrame' names(x) ## S4 method for signature 'DelayedDataFrame' cbind(..., deparse.level = 1) ## S4 method for signature 'DelayedDataFrame' bindROWS( x, objects = list(), use.names = TRUE, ignore.mcols = FALSE, check = TRUE ) ## S4 method for signature 'DelayedDataFrame,ANY' extractROWS(x, i) ## S4 method for signature 'DelayedDataFrame' extractCOLS(x, i) ## S4 method for signature 'DelayedDataFrame' replaceCOLS(x, i, value) ## S4 method for signature 'DelayedDataFrame' mergeROWS(x, i, value) ## S4 method for signature 'DelayedDataFrame,ANY,ANY,ANY' x[i, j, ..., drop = TRUE]
## S4 method for signature 'DelayedDataFrame' as.list(x, use.names = TRUE) ## S4 method for signature 'DelayedDataFrame' names(x) ## S4 method for signature 'DelayedDataFrame' cbind(..., deparse.level = 1) ## S4 method for signature 'DelayedDataFrame' bindROWS( x, objects = list(), use.names = TRUE, ignore.mcols = FALSE, check = TRUE ) ## S4 method for signature 'DelayedDataFrame,ANY' extractROWS(x, i) ## S4 method for signature 'DelayedDataFrame' extractCOLS(x, i) ## S4 method for signature 'DelayedDataFrame' replaceCOLS(x, i, value) ## S4 method for signature 'DelayedDataFrame' mergeROWS(x, i, value) ## S4 method for signature 'DelayedDataFrame,ANY,ANY,ANY' x[i, j, ..., drop = TRUE]
x |
|
use.names |
|
... |
|
deparse.level |
See ‘?base::cbind’ for a description of this argument. |
objects |
the |
ignore.mcols |
Logical. This argument is ignored for
|
check |
Logical. This argument is ignored for
|
i |
row subscript |
value |
the new values in the |
j |
col subscript |
drop |
if drop with reduced dimension, default is TRUE. |
colnames of DelayedDataFrame
The DelayedDataFrame
class extends the
DataFrame
class and supports the storage of any type of
object (with ‘length’ and ‘[’ methods) as columns.
the lazyIndex
slot getter and setter for
DelayedDataFrame
object.
the coercion method between DataFrame
and
DelayedDataFrame
objects.
DelayedDataFrame(..., row.names = NULL, check.names = TRUE) ## S4 method for signature 'DelayedDataFrame' lazyIndex(x) .from_DataFrame_to_DelayedDataFrame(from) .from_DelayedDataFrame_to_DFrame(from, to = "DFrame", strict = TRUE) lazyIndex(x) <- value ## S4 replacement method for signature 'DelayedDataFrame' lazyIndex(x) <- value
DelayedDataFrame(..., row.names = NULL, check.names = TRUE) ## S4 method for signature 'DelayedDataFrame' lazyIndex(x) .from_DataFrame_to_DelayedDataFrame(from) .from_DelayedDataFrame_to_DFrame(from, to = "DFrame", strict = TRUE) lazyIndex(x) <- value ## S4 replacement method for signature 'DelayedDataFrame' lazyIndex(x) <- value
... |
the arguments to pass into construction of a new
|
row.names |
the |
check.names |
logical. If ‘TRUE’ then the names of the
variables in the |
x |
the |
from |
the object to be converted. |
to |
the class of object to be returned by coercion. |
strict |
Logical. Whether to force return a |
value |
the new value of |
The DelayedDataFrame
inherits from DataFrame
and behaves very similarily in terms of construction,
subsetting, splitting, combining, etc. The most notable
exception is that The additional slot of lazyIndex
,
enables DelayedArray
(with different back-ends) columns
to share indexes when possible.
Please be very careful to use this replace method for
lazyIndex
slot. Because it only replace the
lazyIndex
slot, but not necessarily the nrow
and
rownames
slots. If you want to have synchronized
subsetting for all slots, the [
method should be used.
lazyIndex<-
: the DelayedDataFrame
object with
new value of lazyIndex
slot.
DDF <- DelayedDataFrame(letters, LETTERS) DDF1 <- DDF[1:10,] DDF1 lazyIndex(DDF1) as(DDF1, "DataFrame")
DDF <- DelayedDataFrame(letters, LETTERS) DDF1 <- DDF[1:10,] DDF1 lazyIndex(DDF1) as(DDF1, "DataFrame")
LazyIndex
class and methods.The LazyIndex
class is designed to carry
mapping indexes for DelayedDataFrame
columns. So that
some operations (e.g., subsetting) on DelayedDataFrame
are delayed until a realization call is incurred. (e.g.,
as.list(), DataFrame(), ...)
LazyIndex
constructor.
the subsetting method for LazyIndex
object.
LazyIndex(listData = list(), index = integer()) ## S4 method for signature 'LazyIndex' cbind(..., deparse.level = 1) ## S4 method for signature 'LazyIndex,ANY,ANY,ANY' x[i, j, ..., drop = TRUE]
LazyIndex(listData = list(), index = integer()) ## S4 method for signature 'LazyIndex' cbind(..., deparse.level = 1) ## S4 method for signature 'LazyIndex,ANY,ANY,ANY' x[i, j, ..., drop = TRUE]
listData |
the list data for all mapping indexes that are used in
corresponding |
index |
the position of mapping indexes in |
... |
|
deparse.level |
See |
x |
|
i |
row subscript for |
j |
column subscript for |
drop |
Logical. Wheter to drop the dimension if any of the dimensions has length 1. Default is TRUE. |
the cbind,LazyIndex
method is defined to bind the
LazyIndexes column-wise when cbind,DelayedDataFrame
function is called.
a LazyIndex
object.