agentsclimarketplace

R object inspection and validation

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/gc-ms/skills/r-object-inspection-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 r-object-inspection-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 after performing assignment operations (assign_ri, assign_smiles) or combining multiple library objects (e.

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

R Object Inspection and Validation

Summary

Verify that mass spectral library objects in R have been correctly populated with expected fields (e.g., RI, SMILES, InChIKey) after compilation and assignment operations. This skill ensures data integrity before writing libraries to MSP format or downstream use in MS-DIAL.

When to use

After performing assignment operations (assign_ri, assign_smiles) or combining multiple library objects (e.g., via c(nist_ei, riken_ei, mona_ei)), inspect the resulting R object to confirm that target fields were populated correctly and no records were inadvertently dropped or corrupted during the workflow.

When NOT to use

  • When you have not yet performed any assignment operations and are simply exploring the raw input library structure.
  • When working with libraries that are known to not require RI or SMILES fields (e.g., in-house libraries without structural annotation).
  • If the inspection goal is statistical modeling or clustering of spectral features rather than data quality assurance before export.

Inputs

  • Compiled EI library R object (from read_lib or combine operations)
  • Compiled MS2 library R object
  • Combined library object (result of c() operation on multiple library objects)

Outputs

  • Inspection report (printed to console)
  • Validation summary (logical TRUE/FALSE or warning messages)
  • Test MSP file subset (optional verification output)

How to apply

Load the compiled library object in R and inspect its structure using standard R inspection tools (e.g., str(), head(), summary(), or direct column access). For RI assignment, verify that the RI column contains numeric values and check a sample of records to confirm Kovats RI values are present and within expected ranges for the chosen polarity (semi-polar, non-polar, or polar). When verifying SMILES assignment, spot-check that the SMILES field is populated with valid SMILES strings matching the compound identities. For combined objects, confirm the total number of records and absence of NAs in critical fields. As a final validation step, write a small subset of the library to MSP format using write_EI_msp() and manually inspect the resulting MSP file to confirm RI and SMILES fields are present in the output.

Related tools

  • mspcompiler (provides R functions (read_lib, assign_ri, assign_smiles, write_EI_msp) that generate and export library objects to be inspected) — https://github.com/QizhiSu/mspcompiler
  • R (execution environment; built-in functions str(), head(), summary() used for object inspection)
  • MS-DIAL (downstream application that consumes validated MSP libraries; inspection confirms compatibility) — http://prime.psc.riken.jp/compms/msdial/main.html

Examples

# Inspect combined EI library after RI assignment
str(combine_ei)
head(combine_ei)
# Check RI column for NAs and verify numeric values
summary(combine_ei$RI)
# Write test subset and inspect output
write_EI_msp(combine_ei[1:100], "D:/MS_libraries/test_output.msp")

Evaluation signals

  • RI column contains numeric values and no NAs for compounds matched to semi-polar (or specified polarity) GC columns.
  • SMILES field is populated with valid SMILES strings (spot-check: compound names match their SMILES chemical structure).
  • Total record count in combined object equals or exceeds the sum of input libraries minus expected deduplicates.
  • InChIKey or name-based matching succeeded without misalignment (verify via head() on key columns).
  • MSP file written from library contains RI and SMILES fields in the output (manual inspection of write_EI_msp() output confirms presence).

Limitations

  • RI assignment filters records by polarity (semi-polar, non-polar, polar) and column type (capillary only); non-capillary RI records are discarded by design, so absence of RI in some compounds is expected.
  • RI values with standard deviation >30 across multiple records are discarded; median RI is used when multiple records exist, which may hide inter-lab variation.
  • SMILES assignment depends on successful matching by name or InChIKey; compounds with ambiguous or missing names may fail to match and remain unassigned.
  • Large libraries (hundreds of thousands of MOL files or compounds) may require substantial memory and time to inspect comprehensively; subset inspection may be necessary on memory-limited systems.

Evidence

  • [other] Verify that RI fields are populated in the resulting library object by inspecting the RI column in the output or writing the output to MSP format using write_EI_msp and confirming RI presence in the file.: "Verify that RI fields are populated in the resulting library object by inspecting the RI column in the output or writing the output to MSP format using write_EI_msp and confirming RI presence in the"
  • [readme] Assign experimental RI to the combined library depending on the column polarity. The polarity can be "semi-polar", "non-polar", or "polar". Providing that "capillary" GC columns are commonly used. This function will only keep RI records from "capillary" columns and "Lee RI" will be removed. When there are multiple records for a single compound, the median RI will be used and if the standard deviation is higher than 30, this value will be discarded.: "This function will only keep RI records from "capillary" columns and "Lee RI" will be removed. When there are multiple records for a single compound, the median RI will be used and if the standard"
  • [readme] Assign SMILES to the library. If you are working with Linux-based or Mac OS, please use "match = "inchikey". nist_ei <- assign_smiles(nist_ei, nist_ei_structure, match = "name"): "Assign SMILES to the library. If you are working with Linux-based or Mac OS, please use "match = "inchikey"."
  • [readme] After read in and organize all these libraries, we can now combine them into a single file, assign experimental RI retrieved from the "ri.dat" and "USER.DBU" files: "After read in and organize all these libraries, we can now combine them into a single file, assign experimental RI retrieved from the "ri.dat" and "USER.DBU" files"

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 328,083. 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.