[BioC] rhdf5 write/read inconsistency

Bernd Fischer bernd.fischer at embl.de
Thu Nov 7 23:14:36 CET 2013


Dear Brad and Julian!

There was a bug when reading/writing data when chunk-/block size was defined.
The bug is fixed in version 2.7.3 and will appear on the website with the next build.

Best,

Bernd

 


On 07.11.2013, at 12:07, Julian Gehring <julian.gehring at embl.de> wrote:

> Hi Brad,
> 
> I recall that there was a bug in some versions of the HDF5 driver with similar consequences.  Does the behavior still occur if you define the chunks to be along the second dimension of your matrix?
> 
> Best wishes
> Julian
> 
> 
> On 11/06/2013 03:55 PM, Brad Friedman [guest] wrote:
>> library(rhdf5)
>> go <- function(numRow = blocksize,
>>                chunksize = 4,
>>                numCol = 3,
>>                dims = c(numRow, numCol),
>>                start = 1,
>>                blocksize = 7)  {
>>   str(list(numRow = numRow, numCol = numCol,
>>            start = start,
>>            chunksize = chunksize,
>>            blocksize = blocksize))
>> 
>>   mtx <- matrix(1:(blocksize*numCol), ncol = numCol)
>>   cat("sum(matrix)=", sum(mtx), "\n")
>> 
>>   file.exists("x.hdf5") && unlink("x.hdf5")
>>   h5createFile("x.hdf5")
>>   h5createDataset(file="x.hdf5",
>>                   dataset = "x",
>>                   dims = dims,
>>                   H5type = "H5T_NATIVE_UINT32",
>>                   level = 0,
>>                   chunk= c(chunksize,numCol))
>> 
>>   h5write(mtx, "x.hdf5", name = "x",
>>           start = c(start, 1),
>>           stride = c(1,1),
>>           block = c(blocksize, numCol),
>>           count= c(1,1))
>> 
>>   {
>>     for(i in 1:10)
>>       print(sum(h5read("x.hdf5", "/x",
>>                        start = c(start, 1),
>>                        stride = c(1,1),
>>                        block = c(blocksize, numCol),
>>                        count= c(1,1))))
>>   }
>> }
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list