{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "34ca5db2", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/root/micromamba/envs/qsar/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "ChEMBL 数据库存储路径: /srv/project/LillyMol/test/data/35/data/chembl_35/chembl_35_sqlite/chembl_35.db\n" ] } ], "source": [ "import chembl_downloader\n", "# 指定存储目录\n", "prefix = '/srv/project/LillyMol/test/data'\n", "version = chembl_downloader.latest() # version 35\n", "\n", "# 下载并提取 ChEMBL 数据库,存放到指定目录\n", "path = chembl_downloader.download_extract_sqlite(version=version, prefix=[prefix])\n", "# chembl_downloader.download_sqlite(version)\n", "\n", "print(f\"ChEMBL 数据库存储路径: {path}\")" ] }, { "cell_type": "code", "execution_count": 2, "id": "dd6f3b25", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(0, 'molregno', 'BIGINT', 1, None, 0)\n", "(1, 'syn_type', 'VARCHAR(50)', 1, None, 0)\n", "(2, 'molsyn_id', 'BIGINT', 1, None, 1)\n", "(3, 'res_stem_id', 'BIGINT', 0, None, 0)\n", "(4, 'synonyms', 'VARCHAR(250)', 0, None, 0)\n" ] } ], "source": [ "import chembl_downloader\n", "\n", "with chembl_downloader.connect(version='35', prefix=['/srv/project/LillyMol/test/data']) as conn:\n", " cursor = conn.cursor()\n", " cursor.execute(\"PRAGMA table_info(molecule_synonyms);\")\n", " columns = cursor.fetchall()\n", " for col in columns:\n", " print(col)\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "c8390d91", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | molregno | \n", "syn_type | \n", "molsyn_id | \n", "res_stem_id | \n", "synonyms | \n", "
|---|---|---|---|---|---|
| 0 | \n", "27340 | \n", "TRADE_NAME | \n", "3001861 | \n", "None | \n", "Brolene antibiotic | \n", "
| 1 | \n", "27340 | \n", "TRADE_NAME | \n", "3001879 | \n", "None | \n", "Golden eye antibiotic | \n", "