Detalle del Skill

chembl-database

Relevant to drug-discovery and cheminformatics data science.

CoincidenciaPosibleRevisado para ciencia de datos
Fuentegoogle-deepmind/science-skillsFuente externa
Instalaciones reportadas1,375Solo señal de popularidad

Revisar antes de usar

La revisión automática comprueba relevancia, no seguridad ni respaldo. Lee las instrucciones de la fuente antes de usar este Skill.

Vista previa guardada

SKILL.md

Este extracto es una copia guardada durante la revisión. La fuente externa contiene la versión completa y actual.

---
name: chembl-database
description: >
  Query the ChEMBL database for bioactive molecules, drug targets, bioactivity
  data, approved drugs, and chemical structures. Use when the user asks about
  compounds, targets, IC50/Ki values, drug mechanisms, or structure searches.
---

# ChEMBL Database Query

## Prerequisites

1.  **`uv`**: Read the `uv` skill and follow its Setup instructions to ensure
    `uv` is installed and on PATH.
2.  **User Notification**: If .licenses/chembl_database_LICENSE.txt does not
    already exist in the workspace root directory then (1) prominently notify
    the user to check the terms at
    https://chembl.gitbook.io/chembl-interface-documentation/about, then (2)
    create the file recording the notification text and timestamp.

## Core Rules

-   [!IMPORTANT] **Use the Utility Scripts**: You MUST ALWAYS use the provided
    utility script `scripts/chembl_api.py` for all ChEMBL API interactions,
    including checking status. NEVER use `curl` or custom Python requests to
    query the ChEMBL API directly. This ensures rate limit is enfoced and also
    retries on network errors.

-   **Output to File (Required)**: The `--output` flag is **required** for every
    subcommand. All JSON results are written to the specified file. After
    running the command, read the output file with jq or your own code to
    extract the data. List results are typically wrapped in a JSON array keyed
    by the endpoint name (e.g., `molecules`, `activities`).

-   **Notification**: If this skill is used, ensure this is mentioned in the
    output.

## Utility Script

All ChEMBL API queries use one script with subcommands:

```bash
uv run scripts/chembl_api.py <subcommand> --output <file> [options]
```

--------------------------------------------------------------------------------

### 1. Check API Status

```bash
uv run scripts/chembl_api.py status --output /tmp/status.json
```

--------------------------------------------------------------------------------

### 2. Molecule Queries

**Fetch by ChEMBL ID:** `bash uv run scripts/chembl_api.py molecule --id
CHEMBL25 --output /tmp/mol.json`

**Search by name:** `bash uv run scripts/chembl_api.py molecule --search
"aspirin" --limit 3 --output /tmp/mol_search.json`

**Batch fetch:** `bash uv run scripts/chembl_api.py molecule --ids
"CHEMBL25;CHEMBL1642" --limit 10 --output /tmp/mol_batch.json`

**Filter by properties:** `bash uv run scripts/chembl_api.py molecule --filter
molecule_properties__mw_freebase__lte=500 --limit 5 --output
/tmp/mol_filter.json`

**Filter by range:** `bash uv run scripts/chembl_api.py molecule --filter
molecule_properties__mw_freebase__range=150,200 --limit 5 --output
/tmp/mol_range.json`

**Download SDF structure file:** `bash uv run scripts/chembl_api.py molecule
--id CHEMBL25 --dl_format sdf --output /tmp/aspirin.sdf`

> **Tip**: SDF/MOL files can be passed directly to tools like PyMOL or RDKit for
> 3D visualization and analysis.

--------------------------------------------------------------------------------

### 3. Target Queries

**Search for targets:** `bash uv run scripts/chembl_api.py target --search
"EGFR" --limit 5 --output /tmp/targets.json`

**Fetch by ID:** `bash uv run scripts/chembl_api.py target --id CHEMBL203
--output /tmp/egfr.json`

--------------------------------------------------------------------------------

### 4. Bioactivity Data

**Fetch activity by ID:** `bash uv run scripts/chembl_api.py activity --id 31863
--output /tmp/act.json`

**Search activities:** `bash uv run scripts/chembl_api.py activity --search
"EGFR" --limit 5 --output /tmp/act_search.json`

**Filter activities for a target:** `bash uv run scripts/chembl_api.py activity
--filter target_chembl_id=CHEMBL203 standard_type=IC50 --limit 10 --output
/tmp/egfr_ic50.json`

**Normalize bioactivity units to nM:** `bash uv run scripts/chembl_api.py
activity --filter target_chembl_id=CHEMBL203 standard_type=IC50 --limit 5
--normalize --output /tmp/egfr_normal
Leer la fuente completa en GitHub (abre una página externa)
Contexto

Trabajo relacionado