Closed philouail closed 3 months ago
So, unfortunately I tried the alabaster saveObject()
and loadObject()
for the spectraData() and it seems to not work:
>library(xcms)
>library(alabaster)
>library(Spectra)
> xmse <- loadXcmsData()
> df <- spectraData(spectra(xmse))
> tmp <- tempfile()
> saveObject(df, tmp)
> list.files(tmp)
[1] "basic_columns.h5" "OBJECT"
> validateObject(tmp)
> loadObject(tmp)
Error in info[["$schema"]] : subscript out of bounds
or
> b <- MsBackendMzR()
> b
MsBackendMzR with 0 spectra
> spectraData(b)
DataFrame with 0 rows and 19 columns
> df <- spectraData(b)
> tmp <- tempfile()
> saveObject(df, tmp)
> list.files(tmp)
[1] "basic_columns.h5" "OBJECT" "other_columns"
> validateObject(tmp)
> loadObject(tmp)
Error in info[["$schema"]] : subscript out of bounds
I will look more into it and maybe create and issue.
On the brighter side they have a package to serialize the SummarizedExperiment
object: https://github.com/ArtifactDB/alabaster.se
Regarding the alabastter issues/errors above: you should use readObject()
instead of loadObject()
:)
Regarding the alabastter issues/errors above: you should use
readObject()
instead ofloadObject()
:)
Well i should have figured that out, thaanks :)
Hi @jorainer, i've updated to fix the dependency. Can you check again and merge if it's all good ? also I cannot see the comments you made during our meeting but i think i fixed everything, do tell me if i am missing something.
Alright so here is the code that allows to save and load an
MsBakendMzR
object. This refer to #2Few topics of discussion:
alabaster
package, instead of usingwriteLines()
andread.table()
to import and export thespectraData
. @lgatto is that what you had in mind ?MsBackendMzR.R
file because the initial code tosub()
thedataStorage()
of the object did not work in my windows system. I don't know if it's the best way to do it.Once this is pushed I will continue to move and change the code for saving/loading a
Spectra
object,...