agentsclimarketplace

System call invocation via system2

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/system-call-invocation-via-system2

Use when you need to query or extract data from Thermo Fisher Scientific .raw files or other proprietary binary formats accessible only through a compiled external executable (e.g., RawFileReader .NET assembly). The executable returns text or structured output (e.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill system-call-invocation-via-system2

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.3 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

system-call-invocation-via-system2

License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->

Summary

Invoke external compiled executables (e.g., .NET assemblies, C# wrappers) from R using the system2() function, capture their output via text connections, and parse results back into R objects. This is essential for accessing binary file formats and vendor-supplied APIs that lack native R bindings.

When to use

You need to query or extract data from Thermo Fisher Scientific .raw files or other proprietary binary formats accessible only through a compiled external executable (e.g., RawFileReader .NET assembly). The executable returns text or structured output (e.g., CSV, JSON) that must be parsed into R data structures for downstream analysis.

When NOT to use

  • The desired functionality is already available as an R package or native function—use those instead to avoid subprocess overhead and platform-specific failures.
  • The input file format is already supported by standard R libraries (e.g., mzML via MSnbase, or CSV via read.csv)—conversion to exchange formats or native R I/O is more robust.
  • The executable is not reliably installed or its path is unknown—verify executable availability and register its path before invoking system2().

Inputs

  • executable path (character string)
  • command-line arguments (character vector)
  • raw binary file or resource identifier accessible to the external executable

Outputs

  • parsed R object (character vector, numeric vector, data.frame, or list)
  • version string (e.g., assembly version number)
  • structured data extracted from executable output

How to apply

  1. Identify the target external executable and its command-line interface (e.g., rawrr executable with version-query flag, or RawFileReader wrapper). 2. Use system2(command, args=c(...), stdout=TRUE) to invoke the executable with appropriate arguments, capturing output to a text connection. 3. Parse the returned text string using R's text parsing functions (e.g., read.csv(text=...), strsplit(), grep(), or regex extraction) to convert raw command output into typed R objects (numeric, character, data.frame, list). 4. Validate that the parsed result is non-empty and conforms to the expected schema before returning to the caller. 5. Handle file I/O overhead by reading temporary results from disk if the executable writes to a file rather than stdout.

Related tools

  • RawFileReader (External .NET assembly wrapping vendor-supplied Thermo Fisher API; invoked via system2() from R to read spectral data from proprietary .raw files) — https://github.com/thermofisherlsms/RawFileReader
  • rawrr (R package that wraps RawFileReader and uses system2() to invoke the compiled executable; provides high-level R functions that internally call system2()) — https://github.com/fgcz/rawrr
  • rawDiag (R package for LC-MS method optimization that also uses RawFileReader for fast multiplatform access to raw instrument data) — https://github.com/fgcz/rawDiag

Examples

rawrr:::.getRawrrAssemblyVersion()

Evaluation signals

  • system2() call executes without error and returns exit code 0
  • Parsed output is non-empty and matches the expected R class (character, numeric, data.frame, etc.)
  • Returned values conform to expected schema (e.g., version string is non-empty; data.frame has expected column names and row count)
  • File path or resource identifier passed to the executable is valid and accessible on the file system
  • Temporary files created during file I/O round-trips are cleaned up and do not accumulate on disk

Limitations

  • system2() introduces subprocess overhead and cross-platform variability; command syntax may differ on Windows vs. Unix-like systems.
  • The external executable must be installed and registered at a known path; missing or incompatible versions will cause silent or cryptic failures.
  • Parsing logic is tightly coupled to the executable's output format; changes in executable version or output structure require rewriting the parser.
  • Large outputs (e.g., thousands of spectra) require file I/O round-trips via temporary disk storage, which is slower than native R vectorized operations.
  • Error handling is limited; subprocess failures may not produce informative R error messages.

Evidence

  • [methods] R functions requesting access to data stored in binary raw files invoke compiled C# wrapper methods using a system call.: "Rfunctions requesting access to data stored in binary raw files (reader family functions listed in Table 1) invoke compiledC#` wrapper methods using a system call."
  • [methods] The extracted information is written to a temporary location on the harddrive, read back into memory and parsed into R objects: "the extracted information is written to a temporary location on the harddrive, read back into memory and [parsed into R objects]"
  • [other] rawrr provides internal functions to query the cached assembly path and retrieve the assembly version by invoking the executable with a version-query flag: "rawrr:::.getRawrrAssemblyVersion() that invokes the rawrr executable with a version-query flag via system2() and parses the text connection output to extract and return the version string"
  • [readme] rawrr wraps the functionality of the RawFileReader .NET assembly: "rawrr wraps the functionality of the RawFileReader .NET assembly"
  • [readme] RawFileReader is a group of .Net Assemblies written in C# used to read Thermo Scientific RAW files on Windows, Linux, and MacOS: "RawFilelReader is a group of .Net Assemblies written in C# used to read Thermo Scientific RAW files. The assemblies can be used to read RAW files on Windows, Linux, and MacOS"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.