Spectral pair similarity

From XuShuwenn/RedAct · View interactive version

Spectral pair similarity is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Find the most similar pair of spectra from an MSP file using matchms CosineGreedy and write a two-line, rounded report.

How to use this skill

Skill file

Spectral Pair Similarity with matchms (CosineGreedy)

Compute pairwise spectral similarity from an MSP file using matchms and identify the most similar spectrum pair. This skill emphasizes robust handling of similarity return types and metadata name keys.

When to Use

Use this skill when:

Core Workflow

  1. Load spectra from MSP:
  1. Configure similarity:
  1. Compute pairwise scores:
  1. Track the best:
  1. Format result:

Score Extraction (Robust to matchms Variations)

CosineGreedy.pair(a, b) may return different shapes depending on version:

Use this robust procedure:

Verification

Before finalizing:

Common Pitfalls and How to Avoid Them

Optional Script Usage

A helper script is provided to run the workflow from the command line:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.