agentsclimarketplace

Molecular candidate ranking

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/molecular-candidate-ranking

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 molecular-candidate-ranking

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 a trained CNN model has generated molecular embeddings for query spectra, and you need to retrieve the most likely candidate molecules from a reference database.

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.0 KB, as published. Nobody here has run it

molecular-candidate-ranking

Summary

Rank reference database molecules by similarity to CNN-predicted molecular embeddings to identify the most likely candidate structures. This skill bridges model prediction and molecule identification by filtering and ordering matches using distance metrics.

When to use

After a trained CNN model has generated molecular embeddings for query spectra, and you need to retrieve the most likely candidate molecules from a reference database. Use this skill when you have both predicted embeddings (from MS/MS spectra) and pre-computed reference database embeddings, and similarity scores alone are insufficient—you need a ranked, filtered list ordered by match confidence.

When NOT to use

  • Query embeddings have not been generated or validated—embedding quality directly determines ranking validity.
  • Reference database embeddings are stale or incompatible with the query embedding space (e.g., from a different CNN architecture or training run).
  • The number of candidates required is extremely large (>1000) or the database is too small (<10 reference compounds), making ranking less discriminative.

Inputs

  • CNN-predicted molecular embeddings for query spectra (vector format)
  • Reference database embeddings (pre-computed vector representations)
  • Similarity threshold parameter (float, typically 0.5–0.95 depending on metric)
  • Distance metric specification (e.g., 'cosine_similarity' or 'euclidean')

Outputs

  • Ranked candidate list (molecules sorted by decreasing similarity score)
  • Match scores for each candidate (numeric, 0–1 or distance units)
  • Reference molecule identifiers (e.g., InChI, compound names, database IDs)
  • Filtered candidates CSV or structured table with top-N results

How to apply

Compute pairwise similarity scores between query embeddings and all reference database embeddings using a distance metric such as cosine similarity or Euclidean distance. Rank reference molecules in descending order by similarity score for each query compound. Apply a similarity threshold to retain only high-confidence matches, filtering out weak matches below the threshold. Generate a ranked candidate list annotated with match scores and reference molecule identifiers. The ranking and filtering steps are interdependent: the distance metric choice (cosine vs. Euclidean) directly affects which molecules rank highest, and the threshold acts as a hard cutoff to control candidate set size and false-positive rate.

Related tools

Examples

python main.py --config config.yaml
# where config.yaml specifies top_n_candidates: 5, distance metric: cosine_similarity, similarity_threshold: 0.7

Evaluation signals

  • Ranked list is sorted in descending order by similarity score with no inversions or ties inconsistently ordered.
  • All candidates in the output exceed the specified similarity threshold; no candidates below threshold are retained.
  • Reference molecule identifiers in output match valid entries in the reference database pickle file (no orphaned or corrupted IDs).
  • Match scores are within expected range (0–1 for cosine similarity, or non-negative for Euclidean distance) and are mathematically consistent with the distance metric used.
  • Top-N candidates returned does not exceed the configured top_n_candidates parameter; list is truncated or padded consistently if fewer high-scoring matches exist.

Limitations

  • Ranking quality depends critically on the quality and representativeness of reference database embeddings; sparse or biased reference databases will produce poor candidate sets even with high similarity scores.
  • The choice of distance metric (cosine vs. Euclidean) significantly impacts ranking order; no universal metric works optimally across all embedding spaces or chemical domains.
  • Threshold selection is data- and model-dependent; a fixed threshold may be too stringent on small databases or too permissive on large ones, and the README does not provide principled guidance for threshold tuning.
  • The framework matches embeddings without considering chemical feasibility, synthetic accessibility, or domain-specific priors; a highly ranked candidate may be chemically implausible or unavailable.

Evidence

  • [other] Compute pairwise similarity scores between query embeddings and all reference database embeddings using a distance metric (e.g., cosine similarity or Euclidean distance).: "Compute pairwise similarity scores between query embeddings and all reference database embeddings using a distance metric (e.g., cosine similarity or Euclidean distance)."
  • [other] Rank reference molecules by similarity score in descending order for each query.: "Rank reference molecules by similarity score in descending order for each query."
  • [other] Filter candidate matches by applying a similarity threshold to retain only high-confidence matches.: "Filter candidate matches by applying a similarity threshold to retain only high-confidence matches."
  • [readme] Matches predicted embeddings with a reference database to find top candidate molecules based on cosine similarity.: "Matches predicted embeddings with a reference database to find top candidate molecules based on cosine similarity."
  • [readme] top_n_candidates: Number of top candidate molecules to retrieve from the reference database. (default: 5): "top_n_candidates: Number of top candidate molecules to retrieve from the reference database. (default: 5)"

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.