lifs-tools / rmzTab-m

The R-language bindings for mzTab-M
https://lifs-tools.github.io/rmzTab-m/
MIT License
4 stars 1 forks source link

Failure in assay #8

Closed sneumann closed 4 years ago

sneumann commented 4 years ago

Hi, currently R CMD check fails in the test_assay.R with an Fix error in tests 'safe_unbox' is not an exported object from 'namespace:rmzTabM' but adding @export in https://github.com/lifs-tools/rmzTab-m/blob/development/R/json_utils.R#L3 gives a new error which could mean my quick fix was the wrong strategy:

2. Error: reading and writing of mztab json works (@test-
Only atomic vectors of length 1 or data frames with 1 row can be unboxed.
Backtrace:
 1. rmzTabM::writeMzTabJSONToFile(mzTabObject, tmpfile)
 4. mztab$toJSON()
 5. self$metadata$toJSON()
 6. base::lapply(self$assay, function(x) x$toJSON())
 7. rmzTabM:::FUN(X[[i]], ...)
 8. x$toJSON()
 9. rmzTabM::safe_unbox(self$ms_run_ref)

── 3. Error: assay (@test_assay.R#27)  ─────────────────────
$ operator is invalid for atomic vectors
Backtrace:
 1. model.instance$toJSONString()
 4. jsonlite::toJSON(...)
 5. base::force(x)
nilshoffmann commented 4 years ago

Yes, that is one of the places where I was battling with jsonlite's default unboxing and implemented a custom method.

nilshoffmann commented 4 years ago

@sneumann Please check, I just pushed a version that fixes the JSON serialization and runs the small lipidomics sample successfully against the updated mztabvalidator-dev REST API at https://apps.lifs.isas.de/mztabvalidator-dev

nilshoffmann commented 4 years ago

Please check and report back if this is still an issue. Should be fixed now.