Use when after extracting structured metadata (e.g., instrument parameters,
Scanned 9/12/2026
Install to Claude Code
npx -y skills add HolobiomicsLab/asb-skill-collections --skill r-list-object-serialization --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of R List Object Serialization?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/holobiomicslab-r-list-object-serialization)More formats (shields.io, HTML) on the badges page.
---
name: r-list-object-serialization
description: Use when after extracting structured metadata (e.g., instrument parameters,
scan counts, time ranges) from Thermo Fisher Scientific .
license: CC-BY-4.0
metadata:
edam_operation: http://edamontology.org/operation_3763
edam_topics:
- http://edamontology.org/topic_0121
- http://edamontology.org/topic_3520
tools:
- RawFileReader
- rjson
- readFileHeader()
- rawrr
license_tier: open
provenance_tier: literature
derived_from:
- doi: 10.1101/2020.10.30.362533
title: rawrr
- doi: 10.1021/acs.jproteome.0c00866
title: ''
evidence_spans:
- Calling a wrapper method typically results in the execution of methods defined in
the `RawFileReader` dynamic link library provided by Thermo Fisher Scientific.
- invoke compiled `C#` wrapper methods using a system call. Calling a wrapper method
typically results in the execution of methods defined in the `RawFileReader` dynamic
link library provided by Thermo
- rjson::toJSON
claims: []
provenance:
collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
assembled_by: scripts/collect_metabolomics_collection.py
sources:
- build: coll_rawrr_2_cq
doi: 10.1101/2020.10.30.362533
title: rawrr
dedup_kept_from: coll_rawrr_2_cq
schema_version: 0.2.0
attribution:
generator: AgenticScienceBuilder
original_doi: 10.1101/2020.10.30.362533
all_source_dois:
- 10.1101/2020.10.30.362533
- 10.1021/acs.jproteome.0c00866
zenodo_doi: 10.5281/zenodo.20794027
curators: []
promoter: Louis-Félix Nothias
sponsor: CNRS & Université Côte d'Azur
---
# R List Object Serialization
## Summary
Convert R list objects extracted from binary proteomics data files into JSON format for portability, validation, and downstream integration. This skill bridges in-memory R data structures with file-based interchange formats, enabling modular end-to-end analysis pipeline development.
## When to use
Apply this skill after extracting structured metadata (e.g., instrument parameters, scan counts, time ranges) from Thermo Fisher Scientific .raw files via readFileHeader() or similar list-returning functions, and you need to persist, validate, or hand off that metadata to non-R tools or external pipelines without losing structure.
## When NOT to use
- Input is already a JSON string or file — serialize only R objects, not data already in interchange format.
- Metadata is small enough to embed directly in R scripts or configuration files — serialization adds overhead when direct in-memory passing suffices.
- Downstream tools require binary or columnar formats (e.g., NetCDF, HDF5) for performance — JSON is text-based and may not scale for large spectral datasets.
## Inputs
- R list object (e.g., returned by readFileHeader())
- list object containing instrument metadata (instrument model, file name, time range, scan count, software version)
## Outputs
- JSON file (.json extension)
- Validated JSON string with all list keys and values intact
## How to apply
After calling readFileHeader() or another rawrr function that returns an R list object containing dynamically-generated metadata items, serialize the list to JSON format using rjson::toJSON(). Write the serialized output to a file with .json extension. Verify the output file exists and parse it back into R or another language to confirm valid JSON structure and that all expected keys (instrument model, file name, time range, number of scans, etc.) are preserved without data loss or type corruption. This approach is necessary because the extracted metadata varies by instrument model and control software version, making JSON a flexible interchange format that documents the actual schema discovered at runtime.
## Related tools
- **rjson** (R package for serializing R objects to JSON format)
- **readFileHeader()** (rawrr function that extracts file header metadata as an R list from Thermo .raw files) — https://github.com/fgcz/rawrr
- **rawrr** (R package wrapping RawFileReader .NET assembly to read Thermo Fisher Scientific .raw files and return structured R objects) — https://github.com/fgcz/rawrr
## Examples
```
H <- rawrr::readFileHeader('autoQC01.raw'); json_str <- rjson::toJSON(H); writeLines(json_str, 'autoQC01_header.json'); parsed <- rjson::fromJSON(file='autoQC01_header.json'); identical(names(H), names(parsed))
```
## Evaluation signals
- Output .json file exists and is readable as text.
- JSON is valid (parseable by rjson::fromJSON() or another JSON parser without syntax errors).
- All keys from the original R list appear in the JSON object with no omissions.
- Data types are correctly preserved (strings, integers, arrays, nested objects) after round-trip serialization and deserialization.
- Instrument-specific metadata fields (instrument model, software version) are present and match the values in the original R list object.
## Limitations
- JSON serialization does not preserve R-specific attributes (e.g., class, factors, custom object metadata) — only basic types (list, vector, string, number, logical).
- Dynamically-generated metadata fields vary by instrument model and control software version, so JSON schemas cannot be fixed a priori; validation must be schema-agnostic or schema-discovery-based.
- Large nested list structures or high-dimensional arrays may produce verbose or inefficient JSON; consider compression or column-based formats (Parquet, HDF5) for big proteomics datasets.
- JSON does not natively support complex number types or missing value markers (NA) in R; these must be encoded as strings or null, requiring custom parsing on deserialization.
## Evidence
- [methods] List object serialization for metadata interchange: "readFileHeader() retrieves metadata from binary raw files including instrument model, file name, time range of data acquisition, and number of scans, returning these items as a list object containing"
- [other] JSON serialization workflow with rjson: "Call readFileHeader() to extract the file header as an R list object. 3. Serialize the list to JSON format using rjson::toJSON. 4. Write the serialized JSON to an output file with .json extension. 5."
- [results] Metadata variability by instrument version: "The respective function is called `readFileHeader()` and returns a simple `R` object of type `list`"
- [methods] File I/O for data extraction and return to R: "Extracted information is written to a temporary location on the harddrive, read back into memory and parsed into R objects"
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!