Is it possible to update dataset dimensions in hdf5 file using rhdf5 in R? -


i trying update 7 datasets within 1 group in hdf5 file, updated datasets have different size dimensions originals (but same dimensionality, ie 1d, 2d, , 3d). there way alter dimension property in order update dataset? alternatively, can delete previous group, , create new group in it's place? i'd rather not rebuild entire h5 file (create file, create groups, create datasets) since it's decently complex.

i using bioconductor rhdf5 package in r.

example data:

# load package bioconductor source("http://bioconductor.org/bioclite.r") bioclite("rhdf5") library(rhdf5)  # create new h5 file , populate created = h5createfile('example.h5') created = h5creategroup('example.h5','foo') h5write(matrix(1:10, nr=5, nc=2), 'example.h5', 'foo/a')  # updating dataset data of same dimension successful h5write(matrix(11:20, nr= 5, nc = 2), 'example.h5', 'foo/a')   # updating dataset data of different dimension fails h5write(matrix(1:12, nr= 6, nc = 2), 'example.h5', 'foo/a') 

note: i've read data hdf5 files in past, first time writing data out file, perhaps naive expectation.

unfortunately, maximum size of hdf5 dataset fixed when created, , can't increased afterwards. you're going have recreate @ least datasets want extend.

hdf5 allow "delete" dataset, involves unlinking it, i.e. becomes inaccessible, space not reclaimed. rhdf5 doesn't seem provide interface this, however. more familiar rhdf5 may able there.

you can set maximum size in in rhdf5 with

h5createdataset('example.h5', 'foo/a', c(10), maxdims=c(12)) 

from rhdf5 reference manual (pdf). if want unlimited maxdims, it's bit more involved: first have create dataspace using hdf5 constants , use create dataset.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -