agentsclimarketplace

Query string parsing and tokenization

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/query-string-parsing-and-tokenization

Use when when you have a user-provided or system-generated query string containing a chemical structure in unknown or mixed format, and you need to route it to a structure-specific API endpoint (such as ClassyFire) that requires knowing whether the input is SMILES, InChI, IUPAC nomenclature, or.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill query-string-parsing-and-tokenization

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

6.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

query-string-parsing-and-tokenization

License: noncommercial — confirm your use is a permitted (noncommercial) purpose before applying; commercial use requires a separate license (see metadata.tool_license). <!-- asb-license-banner -->

Summary

Parse and tokenize chemical structure query strings to extract optional compound identifiers and structural representations, then classify the representation type (SMILES, InChI, IUPAC name, or FASTA) for routing to the appropriate ClassyFire API endpoint. This skill enables flexible input handling for automated chemical compound classification.

When to use

When you have a user-provided or system-generated query string containing a chemical structure in unknown or mixed format, and you need to route it to a structure-specific API endpoint (such as ClassyFire) that requires knowing whether the input is SMILES, InChI, IUPAC nomenclature, or FASTA sequence notation.

When NOT to use

  • The input query is already known to be a single format (e.g., you have already validated it is valid SMILES) — skip to direct endpoint routing.
  • The structure format is not one of the four supported types (SMILES, InChI, IUPAC, FASTA) — routing will fail or produce undefined behavior.

Inputs

  • query string (tab-delimited: optional compound identifier + structural representation)
  • structural representation string (SMILES, InChI, IUPAC name, or FASTA format)

Outputs

  • parsed query object (compound identifier and structural representation)
  • structure type classification (SMILES | InChI | IUPAC | FASTA)
  • REST API request object or response from ClassyFire

How to apply

Split the input query string on a tab delimiter to separate an optional compound identifier from the structural representation. Detect the structural representation type by applying pattern matching against SMILES syntax rules (Daylight conventions), InChI prefix conventions (e.g., 'InChI=' prefix), FASTA format indicators (e.g., '>' header lines), or IUPAC nomenclature patterns. Once the type is identified, dispatch the parsed query to the corresponding ClassyFire API endpoint using the REST-client gem via POST method, supplying the appropriate parameter key for the detected structure type. Return the dispatched request object or API response for downstream classification processing.

Related tools

  • rest-client gem (HTTP client library for submitting POST requests to ClassyFire API endpoints with parsed query parameters)
  • Ruby (Programming language for implementing query parsing, type detection, and REST API dispatch logic)
  • ClassyFire API (Target API endpoint that receives parsed and routed structure queries for automated chemical compound classification) — bitbucket.org/wishartlab/classyfire_api

Evaluation signals

  • The query string is correctly split into identifier and structural representation components; tab delimiter is respected.
  • The detected structure type matches the actual format of the structural representation (e.g., SMILES strings start with valid atom symbols, InChI strings begin with 'InChI=', FASTA lines start with '>', IUPAC names follow nomenclature conventions).
  • The REST POST request is dispatched to the correct ClassyFire API endpoint for the detected structure type, with the appropriate parameter key.
  • The API response object is returned without transport errors; HTTP status code indicates successful submission (e.g., 200 or 202).
  • Compound classification results are retrievable from the returned response, confirming the structure was correctly parsed and routed.

Limitations

  • Pattern matching for IUPAC nomenclature can be ambiguous; complex or non-standard IUPAC names may fail detection.
  • Input must be well-formed and follow the tab-delimited convention; malformed queries will not parse correctly.
  • FASTA format detection relies on header line indicators; short or atypical FASTA sequences may be misclassified.
  • The skill does not validate the chemical correctness of the parsed structure; invalid but syntactically correct representations will still be routed and may fail at the ClassyFire API level.

Evidence

  • [other] The ClassyFire API accepts query input consisting of an optional compound identifier and structural representation separated by a tab: "The ClassyFire API accepts query input consisting of an optional compound identifier and structural representation separated by a tab, with the structural representation dispatched according to its"
  • [other] Detect the structural representation type by pattern matching against SMILES syntax rules, InChI prefix conventions, FASTA format indicators, or IUPAC nomenclature patterns: "Detect the structural representation type by pattern matching against SMILES syntax rules, InChI prefix conventions, FASTA format indicators, or IUPAC nomenclature patterns."
  • [other] Dispatch the parsed query to the corresponding ClassyFire API endpoint using the REST-client gem in Ruby, submitting via POST method: "Dispatch the parsed query to the corresponding ClassyFire API endpoint using the REST-client gem in Ruby, submitting via POST method with the appropriate parameter key for the detected structure type."
  • [intro] A query can be submitted using the POST method: "A query can be submitted using the POST method"

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.