liveBook · Manning

Graph neural network

As explained in Build AI Drug Discovery Pipelines

A graph neural network is a neural-network model that computes representations or predictions from graph-structured data by propagating information among connected nodes.

A graph neural network (GNN) learns representations or predictions from graph-structured data by passing information between connected nodes. In drug discovery, a molecule can be represented as a graph of atoms and bonds, making connectivity and local chemical neighborhoods directly available to the model. section 11.1.2 section 11.4

Benzene as a graph

In the SMILES string c1ccccc1, the two carbons that close the ring appear far apart in the sequence. A molecular graph connects them directly, so the model can use the ring structure without first recovering it from character order. section 11.1.2

Each node starts with a feature vector, such as atomic properties for a molecule or residue properties for a protein. In each message-passing round, a node receives messages from its neighbors, aggregates them, and updates its own vector. After k rounds, information can travel k edges. Aggregation uses an order-independent operation such as sum or mean because neighbors have no natural ordering. section 11.4 section 11.8

To prepare a molecular graph, RDKit parses a SMILES string and extracts atom features and bonds. Bonds can be stored in both directions, and self-loops let nodes retain their own features during aggregation. In PyTorch Geometric, node features are stored in x and directed edges in an edge_index tensor with source and target rows. section 11.2.2 section 11.4

For drug–target affinity prediction, two GNN encoders process a drug graph and a protein graph separately. Global pooling turns each encoder’s node vectors into a fixed-size graph embedding. The two embeddings are concatenated and passed to a prediction network that outputs a binding-affinity estimate. Such predictions can help prioritize candidates for experimental testing. section 11.5.1 section 11.0

Figure 11.1 Architecture of a Dual-Graph Model for Drug-Target Affinity Prediction. In section 11.1, we’ll familiarize ourselves with the problem of drug-target affinity prediction so we can better understand our objective for this chapter, why we need to work with both molecule and protein data inputs, why graph neural networks offer an advantageous approach over alternatives, and what benchmarks we’ll be using to guide model development. Section 11.2 and 11.3 detail how we can transform textual representations of molecules and proteins into rich, graph-based representations. In section 11.4, we’ll introduce the core learning engine, graph neural networks, that facilitate learning on graphs. Section 11.5 combines the previous sections to show the full DGraphDTA dual-stream architecture implementation, which we’ll train and later evaluate in section 11.6. The illustrated inputs (SMILES, protein sequence, experimental data) are based on a real result from [3] concerning development of a series of p38α inhibitors for rheumatoid arthritis.

Follow the drug and protein inputs through a dual-graph affinity prediction architecture. section 11.0

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains message-passing steps, graph tensors, and a dual-stream architecture, while deferring full derivations and worked GNN examples.
Examples
Uses benzene ring connectivity and a dual-graph drug–protein predictor to illustrate graph-based learning.
What you can do after
Build from scratch a dual-stream drug–target affinity predictor using PyTorch Geometric.
How it connects
Connects message passing with graph convolution, pooling, molecular graphs, protein representations, and drug–target affinity prediction.

Also explained in

Compare how 8 books explain graph neural network →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.