New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring hdf5 branch up-to-date #408
Conversation
- Add .h5write_spectra to write a list of Spectrum objects to an HDF5 file. - Add related unit tests.
- Implement a consolidate function that does an in-place replacement of the input Hdf5MSnExp. - Add related unit tests and documentation.
- Rename consolidate to writeHdf5Data. - Write also an md5 sum of the spectrum data to each hdf5 file and store this also within the Hdf5MSnExp. - Reading data will compare the md5 in the file with the one in the object and throw an error if they don't match.
- convertToHdf5MSnExp converts OnDiskMSnExp objects and objects extending it to Hdf5MSnExp objects. This can also be used to *restore* corrupt Hdf5MSnExp files (issue #405).
backend = character())) | ||
|
||
validHdf5MSnExp <- function(object) { | ||
validHdf5MSnExp <- function(object, check_md5 = TRUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validity can be checked with and without checking also whether the content of the hdf5 files has changed. The latter is performed by default. validObject()
will perform a basic check with check_md5 = FALSE
.
#' file.remove(hdf5FileName(x)) | ||
.Hdf5MSnExp <- setClass("Hdf5MSnExp", | ||
slots = c(hdf5file = "character", | ||
md5sum = "character"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slot md5sum
stores the md5 sums of the spectra within a hdf5 file. The same number is stored into the file upon generation of the hdf5 file. Also, updateHdf5MSnExp
updates both the md5 sum in the file and the one in this slot. If they are not the same, the hdf5 file has been changed.
I won't have time to review this right now. Feel free to merge it directly @jotsetung |
I'd rather go for the developments we're doing now in the backends and backends_jo branches. I will take some stuff from here (hdf5 reading etc) and include it there. |
updateHdf5MSnExp
function to consolidate/save any data changes back to the hdf5 files.filterFile,Hdf5MSnExp
to ensure that also thehdf5file
slot gets updated correctly.convertToHdf5MSnExp
to convert anOnDiskMSnExp
to aHdf5MSnExp
object (instead ofas
, since that does not support required additional arguments.