Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-substructure-search

БесплатноЗапускает вложенные скриптыНе проверен

Searches molecular libraries for substructure matches using SMARTS patterns with explicit handling of recursive SMARTS, ring membership, aromaticity dialect…

lilinjiот lilinji★ 18 звёзд на GitHub

Об этом скилле

Version Compatibility

Reference examples tested with: RDKit 2024.09+. SMARTS dialect follows Daylight specification with RDKit extensions.

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show rdkit then help(rdkit.Chem.MolFromSmarts) to check signatures

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Substructure Search

Search molecular collections for structural patterns using SMARTS. The choice of SMARTS dialect, atom/bond matching mode, and structural-alert catalog determines whether the search is correctly capturing the intended chemistry. PAINS (Baell & Holloway 2010) is the most-cited but most-misunderstood filter -- it identifies patterns of assay interference, not "bad molecules". Knowing when to apply each catalog and how to interpret hits is essential.

For SMARTS-based reactions (transforming matched substructures), see chemoinformatics/reaction-enumeration. For 3D pharmacophore matching, see chemoinformatics/pharmacophore-modeling.

SMARTS Grammar Essentials

Token Meaning Example
[#6] Atom by atomic number [#6] carbon (any hybridization)
c Lowercase = aromatic c1ccccc1 benzene aromatic
C Uppercase = aliphatic only C(=O)O carboxylic acid carbon
[CX4] Atom + connection count X [CX4] sp3 carbon (4 connections)
[CX3]=O Carbonyl (CX3 = sp2 with 3 bonds) matches ketone, aldehyde, ester C
[#6;R] Atom in ring [#6;R] ring carbon
[#6;!R] Atom not in ring [#6;!R] acyclic carbon
[#6;r6] Atom in 6-membered ring [#6;r6] six-ring carbon
[a] Any aromatic atom [a]
[!#1] Anything except H [!#1] heavy atom
[N;H2] N with exactly 2 H; neighboring chemistry unconstrained [NH2] also matches non-amine NH2 environments unless context is added
[N+] Positively charged N [N+](=O)[O-] nitro
[$(...)] Recursive SMARTS [$(c1ccccc1)] aromatic 6-ring atom
[c]([F,Cl,Br,I]) OR within brackets aryl halide
~ Any bond type c~c any aromatic-aromatic bond
@ Ring bond c@c requires the matched bond to be in a ring
- Single bond explicit C-C
= Double bond C=O
: Aromatic bond explicit

Common SMARTS Patterns

Pattern SMARTS Notes
Hydroxyl (alcohol + phenol) [OX2H] OX2H avoids matching O- in OH-
Phenol only [OX2H][c] OH attached to aromatic carbon
Aliphatic OH only [OX2H][CX4] OH attached to sp3 C
Carboxylic acid [CX3](=O)[OX2H1] C(=O)OH
Carboxylate [CX3](=O)[O-] C(=O)O- (deprotonated)
Ester [CX3](=O)[OX2][!H] C(=O)O-R
Amide [CX3](=[OX1])[NX3] C(=O)N-R
Primary amine attached to carbon (excluding common amide-like N) [NX3;H2;$(N-[#6]);!$(N-[C,S,P]=[O,S,N])] Carbon-substituted -NH2; extend the exclusions for a project-specific amine definition
Secondary amine attached to two carbons [NX3;H1;$(N(-[#6])-[#6]);!$(N-[C,S,P]=[O,S,N])] Carbon-substituted -NH- excluding common amide-like N
Neutral tertiary amine attached to three carbons [NX3;H0;+0;$(N(-[#6])(-[#6])-[#6]);!$(N-[C,S,P]=[O,S,N])] Carbon-substituted -NR2 excluding common amide-like N
Quaternary amine [NX4+] -NR4+
Nitro [N+](=O)[O-] -NO2
Nitrile [CX2]#[NX1] -C#N
Sulfonamide [SX4](=[OX1])(=[OX1])[NX3] -S(=O)(=O)N
Aryl halide [c][F,Cl,Br,I] halogen on aromatic
Aliphatic halide [CX4][F,Cl,Br,I] halogen on sp3 C
Hydrogen bond donor Use a named feature definition such as RDKit BaseFeatures.fdef or Lipinski.NumHDonors [#7,#8;!H0] is only a simplified N/O-H query and is not a universal HBD model
Hydrogen bond acceptor Use a named feature definition such as RDKit BaseFeatures.fdef or Lipinski.NumHAcceptors No short universal SMARTS correctly captures every accepted HBA chemistry model
Michael acceptor [CX3]=[CX3][CX3]=O enone, acrylamide warhead
Aldehyde [CX3H1](=O) -CHO
Ketone [CX3;H0](=[OX1])([#6])[#6] Carbonyl carbon has two carbon substituents and no hydrogen

Basic Substructure Match

Goal: Test whether a molecule contains a SMARTS pattern and enumerate the matching atom indices.

Approach: Parse the molecule with MolFromSmiles and the pattern with MolFromSmarts, gate with HasSubstructMatch, then call GetSubstructMatches and map each atom index back to the molecule for inspection.

from rdkit import Chem

mol = Chem.MolFromSmiles('c1ccc(O)cc1CCO')
pattern = Chem.MolFromSmarts('[OX2H]')

if mol.HasSubstructMatch(pattern):
    matches = mol.GetSubstructMatches(pattern)
    for match in matches:
        atoms = [mol.GetAtomWithIdx(i).GetSymbol() for i in match]

`HasSubstruct

Полный SKILL.md на GitHub

Установить bio-substructure-search в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/substructure_search.pyusage-guide.md

FAQ

Что делает скилл bio-substructure-search?

Searches molecular libraries for substructure matches using SMARTS patterns with explicit handling of recursive SMARTS, ring membership, aromaticity dialect, vector binding, atom map indices, and reactive/PAINS/REOS/Brenk filter catalogs. Use when filtering compounds by pharmacophore features, functional groups, scaffold matches, or screening for assay-interference / structural alerts.

Как установить скилл bio-substructure-search?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-substructure-search запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-substructure-search с