Apache License 2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度技术分析:AstraZeneca/chemicalx

项目背景与痛点

在药物研发过程中,药物对对映体的相互作用研究具有重要意义,能帮助科研人员预测药物间的协同或拮抗作用。然而,精准预测药物对作用效果是一个复杂的任务,需要处理大量的生物信息学数据,同时面临计算效率和准确度的双重挑战。为了解决这个问题,AstraZeneca 开源了 chemicalx,它是一个基于 PyTorch 和 TorchDrug 的深度学习库,专注于药物对评分。

项目的初衷在于利用深度学习来突破传统方法在药物对相互作用预测上的瓶颈,提供一个更高效的数据模型训练方案,支持多类型药物数据的处理和分析,从而更早地识别具有协同效果的药物组合,加速药物研发流程。

核心技术揭秘

chemicalx 的核心技术在于它将传统数据处理和深度学习模型结合起来,实现了多模态数据的高效处理。它采用了一批强大的算法和模型,如图卷积神经网络(Graph Convolutional Network, GCN)和注意力机制(Attention Mechanism),来同时处理结构化和非结构化数据,以求在预测药物对相互作用上达到更高精度。

整个系统的架构如下:

graph TD A[数据预处理] --> B[图嵌入] B --> C{"模型选择"} C -->|"GCN"| D[图卷积] C -->|"Attention"| E[注意力计算] D --> F[特征提取] E --> F F --> G[药物对评分] G --> H[输出结果]

数据预处理阶段负责将不同来源的多模态数据(如药物结构、生物活动等)统一转换成模型可处理的格式。图嵌入则是将这些数据转化为图结构,以便后续的模型处理。模型选择上提供了 GCN 和注意力机制两种方法,前者通过局部聚合邻居信息、后者通过加权融合不同特征的方式,共同推进特征提取。最终的特征经由评分模型计算出药物对之间的相互作用评分,并输出结果。

功能亮点与差异

相较于传统的药物对相互作用预测工具来说,chemicalx 通过深度学习模型大幅度提升了预测准确度和计算效率。它支持多种数据模态的灵活处理,减少了特征工程的工作量,这一点在生物学数据处理中展现出重要优势。

更进一步,“chemicalx” 的交叉学科特性得到充分拓展,可以充分结合蛋白质、小分子乃至整个生物通路的数据,提供更为系统化的药物对相互作用评分,而不仅仅局限于单一类型的生物分子。这种跨越数据类型的预测能力,是它的杀手锏。

应用场景与落地建议

在生产环境中使用 chemicalx,建议注意两大关键点:数据质量和模型性能的持续优化。数据是机器学习的核心,确保输入数据的质量(包括预处理的一致性、特征的全面性和标注的准确性)对于模型的准确度至关重要;同时,针对特定业务场景,不断迭代优化模型性能,包括但不限于调整超参数、扩大训练集范围等策略,将进一步提高预测效果。

它最适合应用于大规模的药物筛选、候选药物组合优化以及药物发现行业的临床前研究。在这些场景中,它能显著缩短研发周期,确保药物组合方案的科学性和有效性。

综合评价

chemicalx 的优势显而易见,尤其是在利用深度学习算法处理复杂且多模态的药物数据方面具有显著优势,为精准药物相互作用研究提供了一个高效的工具。然而,它也面临着诸如提高模型解释性、处理小样本数据等问题的挑战。

总体来看,chemicalx 以其强大的处理能力和潜在的创新性,代表着药物研发领域中一种革命性的转变,但在具体操作中需要一定的技术背景和数据处理经验,以确保其最佳效果。

关于

GitHub 原始描述(英文)

A PyTorch and TorchDrug based deep learning library for drug pair scoring. (KDD 2022)

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Python
Shell

README


PyPI Version Docs Status Code Coverage Build Status DOI

Documentation | External Resources | Datasets | Examples

ChemicalX is a deep learning library for drug-drug interaction, polypharmacy side effect, and synergy prediction. The library consists of data loaders and integrated benchmark datasets. It also includes state-of-the-art deep neural network architectures that solve the drug pair scoring task. Implemented methods cover traditional SMILES string based techniques and neural message passing based models.


Citing

If you find ChemicalX and the new datasets useful in your research, please consider adding the following citation:

@inproceedings{10.1145/3534678.3539023,
  author = {Rozemberczki, Benedek and Hoyt, Charles Tapley and Gogleva, Anna and Grabowski, Piotr and Karis, Klas and Lamov, Andrej and Nikolov, Andriy and Nilsson, Sebastian and Ughetto, Michael and Wang, Yu and Derr, Tyler and Gyori, Benjamin M.},
  title = {ChemicalX: A Deep Learning Library for Drug Pair Scoring},
  year = {2022},
  isbn = {9781450393850},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/3534678.3539023},
  doi = {10.1145/3534678.3539023},
  booktitle = {Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  pages = {3819–3828},
  numpages = {10},
  keywords = {chemistry, neural networks, deep learning},
  location = {Washington DC, USA},
  series = {KDD '22}
}

Drug Pair Scoring Explained

Our framework solves the drug pair scoring task of computational chemistry. In this task a machine learning model has to predict the outcome of administering two drugs together in a biological or chemical context. Deep learning models which solve this task have an architecture with two distinctive parts:

  1. A drug encoder layer which takes a pair of drugs as an input (blue and red drugs below).
  2. A head layer which outputs scores in the administration context - polypharmacy in our explanatory figure.

Getting Started

The API of chemicalx provides a high-level function for training and evaluating models that’s heavily influenced by the PyKEEN training and evaluation pipeline:

from chemicalx import pipeline
from chemicalx.models import DeepSynergy
from chemicalx.data import DrugCombDB

model = DeepSynergy(context_channels=112, drug_channels=256)
dataset = DrugCombDB()

results = pipeline(
    dataset=dataset,
    model=model,
    # Data arguments
    batch_size=5120,
    context_features=True,
    drug_features=True,
    drug_molecules=False,
    # Training arguments
    epochs=100,
)

# Outputs information about the AUC-ROC, etc. to the console.
results.summarize()

# Save the model, losses, evaluation, and other metadata.
results.save("~/test_results/")

Case Study Tutorials

We provide in-depth case study like tutorials in the Documentation, each covers an aspect of ChemicalX’s functionality.


Methods Included

In detail, the following drug pair scoring models were implemented.

2018

2019

2020

2021


Head over to our documentation to find out more about installation, creation of datasets and a full list of implemented methods and available datasets. For a quick start, check out the examples in the examples/ directory.

If you notice anything unexpected, please open an issue. If you are missing a specific method, feel free to open a feature request.


Installation

PyTorch 1.10.0

To install for PyTorch 1.10.0, simply run

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+${CUDA}.html
pip install torchdrug
pip install chemicalx

where ${CUDA} should be replaced by either cpu, cu102, or cu111 depending on your PyTorch installation.

cpu cu102 cu111
Linux ✅ ✅ ✅
Windows ✅ ✅ ✅
macOS ✅

Running tests

$ tox -e py

License

评论

暂无评论