structure-similarity-search
Skill0 starsChanged 14 days agoApache-2.0View on GitHub
Search PubChem and ChEMBL for compounds structurally similar to a query (Tanimoto similarity) or containing a query substructure. Use when finding analogs of hits, checking structural novelty of a compound, identifying related compounds with known bioactivity or ADMET data, or surveying prior art for patent landscape. Do not use to verify a compound identifier resolves (use compound-identity-resolution), to retrieve bioactivity data (use bioactivity-landscape), or to compute molecular descriptors or drug-likeness (use compound-property-profile).
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- GoogleCloudPlatform/LifeSciencesedited, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- GoogleCloudPlatform/LifeSciences★ 5798% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository43 other files it gives its agents.
- pharmakon-discovery-engineSkill
- admet-property-predictionSkill
- artifact-conventionsSkill
- binding-mode-analysisSkill
- bioactivity-landscapeSkill
- brain-atlasSkill
- citation-resolutionSkill
- citation-verificationSkill
- competitive-differentiationSkill
- compound-identity-resolutionSkill
- compound-property-profileSkill
- debate-protocolSkill
- disease-transcriptomicsSkill
- elo-tournamentSkill
- evolution-operatorsSkill
- hypex-tool-setupSkill
- hypothesis-entrySkill
- hypothesis-run-corpusSkill
- hypothesis-schemaSkill
- in-vivo-pk-analysisSkill
- literature-searchSkill
- manufacturing-feasibilitySkill
- meta-review-protocolSkill
- model-organism-phenotypeSkill
- pharmakon-discovery-engineSkill
- pkde-dashboardSkill
- pocket-druggabilitySkill
- preclinical-safety-assessmentSkill
- program-state-managementSkill
- protein-structure-confidenceSkill
- proximity-protocolSkill
- regulatory-variant-effectSkill
- review-rubricSkill
- run-protocolSkill
- safety-screenSkill
- sar-series-analysisSkill
- single-cell-expressionSkill
- site-generationSkill
- stage1-gate-evaluationSkill
- structure-screeningSkill
- target-genetic-evidenceSkill
- tissue-expression-profileSkill
- tournament-corpusSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when you need to find structurally related compounds in public databases.
- Very specific: line 38
Run pkde doctor before first use.
- Very specific: line 48
Run search or substructure before analyze.
- Very specific: line 74
When analyze reads a substructure artifact, all hits have tanimoto: null, so max_tanimoto is 0.0 -- below every threshold.
- Very specific: line 114
Novel: no hits above the similarity threshold.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
1. When to use, and when not
Use this skill when you need to find structurally related compounds in public databases. Entry points include:
- Finding analogs of a hit compound for medicinal chemistry exploration.
- Checking structural novelty ("is this compound already known?").
- Finding related compounds with known bioactivity or ADMET data to inform a lead series.
- Identifying prior art for patent landscape analysis.
Do not use when:
- You need to verify that a compound identifier resolves to a real
record ->
compound-identity-resolution. - You need binding affinity or docking scores
->
binding-mode-analysis. - You need computed molecular descriptors or drug-likeness
->
compound-property-profile. - You need bioactivity data, dose-response curves, or
target-activity relationships ->
bioactivity-landscape.
2. Preconditions
- Input: a SMILES string. Validated locally via RDKit before any network call. Unparseable SMILES are refused (exit 9).
- Network access required for
searchandsubstructure. Theanalyzesubcommand is offline. - No authentication needed -- both registries are public APIs.
- Source selection (
--source):pubchem,chembl, orboth(default). - Run
pkde doctorbefore first use.
3. Tool invocations
| Question | Run | Writes to |
| What known compounds are structurally similar? | pkde similar search <SMILES> [--source both] [--threshold <T>] [--max-results 20] | raw/compounds/<slug>.similar-<source>.json + .meta.json |
| What known compounds contain this substructure? | pkde similar substructure <SMILES> [--source both] [--max-results 20] | raw/compounds/<slug>.substruct-<source>.json + .meta.json |
| What is the verdict? | pkde similar analyze <SMILES> | raw/compounds/<slug>.similar.analysis.json |
Run search or substructure before analyze. analyze reads from
disk and applies the similar-search threshold set. No network.
--threshold applies to similarity search only. Substructure
containment is boolean, not scored -- there is no threshold to set.
Output options: --json, --quiet, --out on all three subcommands.
--from on analyze only.
4. Interpretation contract
Outcomes
analyze returns one of:
- exact-match -- at least one hit at or above the exact_match_cutoff threshold. The compound itself is in the database.
- known-compound-found -- at least one hit at or above the tanimoto_similarity_cutoff threshold (but below exact_match_cutoff). Structurally similar compounds exist.
- novel -- no hits above tanimoto_similarity_cutoff. The compound is structurally novel with respect to the queried databases.
Substructure-only analyze always returns "novel." Substructure
hits do not carry Tanimoto scores (containment is not similarity).
When analyze reads a substructure artifact, all hits have
tanimoto: null, so max_tanimoto is 0.0 -- below every threshold.
This is correct behavior. If you need a similarity verdict, run
search (not substructure) first. Substructure results are useful
on their own for motif-based queries ("what compounds share this
pharmacophore?") but should not be piped through analyze for a
novelty verdict.
Exit codes
- exit 0 -- an answer, including a negative one.
- exit 9 -- refusal. Unparseable SMILES (validated by RDKit before any network call). Change the input.
- exit 1-8 -- failure (network, upstream API, etc.).
Mandatory relays
| Relay code | Kind | Fires when | Obligation |
similar.tanimoto_is_2d_only | Qualifier (claim-triggered) | At least one hit returned (conditional) | Tanimoto similarity is computed from 2D fingerprints and reflects shared substructure topology, not 3D shape complementarity or biological activity. Two compounds with high Tanimoto may have very different binding modes, selectivity profiles, or ADMET properties. Do not equate structural similarity to functional similarity. |
similar.database_coverage_limited | Qualifier (defect-triggered) | Always (unconditional) | PubChem and ChEMBL cover a fraction of chemical space. A compound with no similar hits may have close analogs in proprietary collections, patent literature, or databases not queried. Do not treat "novel by PubChem/ChEMBL" as "novel." |
The unconditional relay is justified: the novelty claim -- "nothing like this exists" -- is the claim most likely to be over-read. The relay converts a claim of absence into a scoped claim.
Consequence rules
- Exact-match: the compound itself is already in the database.
Both relays fire (
tanimoto_is_2d_onlybecause hits exist,database_coverage_limitedunconditionally). An exact match on 2D fingerprint is necessary but not sufficient for identity -- confirm viacompound-identity-resolutionif needed. - Known-compound-found: structurally similar compounds exist.
Both relays fire (
tanimoto_is_2d_onlybecause hits exist,database_coverage_limitedunconditionally). The Tanimoto score measures 2D topology, not biological function -- two compounds with high Tanimoto may have very different activity profiles. The similar compound's known properties are useful leads for investigation, not conclusions. - Novel: no hits above the similarity threshold.
database_coverage_limitedalways fires.tanimoto_is_2d_onlyfires only when hits exist (novel-with-hits, where all scores fell below the threshold). "Novel" means "not found in the databases searched at the given threshold."
Threshold set: similar-search@1.0
Three thresholds (cite by name, never by value):
- tanimoto_similarity_cutoff -- the Tanimoto score below which
hits are not considered "similar." Configurable via
--thresholdand program overrides. Not a scientific constant -- different fingerprint types and radii produce different similarity distributions. Quotethresholds_appliedfrom the analysis artifact to report the value in force. - exact_match_cutoff -- fixed. Tanimoto at this cutoff with the same fingerprint is a necessary (not sufficient) condition for identity.
- novelty_threshold -- UNRESOLVED. "How similar is too similar?" is a program decision that depends on the patent landscape, the therapeutic area, and the IP strategy. The tool reports hits and their scores; the classification is the specialist's. Do not invent a value for this threshold.
What this section produces
Following this contract produces a Layer 1 finding in findings/
that cites the .analysis.json, satisfies all mandatory relays, and
does not over-read a "novel" verdict. Everything the tools emitted
stays under raw/compounds/.
5. Failure modes and anti-fabrication guard
Do not compute these values yourself. The value is whatever the tool emitted. If the tool did not run, there is no value. If a required tool is unavailable, report the task as blocked. Do not estimate, and do not proceed on an assumed result.
Named pathologies
- Equating Tanimoto similarity to functional similarity. Two compounds with high Tanimoto may have very different binding modes, selectivity profiles, ADMET properties, and biological activity. Structural similarity is a starting point for investigation, not a conclusion about function.
- Treating "novel by PubChem/ChEMBL" as "novel." These databases cover a fraction of chemical space. Proprietary collections, patent filings, unpublished compounds, and specialty databases are not searched. A "novel" verdict means "not found here," not "does not exist."
- Using substructure search for novelty assessment. Substructure
containment is a structural relationship ("does compound X contain
motif Y?"), not a similarity measure. Running
analyzeon substructure-only results always returns "novel" because substructure hits lack Tanimoto scores. Use similarity search for novelty assessment. - Treating a near-threshold hit as definitive. A hit at the tanimoto_similarity_cutoff boundary is a function of the threshold, the fingerprint type, and the fingerprint radius, not a biological truth. Different ECFP radii can shift the score for the same compound pair.
- Inventing a novelty threshold. The novelty_threshold is UNRESOLVED by design. "How similar is too similar?" is a program decision. Do not pick a number -- report the scores and let the program decide.
6. Provenance
Databases queried:
- PubChem PUG REST -- NCBI's public compound database. Similarity and substructure endpoints use an asynchronous ListKey protocol (the tool handles polling internally).
- ChEMBL REST -- EMBL-EBI's public bioactivity database. Similarity and substructure endpoints are synchronous with pagination.
Both are public APIs with no authentication required. Rate limits are enforced by the CLI.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

