agentsclimarketplace

File path normalization and validation

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/file-path-normalization-and-validation

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill file-path-normalization-and-validation

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

  • 14 stars14 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 author says it does

Copied from the file, not written here

Use when when preparing to read Thermo Fisher Scientific .raw files using rawrr functions (readFileHeader, readSpectrum, readChromatogram, readIndex), or when retrieving cached assembly paths for the wrapped RawFileReader dependency.

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.1 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

file-path-normalization-and-validation

Summary

Normalize and validate file paths to binary raw mass spectrometry files before passing them to external executables or APIs. This skill ensures consistent path representation across platforms and verifies file existence, preventing runtime failures when rawrr functions invoke the RawFileReader .NET assembly.

When to use

When preparing to read Thermo Fisher Scientific .raw files using rawrr functions (readFileHeader, readSpectrum, readChromatogram, readIndex), or when retrieving cached assembly paths for the wrapped RawFileReader dependency. Apply this skill before invoking system calls to the rawrr executable or querying assembly metadata.

When NOT to use

  • Input is already a validated in-memory spectral object (mass spectrum or mass chromatogram) — normalization applies only to file paths, not to R data structures
  • Working with exchange format files (mzML, mzXML) converted by ProteoWizard or ThermoRawFileParser — those do not require rawrr assembly path validation
  • Performing statistical post-processing of LC-MS data after raw spectra have already been aggregated into feature tables — assembly path validation is irrelevant at downstream analysis stages

Inputs

  • character string: relative or absolute file path to a .raw file
  • character string: cached or uncached assembly path reference
  • ExperimentHub object or file path reference from tartare package

Outputs

  • character vector: normalized absolute file path to .raw file
  • character vector: normalized absolute file path to RawFileReader .NET assembly
  • logical: TRUE if file exists and is accessible, FALSE otherwise

How to apply

Invoke normalizePath() on the input file path to standardize path separators and resolve relative or symbolic references into absolute canonical form. Pass the normalized path to the data-reading function or system call. For assembly paths, call rawrr:::.rawrrAssembly() which internally queries rawrr::rawrrAssemblyPath() and returns the normalized file path to the precompiled .NET executable. Validate that the returned path is a non-empty character vector and that the file exists on disk using file.exists(). This normalization ensures consistent behavior across Windows, Linux, and macOS file system conventions and prevents path-related failures when invoking C# wrapper methods via system calls.

Related tools

  • rawrr (R package that wraps RawFileReader .NET assembly; provides internal functions to retrieve and normalize assembly paths) — https://github.com/fgcz/rawrr
  • RawFileReader (.NET assembly whose path must be normalized and validated before invoking via system calls from rawrr) — https://github.com/thermofisherlsms/RawFileReader
  • tartare (ExperimentData package providing test .raw files; file paths from this source require normalization before use)

Examples

rawrr_path <- normalizePath(system.file('extdata', 'sample.raw', package='tartare')); if (file.exists(rawrr_path)) { H <- rawrr::readFileHeader(rawrr_path) }

Evaluation signals

  • Returned path is a non-empty character vector of length ≥ 1
  • file.exists() returns TRUE for the normalized path on the current platform
  • Path uses forward slashes (/) or appropriate platform-specific separators consistently
  • Subsequent readFileHeader(), readSpectrum(), or readChromatogram() calls complete without path-related errors
  • Assembly version retrieval via rawrr:::.getRawrrAssemblyVersion() succeeds and returns a non-empty version string

Limitations

  • normalizePath() requires the file to exist before normalization; pre-flight file existence checks should precede path normalization
  • Assembly path caching assumes rawrr::rawrrAssemblyPath() has already been called during package initialization; if assembly installation has failed, path retrieval will return an empty or invalid path
  • Cross-platform path handling relies on R's native normalizePath() function; unusual mount points, network shares, or permission-restricted paths may not normalize as expected
  • The rawrr executable must be installed via rawrr::installRawrrExe() before assembly path queries will succeed; the skill assumes successful prior installation

Evidence

  • [other] Validate that both functions return non-empty character vectors and that the assembly file path exists on disk.: "Validate that both functions return non-empty character vectors and that the assembly file path exists on disk."
  • [other] The rawrr package provides internal functions rawrr:::.rawrrAssembly() to report the .NET assembly path: "The rawrr package provides internal functions rawrr:::.rawrrAssembly() to report the .NET assembly path and rawrr:::.getRawrrAssemblyVersion() to retrieve the assembly version"
  • [other] Create the internal function rawrr:::.rawrrAssembly() that queries the cached assembly path by invoking rawrr::rawrrAssemblyPath() and returns the normalized file path to the precompiled .NET executable.: "Create the internal function rawrr:::.rawrrAssembly() that queries the cached assembly path by invoking rawrr::rawrrAssemblyPath() and returns the normalized file path to the precompiled .NET"
  • [methods] R functions requesting access to data stored in binary raw files invoke compiled C# wrapper methods using a system call.: "R functions requesting access to data stored in binary raw files (reader family functions listed in Table 1) invoke compiled C# wrapper methods using a system call."
  • [methods] the extracted information is written to a temporary location on the harddrive, read back into memory: "the extracted information is written to a temporary location on the harddrive, read back into memory and parsed into R objects"

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 327,167. 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.