grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
61 stars 22 forks source link

vectorized version of h5read? #29

Open jorainer opened 5 years ago

jorainer commented 5 years ago

This is related to https://github.com/lgatto/MSnbase/issues/395 . I was wondering if it would not be possible for the h5read to read more than one entry from an HDF5 file at a time? Having to iteratively call h5read from R is really slow. If HDF5 does not per-se allow to retrieve multiple elements at a time, I think having a loop in C++ rather than in R might speed things up - at least that's how spectrum data is read by mzR - and as we-ve seen in the issue above this proved (rather unexpectedly to be honest) to be way faster than h5read.

So the use case would be to have a name vector with length > 1, call h5read with that name argument and get a list of matrices as a result.