agentsclimarketplace

Json payload construction for nmr spectra

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/json-payload-construction-for-nmr-spectra

Use when when you have NMR peak assignments (1H and 13C chemical shift values) and need to submit them to the /api/smart3/search endpoint for automated structure classification. Use this skill before making API calls to ensure peak data conforms to the expected JSON schema.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill json-payload-construction-for-nmr-spectra

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

5.5 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

json-payload-construction-for-nmr-spectra

Summary

Construct a JSON payload containing NMR peak data (1H and 13C chemical shifts) formatted as a list of dictionaries for submission to the DeepSAT SMART 3 classification API. This skill enables programmatic classification of NMR spectra by encoding peak coordinates in the expected schema.

When to use

When you have NMR peak assignments (1H and 13C chemical shift values) and need to submit them to the /api/smart3/search endpoint for automated structure classification. Use this skill before making API calls to ensure peak data conforms to the expected JSON schema.

When NOT to use

  • Peak data is already in a different API-accepted format (e.g., already serialized and validated by prior step)
  • Chemical shift values are missing or incomplete for either 1H or 13C dimension
  • Model input schema has changed and your local code references outdated field names without checking /model/metadata

Inputs

  • NMR peak chemical shift values (1H and 13C coordinates)
  • Model metadata from /model/metadata endpoint (to verify schema)
  • Structured peak data as Python list or equivalent in-memory structure

Outputs

  • JSON payload string (list of dictionaries with 1H and 13C keys)
  • HTTP response with classification predictions and confidence scores
  • Structured log file with request parameters, response timestamp, and results

How to apply

Retrieve the current input schema from the /model/metadata endpoint via TensorFlow Serving to verify field names and structure. Organize your peak data into a list where each element is a dictionary with '1H' and '13C' keys mapped to corresponding chemical shift values (numeric). Construct the JSON payload by serializing this list structure. Validate that all required fields are present and values are numeric before submitting via POST request to /api/smart3/search. Parse the returned JSON response to extract classification predictions and confidence scores, logging request parameters and response timestamp for audit purposes.

Related tools

  • TensorFlow Serving (Serves model metadata endpoint to retrieve and verify current input schema and model version)
  • DeepSAT (Hosts the /api/smart3/search endpoint that accepts and processes the JSON payload for NMR structure classification) — https://github.com/mwang87/DeepSAT

Examples

import json; import requests; peaks = [{'1H': 7.32, '13C': 128.5}, {'1H': 3.82, '13C': 52.1}]; payload = json.dumps(peaks); response = requests.post('http://api.deepsat.org/api/smart3/search', data=payload, headers={'Content-Type': 'application/json'}); results = response.json(); print(results)

Evaluation signals

  • JSON payload is valid and parseable (no syntax errors)
  • All peaks in the payload have both '1H' and '13C' keys with numeric values
  • HTTP response status code is 200 or 201, indicating successful submission
  • Returned JSON contains classification predictions and confidence scores (not error messages)
  • Request/response timestamps and prediction results are correctly logged to output file with no missing entries

Limitations

  • If model input names change in TensorFlow Serving, code must be updated to match the new schema — no backward compatibility guarantee
  • No changelog is available to track schema or API changes, requiring manual verification via /model/metadata on each deployment
  • Payload construction assumes 1H and 13C are the only required peak dimensions; other isotopes or multi-dimensional data are not addressed

Evidence

  • [other] The /api/smart3/search endpoint accepts peaks as a JSON list of dictionaries with 1H and 13C as headers for programmatic classification requests.: "The /api/smart3/search endpoint accepts peaks as a JSON list of dictionaries with 1H and 13C as headers for programmatic classification requests."
  • [intro] Classify programmatically. You can put in your peaks as a json list of dicts, with 1H,13C as headers: "Classify programmatically. You can put in your peaks as a json list of dicts, with 1H,13C as headers"
  • [intro] We pass through tensorflow serving at this url: /model/metadata: "We pass through tensorflow serving at this url: /model/metadata"
  • [intro] If the model input names change, then we need to change it in the code: "If the model input names change, then we need to change it in the code"
  • [other] Construct a JSON payload as a list of dictionaries, each containing 1H and 13C peak keys and corresponding chemical shift values.: "Construct a JSON payload as a list of dictionaries, each containing 1H and 13C peak keys and corresponding chemical shift values."

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.