Method and model for generating three-dimensional molecular structures
By constructing a three-dimensional molecular structure generation model, and using SE(3)-GeoGNNConv and a multi-head Transformer decoder to generate high-precision three-dimensional molecular structures, the problems of high computational cost and slow speed in the existing technology are solved, and efficient and robust three-dimensional conformation prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PEKING UNIV SHENZHEN GRADUATE SCHOOL
- Filing Date
- 2025-08-11
- Publication Date
- 2026-07-03
Smart Images

Figure CN120998348B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the interdisciplinary field of computational chemistry and machine learning, and in particular to methods and models for generating three-dimensional molecular structures. Background Technology
[0002] Predicting the three-dimensional conformation of molecules is a fundamental step in chemistry, materials science, and drug design, as the quality of the generated conformation directly affects molecular properties, reactivity, and functional performance. Traditional methods often employ distance geometry and force field optimization techniques, rapidly generating initial molecular conformations through random distance matrix initialization and iterative force field pre-optimization. However, while these methods offer computational efficiency, their prediction accuracy often falls short of the demands for both high throughput and high precision, with the average RMSD (Root Mean Square Deviation) frequently exceeding [a certain threshold]. Further optimization is still needed to achieve chemical accuracy. While semi-empirical quantization or density functional theory (DFT) level conformational optimization can achieve sub-milliangi-level accuracy, its computational cost and time consumption are extremely high, generally taking several minutes to several hours to complete single-molecule optimization, making it difficult to apply to large-scale molecular library screening scenarios.
[0003] Furthermore, while various deep learning end-to-end conformation generation models that have emerged in recent years, such as those based on diffusion processes or graph neural networks, have made some progress on certain small molecule datasets, they often rely on multiple random samplings or weak supervision mechanisms. In terms of accuracy, speed, and stability, they still cannot compare with DFT-level methods, and their generalization ability in drug lead molecules and macromolecular systems remains to be verified. In summary, how to achieve high-precision, high-efficiency, and robust 3D conformation prediction with limited computational resources and data scale has become a pressing technical problem in this field. Summary of the Invention
[0004] The main objective of this application is to provide a method and model for generating three-dimensional molecular structures, aiming to achieve high-precision, high-efficiency, and robust three-dimensional conformation prediction under limited computing resources and data scale.
[0005] To achieve the above objectives, this application proposes a three-dimensional molecular structure generation method, which is applied to a three-dimensional molecular structure generation model. The three-dimensional molecular structure generation model includes an initial conformation generation module, an encoder module, a fusion module, a decoding module, and a molecular structure generation module.
[0006] Methods for generating three-dimensional molecular structures include:
[0007] The initial conformation generation module generates an initial three-dimensional conformation based on molecular topological information and using a preset distance geometry algorithm combined with a preset molecular force field optimization.
[0008] The encoder module constructs three SE(3) (Special Euclidean Group in 3D, rigid body motion in three-dimensional space) isomorphic geometry graphs based on the initial three-dimensional conformation and the molecular topology information, and generates isomorphic node representations for each graph based on each SE(3) isomorphic geometry graph.
[0009] The fusion module fuses the equivariant node representations of each SE(3) equivariant geometry to obtain molecular embeddings.
[0010] The decoding module predicts the atomic coordinate offset based on the molecular embedding and the preset DFT truth coordinates.
[0011] The molecular structure generation module generates the target three-dimensional molecular structure based on the initial three-dimensional conformation and the atomic coordinate offset.
[0012] In one embodiment, the encoder module includes multiple layers of SE(3)-GeoGNNConv (SE(3)-equivariantGeometricGraphNeuralNetworkConvolution, a three-dimensional spatial equivariant geometric graph neural network convolutional layer), and the step of generating equivariant node representations of each graph based on each of the SE(3) equivariant geometric graphs includes:
[0013] For each of the SE(3) isomorphic geometry graphs, the SE(3) isomorphic geometry graphs are input into the multi-layer SE(3)-GeoGNNConv to perform position-sensitive message passing, and batch normalization and regularization are performed after each layer to obtain the isomorphic node representation of the last layer output.
[0014] In one embodiment, the SE(3) isovariant geometry includes:
[0015] An atom-bond diagram with atoms as nodes and covalent bonds as edges;
[0016] A bond-corner diagram with covalent bonds as nodes and bond corners as edges;
[0017] An angle-dihedral diagram with key angles as nodes and dihedral angles as sides.
[0018] In one embodiment, the step of fusing the equivariant node representations of each of the SE(3) equivariant geometries to obtain the molecular embedding includes:
[0019] Channel splicing is performed on each of the aforementioned equivariant node representations to obtain splicing features;
[0020] The splicing features are sequentially subjected to linear dimensionality reduction and normalization to obtain molecular embeddings.
[0021] In one embodiment, the step of predicting atomic coordinate offsets based on the molecular embedding and preset DFT truth coordinates includes:
[0022] Generate a bond matrix and a value matrix based on the molecular embedding;
[0023] The query matrix is obtained by performing linear mapping on the preset DFT truth coordinates;
[0024] Based on the key matrix, the value matrix, and the query matrix, the inter-atomic dependencies are calculated using a multi-head attention mechanism to obtain the atomic coordinate offsets.
[0025] In one embodiment, after the step of generating the target three-dimensional molecular structure based on the initial three-dimensional conformation and the atomic coordinate offsets, the method further includes:
[0026] The three-dimensional molecular structure generation model is optimized and trained based on the target three-dimensional molecular structure, wherein the loss function used in the optimization training is a composite loss function that includes geometric constraints.
[0027] In one embodiment, the composite loss function comprises a weighted combination of global coordinate deviation metric, bond length error, bond angle error, dihedral angle error, and soft bond length constraint.
[0028] Furthermore, to achieve the above objectives, this application also proposes a three-dimensional molecular structure generation model, which includes:
[0029] The initial conformation generation module is used to generate an initial three-dimensional conformation based on molecular topological information by combining a preset distance geometry algorithm with a preset molecular force field optimization.
[0030] The encoder module is used to construct a three-way SE(3) isovariant geometry graph based on the initial three-dimensional conformation and the molecular topology information, and to generate isovariant node representations of each graph based on each SE(3) isovariant geometry graph;
[0031] The fusion module is used to fuse the equivariant node representations of each of the SE(3) equivariant geometries to obtain molecular embeddings;
[0032] The decoding module is used to predict the atomic coordinate offset based on the molecular embedding and the preset DFT truth coordinates;
[0033] A molecular structure generation module is used to generate a target three-dimensional molecular structure based on the initial three-dimensional conformation and the atomic coordinate offsets.
[0034] This application proposes a method for generating three-dimensional molecular structures, which is applied to a three-dimensional molecular structure generation model. The three-dimensional molecular structure generation model includes an initial conformation generation module, an encoder module, a fusion module, a decoding module, and a molecular structure generation module. Through the initial conformation generation module, based on molecular topological information, an initial three-dimensional conformation is generated by using a preset distance geometry algorithm combined with a preset molecular force field optimization. Through the encoder module, three-way SE(3) isovariant geometry maps are constructed according to the initial three-dimensional conformation and molecular topological information, and isovariant node representations of each map are generated based on each SE(3) isovariant geometry map. Through the fusion module, the isovariant node representations of each SE(3) isovariant geometry map are fused to obtain a molecular embedding. Through the decoding module, the atomic coordinate offset is predicted according to the molecular embedding and the preset DFT true coordinates. Through the molecular structure generation module, the target three-dimensional molecular structure is generated according to the initial three-dimensional conformation and the atomic coordinate offset.
[0035] In summary, this application constructs a three-dimensional molecular structure generation model, generates an initial conformation using the initial conformation generation module, constructs a three-way SE(3) equivariant geometry map and generates equivariant node representations using the encoder module, which can better capture the geometric and topological information of the molecule. Then, the fusion module fuses the equivariant node representations to obtain the molecular embedding, and the decoding module combines the preset DFT true coordinates to predict the atomic coordinate offsets. Finally, the target three-dimensional molecular structure is generated. This not only utilizes the high precision characteristics of DFT calculation, but also avoids the high cost and time consumption caused by directly performing complex DFT calculations. Under the premise of ensuring accuracy, it significantly reduces the computational cost and time consumption. Attached Figure Description
[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating an embodiment of the method for generating three-dimensional molecular structures according to this application.
[0039] Figure 2 This is a schematic diagram of the SE(3) isovariant geometry provided in Example 1 of the method for generating three-dimensional molecular structures in this application;
[0040] Figure 3A schematic diagram of the three-dimensional molecular structure generation process provided in Embodiment 1 of the three-dimensional molecular structure generation method of this application;
[0041] Figure 4 A schematic diagram showing the generalization performance comparison of the three-dimensional molecular structure generation method provided in Example 1 of this application;
[0042] Figure 5 This is a schematic diagram showing the energy deviation comparison provided in Embodiment 1 of the three-dimensional molecular structure generation method of this application;
[0043] Figure 6 A schematic diagram comparing the geometric accuracy of Embodiment 1 of the three-dimensional molecular structure generation method of this application;
[0044] Figure 7 This is a schematic diagram of chemical space visualization provided for Embodiment 1 of the method for generating three-dimensional molecular structures in this application;
[0045] Figure 8 This is a schematic diagram illustrating the scalability test of molecular size and flexibility variations provided in Embodiment 1 of the three-dimensional molecular structure generation method of this application.
[0046] Figure 9 This is a schematic diagram of the module structure of the three-dimensional molecular structure generation model in an embodiment of this application.
[0047] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0049] Predicting the three-dimensional conformation of molecules is a fundamental step in chemistry, materials science, and drug design, as the quality of the generated conformation directly affects molecular properties, reactivity, and functional performance. Traditional methods often employ distance geometry and force field optimization techniques, rapidly generating initial molecular conformations through random distance matrix initialization and iterative force field pre-optimization. However, while these methods offer computational efficiency, their prediction accuracy often falls short of the demands for both high throughput and high precision, with average RMSD frequently exceeding [a certain threshold]. Further optimization is still needed to achieve chemical accuracy. While semi-empirical quantification or density functional theory-level conformational optimization can achieve sub-milliangi-level accuracy, its computational cost and time consumption are extremely high, generally taking several minutes to several hours to complete single-molecule optimization, making it difficult to apply to large-scale molecular library screening scenarios.
[0050] Furthermore, while various deep learning end-to-end conformation generation models that have emerged in recent years, such as those based on diffusion processes or graph neural networks, have made some progress on certain small molecule datasets, they often rely on multiple random samplings or weak supervision mechanisms. In terms of accuracy, speed, and stability, they still cannot compare with DFT-level methods, and their generalization ability in drug lead molecules and macromolecular systems remains to be verified. In summary, how to achieve high-precision, high-efficiency, and robust 3D conformation prediction with limited computational resources and data scale has become a pressing technical problem in this field.
[0051] This application provides a solution for a three-dimensional molecular structure generation model, which includes an initial conformation generation module, an encoder module, a fusion module, a decoding module, and a molecular structure generation module. The initial conformation generation module generates an initial three-dimensional conformation based on molecular topology information using a preset distance geometry algorithm combined with a preset molecular force field. The encoder module constructs three-way SE(3) isovariant geometry maps based on the initial three-dimensional conformation and molecular topology information, and generates isovariant node representations for each map based on each SE(3) isovariant geometry map. The fusion module fuses the isovariant node representations of each SE(3) isovariant geometry map to obtain a molecular embedding. The decoding module predicts atomic coordinate offsets based on the molecular embedding and preset DFT true coordinates. The molecular structure generation module generates a target three-dimensional molecular structure based on the initial three-dimensional conformation and atomic coordinate offsets.
[0052] This application embodiment constructs a three-dimensional molecular structure generation model. After generating the initial conformation using the initial conformation generation module, it constructs a three-way SE(3) equivariant geometry map and generates equivariant node representations through the encoder module, which can better capture the geometric and topological information of the molecule. Then, the fusion module fuses the equivariant node representations to obtain the molecular embedding. The decoding module combines the preset DFT true coordinates to predict the atomic coordinate offsets, and finally generates the target three-dimensional molecular structure. This not only utilizes the high precision characteristics of DFT calculation, but also avoids the high cost and time consumption caused by directly performing complex DFT calculations. Under the premise of ensuring accuracy, it significantly reduces the calculation cost and time consumption.
[0053] Based on this, embodiments of this application provide a method for generating three-dimensional molecular structures, referring to... Figure 1 , Figure 1 This is a schematic flowchart of the first embodiment of the three-dimensional molecular structure generation method of this application.
[0054] In this embodiment, the three-dimensional molecular structure generation method is applied to a three-dimensional molecular structure generation model, which includes an initial conformation generation module, an encoder module, a fusion module, a decoding module, and a molecular structure generation module.
[0055] The method for generating three-dimensional molecular structures includes steps S10 to S50:
[0056] Step S10: The initial three-dimensional conformation is generated by the initial conformation generation module based on molecular topological information and using a preset distance geometry algorithm combined with a preset molecular force field optimization.
[0057] It should be noted that, in this embodiment, the three-dimensional molecular structure generation model can be an end-to-end SE(3)-equivariant geometry deep learning network, which includes an initial conformation generation module, an encoder module, a fusion module, a decoding module, and a molecular structure generation module.
[0058] The initial conformation generation module is used to generate the initial 3D conformation of the 3D molecule to be generated. Specifically, based on the molecular topology information of the 3D molecule to be generated, a distance geometry algorithm combined with molecular force field optimization is used to generate the initial 3D conformation. The molecular topology information describes the connection relationship between atoms in the molecule, including the bond type (single bond, double bond, triple bond, etc.), bond length range, and bond angle range. The molecular topology information can be extracted by parsing the molecular SMILES (Simplified Molecular Input Line Entry System, a specification for describing molecular structure using ASCII strings). The distance geometry algorithm can generate a reasonable initial 3D conformation by using geometric information such as bond lengths and bond angles in the molecule, as well as empirical rules for torsion angles. For example, the RDKitETKDGv3 algorithm (the name of an algorithm for generating 3D molecular conformations) is used to process the extracted molecular topology information. This algorithm can construct an initial distance matrix based on the molecular topology information and convert the distance information into atomic coordinates in three-dimensional space through a series of complex nonlinear equations and iterative optimization processes. During the algorithm execution, the geometric constraints and chemical rationality of the molecular structure are fully considered to ensure that the generated initial atomic coordinates meet the basic molecular geometric characteristics.
[0059] To further improve the quality and stability of the initial 3D conformation, a molecular force field is introduced for optimization, making the conformation more reasonable and stable. For example, the MMFF94 force field (MerkMolecularForceField94, a type of molecular force field) is used for optimization. This force field can accurately describe the stretching, bending, and torsional vibration modes of various chemical bonds within the molecule, as well as the non-bonded interactions between atoms. The initial atomic coordinates generated by the RDKitETKDGv3 algorithm are used as input, and the total energy of the molecule is calculated using the MMFF94 force field. With the goal of minimizing the total molecular energy, an efficient optimization algorithm is used to iteratively optimize the atomic coordinates. After multiple iterations, until the total molecular energy converges or reaches the preset number of iterations, the optimized initial 3D conformation is finally obtained. This initial 3D conformation can be represented as an initial 3D coordinate set. In this form, the conformation exhibits high rationality and stability in both geometric structure and energy state.
[0060] Step S20: Using the encoder module, construct three-way SE(3) isovariant geometry graphs based on the initial three-dimensional conformation and molecular topology information, and generate isovariant node representations for each graph based on each SE(3) isovariant geometry graph.
[0061] The encoder module is used to construct a three-way SE(3) isovariant geometry map based on the initial three-dimensional conformation and molecular topology information, and generate three-way isovariant node representations based on the three-way SE(3) isovariant geometry map, so as to capture the geometric information in the molecular structure comprehensively and efficiently through three-way parallel processing.
[0062] In one feasible embodiment, the encoder module includes a multilayer SE(3)-GeoGNNConv, and step S20 may include step S201:
[0063] Step S201: For each SE(3) isomorphic geometry graph, input the SE(3) isomorphic geometry graph into the multi-layer SE(3)-GeoGNNConv to perform position-sensitive message passing, and perform batch normalization and regularization processing after each layer to obtain the isomorphic node representation output by the last layer.
[0064] SE(3) isomorphic geometry diagrams include:
[0065] An atom-bond diagram with atoms as nodes and covalent bonds as edges;
[0066] A bond-corner diagram with covalent bonds as nodes and bond corners as edges;
[0067] An angle-dihedral diagram with key angles as nodes and dihedral angles as sides.
[0068] In this embodiment, as Figure 2 As shown, the constructed SE(3) isovariant geometry map contains three types:
[0069] Atom-bond diagram: This diagram uses atoms in a molecule as nodes and covalent bonds between atoms as edges. This diagram structure can intuitively represent the direct connections between atoms in a molecule and reflect the basic skeletal information of the molecule.
[0070] Bond-angle diagram: This diagram is constructed with covalent bonds as nodes and bond angles as edges. Bond angles are important parameters for describing the geometry of molecules. Bond-angle diagrams can capture the relative positional relationships between bonds in a molecule from the perspective of bonds, further enriching the geometric information of molecular structure.
[0071] Angular-dihedral diagram: This diagram uses bond angles as nodes and dihedral angles as edges. Dihedral angles reflect the relative torsion of the four atoms in space. The angular-dihedral diagram can reflect the three-dimensional spatial conformation of the molecule.
[0072] The encoder module adopts a multi-layer SE(3)-GeoGNNConv structure. Based on this, for the three-way SE(3) equivariant geometry graphs, each SE(3) equivariant geometry graph is input into the multi-layer SE(3)-GeoGNNConv. In this structure, position-sensitive message passing is performed. This operation can fully consider the position information of the nodes in space, making the message passing more physically meaningful and accurate. At the same time, after each layer of message passing is completed, batch normalization and dropout processing are performed. Batch normalization helps to accelerate the training process of the model and improve the stability of training; regularization can effectively prevent the model from overfitting and enhance the model's generalization ability. After multi-layer processing, the equivariant node representation of the last layer output is finally obtained. This equivariant node representation can be the geometric h of the three-way node feature vectors. (L,1) h (L,2) h (L,3) In the form of.
[0073] Step S30: The fusion module is used to fuse the equivariant node representations of each SE(3) equivariant geometry to obtain molecular embedding;
[0074] By fusing the equivariant node representations of the three SE(3) equivariant geometric graphs through the fusion module, molecular embedding is obtained, so as to integrate the molecular structure information captured by different geometric graphs and form a more comprehensive molecular feature representation.
[0075] In one feasible embodiment, step S30 may include steps S301 to S302:
[0076] Step S301: Perform channel splicing on the representations of each isovariant node to obtain splicing features;
[0077] Channel splicing is performed on each isovariant node representation to merge isovariant node representations from different sources in the channel dimension, thereby generating a spliced feature containing richer information. This spliced feature integrates the structural information contained in each SE(3) isovariant geometry.
[0078] Step S302: Perform linear dimensionality reduction and normalization processing on the spliced features in sequence to obtain the molecular embedding.
[0079] Linear dimensionality reduction is applied to the spliced features. The purpose of linear dimensionality reduction is to reduce the dimensionality of features while preserving key information as much as possible, thereby reducing computational complexity and improving model efficiency. Through linear transformation, the high-dimensional spliced features are mapped to a low-dimensional space, extracting the most representative feature components. Then, the dimensionality-reduced features are normalized. Normalization scales the feature data to a specific range, such as [0,1] or [-1,1], to eliminate dimensional differences between different features and enhance the stability and convergence of the model. After linear dimensionality reduction and normalization, the molecular embedding is finally obtained, which can accurately and comprehensively characterize the structure and properties of molecules.
[0080] Channel splicing can be represented as H = [h (L,1) h (L,2) ||h (L,3) Linear dimensionality reduction can be expressed as H′=W f H+b f Among them, W f It is the weight matrix, b f It is a bias vector; LayerNorm normalization can be expressed as Z = LayerNorm(H′), and the resulting uniform molecular embedding can be expressed as Z = {z i}
[0081] Furthermore, in one feasible embodiment, the SE(3)-GeoGNNConv structure has the following hyperparameters and internal mechanisms:
[0082] (1) Hidden Feature Dimension: Let the hidden representation of the node at the l-th layer be:
[0083]
[0084] Where d represents the dimension of the hidden feature, which can be set to 256, meaning that each node is encoded as a 256-dimensional vector in the l-th layer, serving as the input and output for subsequent message passing; This represents the hidden feature vector of node i in layer l, belonging to space.
[0085] (2) Linear mapping matrix: Trainable matrix
[0086] Among them, the trainable matrix W q W k W v They are respectively responsible for mapping node features to the Query, Key, and Value spaces for attention calculation and message aggregation.
[0087] (3) Attention weights: For the central node i and its neighbor set N(i), first calculate the query-key similarity: The similarity is represented by the dot product (inner product) operation performed on the feature vector of node i with the feature vector of node j in its neighbor set N(i) after transformation by weight matrices Wq and Wk; then normalized to obtain the attention coefficient α. ij :
[0088]
[0089] (4) Message aggregation and updating: with attention coefficient α ij Weighted Value Projection:
[0090]
[0091] in, This represents the message aggregation result of node i at layer l.
[0092] Then, the node features are updated by residual connections, incorporating Dropout (dropout rate of 0.1), and performing layer normalization:
[0093]
[0094] in, This represents the updated hidden feature vector of node i at layer l+1.
[0095] (5) Number of GNN layers: The total number of layers of the SE(3)-GeoGNNConv structure can be set to L=3, which can capture local structures and aggregate information from more distant neighbors layer by layer.
[0096] (6) Geometric edge feature dimension: To characterize molecular geometry, the bond feature dimension can be set to 13; the angle feature dimension can be set to 1; and the dihedral feature dimension can be set to 1. These settings ensure sufficient expressive power for the network, and through the combination of isovariant attention mechanism and Dropout-LayerNorm, robust and interpretable three-dimensional molecular representation learning is achieved.
[0097] Step S40: The atomic coordinate offset is predicted by the decoding module based on the molecular embedding and the preset DFT true coordinates.
[0098] It should be noted that the decoding module in this embodiment can employ multi-head Transformer decoding, that is, based on the Transformer architecture, it enhances the model's ability to capture and process complex data relationships by introducing a multi-head attention mechanism. Specifically, in the multi-head Transformer decoding process, firstly, the input data undergoes a linear transformation to map to three different feature spaces: query, key, and value. This mapping process aims to extract feature information from different angles and levels from the original data. Then, the query, key, and value matrices are divided into multiple heads along the channel dimension using a multi-head attention mechanism, with each head independently performing attention calculations. Within each head, attention weights are obtained by calculating the similarity between the query vector and the key vector. These attention weights reflect the importance relationship between different positions or different features. Then, the value vectors are weighted and summed according to the attention weights to obtain the output of each head. The outputs of multiple heads are concatenated and then fused through a linear transformation layer to obtain the final decoded output. This multi-head design allows the model to simultaneously focus on different parts and different feature combinations of the input data, capturing richer and more diverse information.
[0099] In one feasible embodiment, step S40 may include steps S401 to S403:
[0100] Step S401: Generate the bond matrix and value matrix based on the molecular embedding;
[0101] The decoding module extracts information related to interatomic interactions from the molecular embedding and encodes it into a bond matrix and a value matrix. The bond matrix describes the connection relationship and interaction strength between atoms, while the value matrix contains information related to atomic properties.
[0102] For example, the trainable matrix of the key-value projection is Where d k This represents the dimension of the query / key vector in single-head attention. The key matrix can be represented as: K = W K Z, the value matrix can be represented as V = W V Z.
[0103] Step S402: Perform linear mapping on the preset DFT truth coordinates to obtain the query matrix;
[0104] The DFT ground truth coordinates are the three-dimensional spatial coordinates of each atom in the molecule. These coordinates can accurately describe the geometric configuration of the molecule in space. Through linear mapping, the DFT ground truth coordinates are transformed into a feature space suitable for subsequent calculations and processing, generating a query matrix Q. The role of the query matrix Q is to guide the decoding module to accurately refer to the position information of the molecule in the real state when calculating the atom coordinate offset, thereby improving the accuracy and reliability of the prediction.
[0105] Step S403: Based on the key matrix, value matrix, and query matrix, calculate the inter-atomic dependencies through a multi-head attention mechanism to obtain the atomic coordinate offsets.
[0106] Based on the key matrix, value matrix, and query matrix, the decoding module employs a multi-head attention mechanism to calculate the dependencies between atoms, thereby obtaining the atom coordinate offsets. During the calculation, the multi-head attention mechanism performs linear transformations on the key matrix, value matrix, and query matrix respectively. Then, it calculates attention weights to measure the correlation between different atoms. Finally, it performs a weighted summation of the value matrices based on these attention weights to obtain the coordinate offset of each atom. The decoding module can utilize the multi-head attention mechanism to achieve parallel modeling of global and local information.
[0107] For example, the multi-head attention mechanism in the decoding module can be represented as: The offset prediction using MLP (Multilayer Perceptron) can be expressed as: Δp i =MLP(head_out) i ), Δp i This represents the three-dimensional offset of an atom.
[0108] Step S50: The target three-dimensional molecular structure is generated by the molecular structure generation module based on the initial three-dimensional conformation and atomic coordinate offset.
[0109] The decomposed structure generation module is used to generate structures based on the initial 3D configuration. and atomic coordinate offset Δp i Generate the target three-dimensional molecular structure; specifically, the target three-dimensional molecular structure.
[0110] Furthermore, in one feasible implementation, the multi-head Transformer decoder is configured with: L decoding layers. dec =2; Number of attention heads H=8; Dropout rate is applied after attention and MLP calculations using p. drop =0.1; The formula for calculating MLP is: MLP(x) = W2σ(W1x + b1) + b2; where, This represents the first-layer weight matrix. Let b1 represent the weight matrix of the second layer, σ represent the activation function, b1 represent the bias vector of the first layer, and b2 represent the bias vector of the second layer.
[0111] Query construction, let the hidden embedding of the graph encoder output for the i-th node be... The query vector obtained by linear mapping from DFT coordinates is Adding the two together forms the query matrix for the entire graph:
[0112] Where N represents the number of nodes.
[0113] On the other hand, the trainable matrix for key-value projection is Where d k This represents the dimension of the query / key vector in single-head attention. The key matrix K = QW K Value matrix V = QW V Then, standard scaled dot product attention is applied to each head. The formula for standard scaled dot product attention is:
[0114]
[0115] Furthermore, the h-th head is represented by its respective projection matrix. Construct a multi-head attention matrix. The formula for calculating the attention of the h-th head is:
[0116]
[0117] Then, all heads are concatenated along the feature dimension and projected onto the output to obtain the output projection matrix:
[0118]
[0119] Wie, representing the output of multi-head attention:
[0120] MultiHead(Q,K,V)=Concat(head1,…,head H W O ;
[0121] Finally, the output of attention to the bulls. First apply Dropout, then add it to the residual Xres, and finally perform LayerNorm to obtain the final output structure:
[0122] x′=LayerNorm(x res +Dropout(x)).
[0123] These parameters and formulas together constitute the structure of the multi-head Transformer decoder, which is used to predict the three-dimensional offset of each atom in the three-dimensional molecular structure generation method of this embodiment.
[0124] In one possible embodiment, step A10 may be included after step S50:
[0125] Step A10: Optimize and train the three-dimensional molecular structure generation model based on the target three-dimensional molecular structure. The loss function used in the optimization training is a composite loss function that includes geometric constraints.
[0126] The composite loss function is a weighted combination of global coordinate deviation metric, bond length error, bond angle error, dihedral angle error, and soft bond length constraint.
[0127] In this embodiment, the three-dimensional molecular structure generation model can be optimized and trained. That is, by calculating the multi-component composite loss between the predicted target three-dimensional molecular structure and the DFT ground truth coordinates (i.e. the real three-dimensional molecular structure), the parameters of the model are continuously adjusted so that the generated molecular structure is closer to the real situation.
[0128] This optimization training process can use a composite loss function that includes geometric constraints as a key indicator for evaluating and guiding model training. The composite loss function used includes:
[0129] Global coordinate deviation metric: used to measure the difference in overall spatial position between the generated target 3D molecular structure and the real structure (or reference structure), ensuring accurate macroscopic positioning of molecules in 3D space.
[0130] Bond length error: Focusing on the length of chemical bonds between atoms in a molecule, by comparing the bond lengths in the generated structure with those in the actual structure, it ensures that the lengths of chemical bonds within the molecule conform to chemical laws and actual measured values.
[0131] Bond angle error: This term focuses on the angles formed by adjacent chemical bonds in a molecule. Precise bond angles are crucial for maintaining the geometry and chemical properties of a molecule. This error term ensures that the bond angles of the generated structure match the actual values.
[0132] Dihedral angle error: used to further delve into the three-dimensional configuration level of molecules, it measures the deviation of the dihedral angle formed by four consecutive atoms in a molecule, which is of great significance for accurately describing the spatial arrangement and stereoisomerism of molecules; soft bond length constraint is a more flexible constraint method. While ensuring that the bond length basically conforms to the chemical laws, it allows a certain degree of elastic change to enhance the adaptability and stability of the model when dealing with complex molecular structures.
[0133] By reasonably weighting and combining these loss components, the composite loss function can comprehensively and holistically evaluate the difference between the generated target 3D molecular structure and the real structure. During training, the model continuously adjusts its own parameters based on the feedback from the composite loss function, gradually reducing the error between the generated structure and the real structure, thereby achieving effective optimization of the 3D molecular structure generation model and improving the accuracy and reliability of the generated molecular structure.
[0134] For example, in one feasible implementation, the composite loss includes: RMSD (Root Mean Square Deviation of global coordinates), MSE (Mean Squared Error of bond lengths), MSE of bond angles, MSE of dihedral angles, and a soft bond length range penalty. The composite loss function takes the form of:
[0135] L=λ rmsd L rmsd +λ bond L bond +λ angle L angle +λ dihedral L dihedral +
[0136] λ range L bond_range ;
[0137] Among them, global coordinate RMSD loss in, Let L represent the predicted and actual 3D coordinates of the i-th atom, respectively. N is the total number of atoms in the molecule. rmsd Measure the geometric differences in the overall conformation.
[0138] Bond length MSE loss Where B is the set of indices of all chemical bonds in the molecule, and |B| is the number of bonds. ...
[0139] Key angle MSE loss Here, A is the set of all bond-angle triples (i,j,k), and |A| is its size. These represent the predicted and actual bond angles (in radians) between atoms ij and k, respectively. This parameter constrains the angle accuracy.
[0140] Dihedral angle MSE loss Where D is the set of all dihedral quadruplets (i,j,k,l), and |D| is its size; ∑ represents removing redundancy within the loop.
[0141] make:
[0142]
[0143] To properly handle periodicity, among which, These are the predicted and the actual dihedrals, respectively.
[0144] Soft key long range penalty A chemically reasonable range of covalent bond distances is defined for each bond (i,j).
[0145] λ rmsd =1.0,λ bond =0.5,λ angle =0.3,λ dihedral =0.2,λ range =0.1.
[0146] In this embodiment, the global coordinate RMSD loss, bond length MSE, bond angle MSE, dihedral angle MSE, and soft bond length range constraint can be weighted and summed according to preset weights to form the total loss function L.
[0147] In summary, this embodiment innovatively integrates the SE(3)-equivariant GeoGNNConv encoder with a multi-head Transformer decoder, enabling the direct generation of high-precision three-dimensional conformations from molecular topology.
[0148] For example, to help understand the implementation flow of the three-dimensional molecular structure generation method obtained by combining this embodiment with the above embodiment one, please refer to... Figure 3 , Figure 3 A simplified flowchart of a method for generating three-dimensional molecular structures is provided, specifically:
[0149] Based on the initial 3D conformation and molecular topology information, three SE(3) isovariant geometric graphs (atom-bond, bond-angle, and angle-dihedral angle) are constructed. Each graph is then input into an L-layer SE(3)-isovariant GeoGNNConv network. Node representations are extracted through message passing (including batch normalization (BN) and dropout), and the outputs are embedded into a 256-dimensional feature space. Then, the node representations of the three networks at the L-th layer are concatenated along the channel direction, followed by a linear transformation layer to reduce the dimension to 256, and normalized through a LayerNorm layer to obtain a unified molecular embedding vector.
[0150] In the Transformer decoding module, the unified embedding and DFT ground truth coordinates are linearly mapped to generate the query sequence Q; the key K and value V are obtained by projecting the unified embedding through a linear layer. The attention matrix is calculated using an H-head multi-head attention mechanism, and the three-dimensional offset of each atom is generated through MLP. Finally, the three-dimensional offset of each atom is added to the initial coordinates to obtain the predicted coordinates, thus obtaining the target three-dimensional molecular structure.
[0151] The following is a comparison between the target 3D molecule obtained through the 3D molecular structure generation process and the molecule generated by traditional conformation:
[0152] Figure 4 This diagram illustrates the generalization performance comparison, comprehensively validating the generalization performance of this embodiment on the drug molecule dataset, and comparing it with common conformation generation and end-to-end models (RDKitETKDG+MMFF94, Auto3D, ConfGF, DMCG). In terms of elemental composition and size distribution, this embodiment evenly extracted samples within the range of 10–20 heavy atoms. Although carbon and hydrogen are dominant, the presence of oxygen, nitrogen, and fluorine results in significant differences in the chemical space of drug molecules compared to QM9.
[0153] Figure 5 The diagram illustrates the energy deviation comparison. From the perspective of energy deviation, the average energy deviation of the proposed solution on this dataset is only 2.08 kcal / mol, while traditional force field and other deep learning models generally fluctuate between 4–5 kcal / mol or even hundreds to thousands of kcal / mol. This indicates that the proposed solution can achieve high-precision energy prediction with almost no additional DFT fine-tuning.
[0154] Figure 6 This is a schematic diagram comparing geometric accuracy. From a geometric accuracy perspective, the average conformational deviation of the scheme in this embodiment is approximately... Far superior as well as and This demonstrates the accurate 3D coordinate reconstruction capability achieved by combining SE(3)-equivariant GeoGNNConv with multi-head Transformer decoding.
[0155] Figure 7 This is a schematic diagram of chemical space visualization based on t-SNE (t-Distributed Stochastic Neighbor Embedding). It further demonstrates the separation of the QM9 training set and the drug molecule test set on the low-dimensional projection. However, the scheme in this embodiment can still maintain stable performance, which shows its excellent adaptability and robustness to the diversity of molecular structures.
[0156] Figure 8 This diagram illustrates the scalability test for variations in molecular size and flexibility. While other methods show a significant increase in energy deviation as the number of heavy atoms and rotatable bonds increases, this embodiment exhibits only slight fluctuations, with the overall median deviation remaining within 5 kcal / mol. This insensitivity to variations in molecular size and flexibility highlights the model's excellent scalability across different molecular scales and conformational complexities. This not only demonstrates the model's transferability to external datasets but also proves the comprehensive breakthrough of this end-to-end isovariant geometry deep learning framework in terms of both energy and geometric accuracy, speed, and generalization ability, significantly outperforming existing traditional and deep learning methods.
[0157] In summary, in this embodiment, by constructing a three-dimensional molecular structure generation model, generating an initial conformation using the initial conformation generation module, constructing a three-way SE(3) equivariant geometry map and generating equivariant node representations using the encoder module, the geometric and topological information of the molecule can be better captured. Then, the fusion module fuses the equivariant node representations to obtain the molecular embedding. The decoding module combines the preset DFT true coordinates to predict the atomic coordinate offsets, and finally generates the target three-dimensional molecular structure. This not only utilizes the high precision characteristics of DFT calculation, but also avoids the high cost and time consumption caused by directly performing complex DFT calculations. Under the premise of ensuring accuracy, the calculation cost and time consumption are significantly reduced.
[0158] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the three-dimensional molecular structure generation method of this application. Any simple transformations based on this technical concept are all within the protection scope of this application.
[0159] This application also provides a three-dimensional molecular structure generation model; please refer to... Figure 9 The three-dimensional molecular structure generation model includes:
[0160] The initial conformation generation module is used to generate an initial three-dimensional conformation based on molecular topological information by combining a preset distance geometry algorithm with a preset molecular force field optimization.
[0161] The encoder module is used to construct three-way SE(3) isovariant geometry graphs based on the initial three-dimensional conformation and molecular topology information, and to generate isovariant node representations of each graph based on each SE(3) isovariant geometry graph;
[0162] The fusion module is used to fuse the equivariant node representations of each SE(3) equivariant geometry to obtain molecular embeddings;
[0163] The decoding module is used to predict atomic coordinate offsets based on molecular embedding and preset DFT true coordinates;
[0164] The molecular structure generation module is used to generate the target three-dimensional molecular structure based on the initial three-dimensional conformation and atomic coordinate offsets.
[0165] The three-dimensional molecular structure generation model provided in this application, employing the three-dimensional molecular structure generation method described in the above embodiments, can achieve high-precision, high-efficiency, and robust three-dimensional conformation prediction under limited computing resources and data scale. Compared with the prior art, the beneficial effects of the three-dimensional molecular structure generation model provided in this application are the same as those of the three-dimensional molecular structure generation method provided in the above embodiments, and other technical features in the three-dimensional molecular structure generation model are the same as those disclosed in the three-dimensional molecular structure generation method of the above embodiments, and will not be repeated here.
[0166] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for generating three-dimensional molecular structures, characterized in that, It is applied to a three-dimensional molecular structure generation model, which includes an initial conformation generation module, an encoder module, a fusion module, a decoding module, and a molecular structure generation module; The method for generating the three-dimensional molecular structure includes: The initial conformation generation module generates an initial three-dimensional conformation based on molecular topological information and using a preset distance geometry algorithm combined with a preset molecular force field optimization. The encoder module constructs a three-way SE(3) isovariant geometry graph based on the initial three-dimensional conformation and the molecular topology information, and generates isovariant node representations for each graph based on each SE(3) isovariant geometry graph. The fusion module fuses the equivariant node representations of each SE(3) equivariant geometry to obtain molecular embeddings. The decoding module predicts the atomic coordinate offset based on the molecular embedding and the preset DFT truth coordinates. The molecular structure generation module generates the target three-dimensional molecular structure based on the initial three-dimensional conformation and the atomic coordinate offset.
2. The method for generating three-dimensional molecular structures as described in claim 1, characterized in that, The encoder module includes a multi-layer SE(3)-GeoGNNConv, and the step of generating the equivariant node representation of each graph based on each of the SE(3) equivariant geometry graphs includes: For each of the SE(3) isovariant geometry graphs, the SE(3) isovariant geometry graph is input into the multi-layer SE(3)-GeoGNNConv to perform position-sensitive message passing, and batch normalization and regularization are performed after each layer to obtain the isovariant node representation of the last layer output.
3. The method for generating three-dimensional molecular structures as described in claim 1, characterized in that, The SE(3) isovariant geometry includes: An atom-bond diagram with atoms as nodes and covalent bonds as edges; A bond-corner diagram with covalent bonds as nodes and bond corners as edges; An angle-dihedral diagram with key angles as nodes and dihedral angles as sides.
4. The method for generating three-dimensional molecular structures as described in claim 1, characterized in that, The step of fusing the equivariant node representations of each of the SE(3) equivariant geometries to obtain the molecular embedding includes: Channel splicing is performed on each of the aforementioned equivariant node representations to obtain splicing features; The splicing features are sequentially subjected to linear dimensionality reduction and normalization to obtain molecular embeddings.
5. The method for generating three-dimensional molecular structures as described in claim 1, characterized in that, The step of predicting the atom coordinate offset based on the molecular embedding and the preset DFT ground truth coordinates includes: Generate a bond matrix and a value matrix based on the molecular embedding; The query matrix is obtained by performing linear mapping on the preset DFT truth coordinates; Based on the key matrix, the value matrix, and the query matrix, the inter-atomic dependencies are calculated using a multi-head attention mechanism to obtain the atomic coordinate offsets.
6. The method for generating three-dimensional molecular structures as described in claim 1, characterized in that, After the step of generating the target three-dimensional molecular structure based on the initial three-dimensional conformation and the atomic coordinate offsets, the method further includes: The three-dimensional molecular structure generation model is optimized and trained based on the target three-dimensional molecular structure, wherein the loss function used in the optimization training is a composite loss function that includes geometric constraints.
7. The method for generating three-dimensional molecular structures as described in claim 6, characterized in that, The composite loss function comprises a weighted combination of global coordinate deviation metric, bond length error, bond angle error, dihedral angle error, and soft bond length constraint.
8. A three-dimensional molecular structure generation model, characterized in that, The three-dimensional molecular structure generation model includes: The initial conformation generation module is used to generate an initial three-dimensional conformation based on molecular topological information by combining a preset distance geometry algorithm with a preset molecular force field optimization. The encoder module is used to construct a three-way SE(3) isovariant geometry graph based on the initial three-dimensional conformation and the molecular topology information, and to generate isovariant node representations of each graph based on each SE(3) isovariant geometry graph; The fusion module is used to fuse the equivariant node representations of each of the SE(3) equivariant geometry graphs to obtain molecular embeddings; The decoding module is used to predict the atomic coordinate offset based on the molecular embedding and the preset DFT truth coordinates; A molecular structure generation module is used to generate a target three-dimensional molecular structure based on the initial three-dimensional conformation and the atomic coordinate offsets.
Citation Information
Patent Citations
Protein-small molecule compound docking method based on local template similarity
CN116884505A
Three-dimensional molecular conformation generation method and device and storage medium
CN118629539A