Comments (2)
Hey @mikejiang, @gfinak, @raphg,
Yes the seed class is mandated. This is how you actually implement the backend, by implementing a seed class. When you implement an extract_array
method for your seed objects, you're providing random access to the array data stored in your backend. So code in DelayedArray can use extract_array()
to extract array data from a seed object without knowing anything about the backend.
About implementing a backend with dual layouts: For this to play well with DelayedArray, at least 2 things are needed:
-
Your
extract_array
method will need to take advantage of the dual layout e.g. by using the row-oriented layout when the suppliedindex
is of the formlist(i, NULL)
and by using the column-oriented layout whenindex
is of the formlist(NULL, j)
. -
When doing block-processing, DelayedArray will need to choose a block geometry that leads to optimal calls to
extract_array()
. For example, if DelayedArray objectx
has a seed with dual layout,rowSums()
should ideally use blocks made of full rows andcolSums()
should use blocks made of full columns. That's ifx
doesn't carry a delayed transposition on it. If it does, then it's the other way around. Note that improving the block-processing strategy used by DelayedArray is still a work in progress. My priority at the moment is to have the block-processing strategy play well with the physical chunk geometry of the seed. Seeds will have a way to tell DelayedArray about the chunk geometry via achunkdim
method or something like that. If a seed provides nochunkdim
method, a default block-processing strategy should be used. It would actually make sense that this default strategy does the above i.e. use blocks made of full rows or cols when calling row/col summarization functions likerowSums()
/colSums()
. Then it would play well with your dual layout backend. I'm putting this on the TODO list.
If you're going to implement a seed class for HDF5 dual layout, you should probably avoid starting from scratch. It's going to be easier to define the new class on top of the HDF5ArraySeed class e.g. with something like this:
setClass("DualHDF5ArraySeed",
slots=c(row_oriented="HDF5ArraySeed",
col_oriented="HDF5ArraySeed"))
It feels to me that the approach would be the same if you were going to implement a seed class for tiledb dual layout (except that AFAIK there is no TileDbSeed class yet so you would need to start by implementing that). Implementing a dual layout seed might actually be done in a more generic way e.g. with something like:
setClass("DualSeed",
slots=c(row_oriented="ANY",
col_oriented="ANY"))
with a validity method that checks that the seeds stored in the row_oriented
and col_oriented
slots are "compatible". What "compatible" means exactly (and how strict it needs to be) still needs to be
decided. For example, there is no reason a priori why the 2 sub-seeds would need to use the same backend.
from delayedarray.
@mikejiang Is it ok to close this?
from delayedarray.
Related Issues (20)
- Have extract_array() accept non-integer dim() outputs HOT 1
- Where can i find the old version HOT 1
- Can't `cbind` DelayedArray instances with other matrix-likes
- More elements in the method signature (2) than in the generic signature (1) for function ‘type<-’ HOT 2
- Bioconductor devel / multiple methods tables found for ‘aperm’ HOT 1
- Install error HOT 2
- `set_grid_context()` changed in `RELEASE_3_17` HOT 2
- Thoughts on migrating from `read_sparse_block()` to SVTs HOT 2
- rowRanges/colRanges not preserving row/col names HOT 2
- colMaxs/rowMaxs and colMins/rowMins useNames behavior incorrect in RELEASE_3_17 HOT 2
- `NSBS` method for `DelayedArray` objects? HOT 3
- Unable to find an inherited method for function ‘OLD_extract_sparse_array’ for signature ‘"CSR_H5SparseMatrixSeed"’ HOT 2
- Feature request: add `BPCell` backend HOT 8
- Feature request: make `seedApply` as a generic function HOT 4
- More informative error than `the supplied seed must support extract_array()` HOT 3
- Inconsistent `dimnames` after matrix multiplication with zero-column output HOT 2
- Importing DelayedArray messes up as.vector() for Arrow arrays HOT 1
- DelayedMatrixStats no longer supports scalar `center=` arguments HOT 5
- `base::cbind()`
- the problem "the supplied seed must support extract_array() " HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayedarray.