Training method and device for dihedral energy prediction model
Through the training method of the dihedral energy prediction model, the self-attention and deep neural network modules are used to solve the problem of dihedral energy state prediction in medicinal chemistry, and improve the accuracy and biological activity of drug design.
Patent Information
- Application Number
- CN202410979423.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-22
AI Technical Summary
In the field of medicinal chemistry, it is difficult for traditional methods to accurately predict the dihedral energy state of small molecules of drug, affecting the stable conformation and biological activity of drugs.
Using the training method of the dihedral energy prediction model, the dihedral fragment sample set is generated through molecular structure fragment slicing, and using the self-attention module, flattening layer and deep neural network module to learn the complex mapping relationship between feature matrix and energy value. , generate accurate predicted energy values and update model parameters.
The accuracy and reliability of the dihedral angle energy prediction model are improved, and the stable conformation of small drugs can be more effectively identified and the effectiveness of drug design and development can be improved.
Smart Images

Figure CN118538328B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a training method and device for a dihedral energy prediction model. Background Art
[0002] In the field of medicinal chemistry, the conformation of small drug molecules (i.e., the spatial arrangement of molecules) is crucial to biological activity. The interaction between small drug molecules and biological macromolecules (biological targets) is usually highly dependent on their three-dimensional shapes, and these interactions determine the efficacy and specificity of the drug. Conformational analysis occupies a central position in the drug design and development process because the correct conformation can promote the binding of the drug to its target, thereby improving its therapeutic effect.
[0003] As a key parameter for describing the conformation of small molecules, dihedral angles have a decisive influence on drug design and development. With the rapid growth of chemical space, traditional experimental and computational methods have been unable to meet the needs of drug small molecule conformation analysis. Therefore, introducing machine learning and AI technology to predict the dihedral angle distribution of molecular conformations has become an important research direction.
[0004] Since different molecular conformations correspond to different dihedral angle energy states, in the field of medicinal chemistry, finding molecules with low energy states (i.e. stable conformations) is one of the research focuses. In order to determine the stable conformation of small drug molecules, how to accurately predict the dihedral angle energy based on the dihedral angle distribution of the molecular conformation has become a problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, the present disclosure provides a dihedral angle energy prediction model training method, dihedral angle energy prediction method, device, equipment, storage medium and program product.
[0006] In a first aspect, the present disclosure provides a method for training a dihedral angle energy prediction model, the method comprising: when training the dihedral angle energy prediction model, segmenting a molecular structure used for training to obtain a dihedral angle fragment set; based on a first fragment subset of the dihedral angle fragment set, generating a first sample subset corresponding to the dihedral angle fragment sample set, the dihedral angle fragment sample comprising: a characterization conformation set and a label energy value characterizing the conformation set; obtaining a first subset of a feature matrix set corresponding to the first sample subset, the feature matrix in the feature matrix set corresponding to the characterization conformation set of the dihedral angle fragment sample, and the feature in the feature matrix corresponding to the characterization conformation of the dihedral angle fragment sample; using the dihedral angle energy prediction model, according to the first subset of the feature matrix set, generating a set of first predicted energy values corresponding to the first subset of the feature matrix set, and generating a first loss determined based on the difference between each first predicted energy value and the corresponding label energy value, the first loss being used to update the parameter value of the dihedral angle energy prediction model; the dihedral angle energy prediction model comprises a self-attention module, a flattening layer, and a deep neural network module connected in sequence, the self-attention module generating a feature matrix implicitly representing the relationship between each conformation according to the input feature matrix.
[0007] The training method of the dihedral angle energy prediction model in the present embodiment divides the molecular structure fragments used for training into a dihedral angle fragment set, and then generates a first sample subset in the dihedral angle fragment sample set based on the first fragment subset in the dihedral angle fragment set, and then obtains the first subset of the feature matrix set corresponding to the first sample subset, extracts the features of the characterization conformation of each dihedral angle fragment sample in the characterization conformation set of the dihedral angle fragment samples in the first sample subset, and organizes the features of the characterization conformation set of the corresponding dihedral angle fragment samples into a feature matrix, and then uses the dihedral angle energy prediction model to generate a predicted energy value and calculate the loss, thereby updating the parameter value of the dihedral angle energy prediction model and improving the performance of the dihedral angle energy prediction model. The dihedral angle energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module. The self-attention module generates a feature matrix that implicitly represents the relationship between each conformation based on the input feature matrix, which reflects the intrinsic relationship between the conformations and can improve the dihedral angle energy prediction model's understanding of the complex interaction between dihedral angle fragments and energy. The output of the self-attention module is then converted into a format suitable for processing by the deep neural network module through the flattening layer. After that, the deep neural network module learns the complex mapping relationship from the feature matrix to the energy value, which improves the accuracy of the dihedral angle energy prediction model in predicting the energy of the dihedral angle fragments and improves the performance of the trained dihedral angle energy prediction model.
[0008] In some optional embodiments, the characterization conformation set of the dihedral angle fragment sample and the label energy value of the characterization conformation set are determined based on the following steps: for each target dihedral angle fragment in the first fragment subset, a sample generation step is performed, including: sampling an initial conformation set corresponding to the target dihedral angle fragment, the initial conformation indicating the arrangement of the target dihedral angle fragment in three-dimensional space; scanning the dihedral angle of each initial conformation in the initial conformation set at intervals of a preset angle to obtain an expanded conformation set; for the expanded conformation set, while keeping the dihedral angle unchanged, local optimization of the conformation is performed with the generation of an expected number of dihedral angle conformations as a constraint to obtain a candidate conformation corresponding to each dihedral angle conformation in the expected number of dihedral angle conformations, for the expected number of dihedral angle conformations, the candidate conformation with the lowest energy value among the candidate conformations corresponding to each dihedral angle conformation is used as the characterization conformation, to obtain a characterization conformation set of the target dihedral angle fragment, and the label energy value of the characterization conformation set is recorded.
[0009] The training method of the dihedral angle energy prediction model in the present embodiment obtains a large number of initial conformations through initial sampling, and obtains a large number of extended conformations by scanning the dihedral angles of the initial conformations, and the arrangements of these extended conformations in three-dimensional space are different, thereby increasing the diversity of training data and improving the breadth and versatility of dihedral angle fragment samples; then, while keeping the dihedral angle unchanged, a local optimization method is used to generate an expected number of dihedral angle conformations, and from the candidate conformations of each conformation, the candidate conformation with the lowest energy value is screened out as the characterization conformation, and a characterization conformation set and a label energy value of the characterization conformation set are obtained, thereby obtaining a characterization conformation set of dihedral angle fragment samples with stable energy and reasonable energy and a label energy value of the characterization conformation set, thereby improving the quality of training samples and improving the accuracy and reliability of the trained dihedral angle energy prediction model.
[0010] In some optional embodiments, the features in the feature matrix are determined based on the following steps: based on the following features within the characterization conformation of the dihedral angle fragment sample: two interatomic distance features, three interatomic angle features, and four interatomic dihedral angle features, features corresponding to the characterization conformation of the dihedral angle fragment sample are generated.
[0011] The training method of the dihedral angle energy prediction model in this embodiment takes into account various types of features such as the distances between two atoms, three interatomic angles and four interatomic dihedral angles within the characterization conformation, and reflects the structure of the characterization conformation from different dimensions and different granularities, ensuring that the energy prediction model can learn the subtle differences between the characterization conformations, thereby improving the accuracy of the prediction results of the trained energy prediction model.
[0012] In some optional embodiments, the distance characteristics between two atoms in the characterizing conformation include: for the intermediate bond of the dihedral angle in the characterizing conformation, traversing each atom in the characterizing conformation, and determining the sum of the distances and the mutual attraction between the virtual point and the atom when the atom is of different element types; based on the sum of the distances, the mutual attraction, and the atomic number of the intermediate bond, determining the distance characteristics between the two atoms in the characterizing conformation, the virtual point is the center of the intermediate bond.
[0013] The training method of the dihedral angle energy prediction model in this embodiment takes into account the intermediate bond of the dihedral angle, uses the center of the intermediate bond of the dihedral angle as a virtual point, and traverses each atom in the representation conformation, combining the sum of the distances between the virtual point and the atom when the visited atom is of different element types and the atomic number of the intermediate bond to determine the distance characteristics between the two atoms in the representation conformation, distinguishes the effects of the interactions between different elements and the dihedral angle on the characteristics of the molecular conformation, so that the distance characteristics between the two atoms in the representation conformation represent the complexity of the relative positions and spatial relationships between atoms, thereby improving the ability of the energy prediction model to understand the representation conformation and predict the energy of the dihedral angle based on this.
[0014] In some optional embodiments, the angular characteristics between three atoms in the characterizing conformation include: for the intermediate bond of the dihedral angle in the characterizing conformation, based on the virtual point, the distance between any two atoms in the characterizing conformation, the mutual attraction between the three, the angle between the three, and the atomic number of the intermediate bond, the angular characteristics between the three atoms in the characterizing conformation are determined, and the angle between the three is the angle between the virtual point and the straight lines corresponding to the distance between any two atoms.
[0015] The training method of the dihedral angle energy prediction model in this embodiment takes into account the distances between virtual points, any two atoms in the representation conformation, mutual attraction, angles, and atomic numbers of intermediate bonds. It describes the relative position, interaction, stability of molecular conformation, directional relationship, three-dimensional structure, characteristics and properties of molecular conformation between the virtual points and any two atoms from multiple dimensions and multiple granularities, thereby improving the accuracy of calculating the angle features between the virtual points and any two atoms in the representation conformation, and thereby improving the accuracy of the dihedral angle energy prediction model.
[0016] In some optional embodiments, the dihedral angle characteristics between four atoms in the characterizing conformation include: for the intermediate bond of the dihedral angle in the characterizing conformation, based on the distances between any two atoms other than the two atoms of the intermediate bond in the characterizing conformation and the atoms of the two atoms of the intermediate bond located on the same side and opposite side of the intermediate bond, respectively, combined with the distance between any two atoms, the mutual attraction corresponding to each distance, the angle of the dihedral angle corresponding to the intermediate bond, and the atomic number of the intermediate bond, the dihedral angle characteristics between the four atoms in the characterizing conformation are determined.
[0017] The training method of the dihedral angle energy prediction model in this embodiment takes into account the shortest distance between any two atoms other than the atoms of the intermediate bond in the representation conformation and the two atoms of the intermediate bond, the distance between any two atoms, the mutual attraction corresponding to these three distances, the dihedral angle, and the atomic number of the intermediate bond, and describes the relationship between the two atoms of the intermediate bond and the atoms on the same side of the intermediate bond as any two atoms, and the relationship between the two atoms of the intermediate bond and the any two atoms from multiple dimensions and multiple granularities. These relationships include: relative position, interaction, stability of molecular conformation, directional relationship, three-dimensional structure, characteristics and properties of molecular conformation, etc., which improves the accuracy of calculating the angle characteristics between the two atoms of the intermediate bond in the representation conformation and any two atoms, thereby improving the accuracy of the dihedral angle energy prediction model.
[0018] In some optional embodiments, based on the following features within the characterization conformation of the dihedral angle fragment sample: two interatomic distance features, three interatomic angle features, and four interatomic dihedral angle features, features corresponding to the characterization conformation of the dihedral angle fragment sample are generated, including: merging the two interatomic distance features, three interatomic angle features, four interatomic dihedral angle features, the angle of the dihedral angle corresponding to the intermediate bond, the distance between the two atoms of the intermediate bond, the distance between the two end atoms of the dihedral angle, the product of the serial numbers of the two atoms of the intermediate bond, and the serial numbers of the two end atoms within the characterization conformation of the dihedral angle fragment sample to obtain the features corresponding to the characterization conformation of the dihedral angle fragment sample.
[0019] The training method of the dihedral angle energy prediction model in this embodiment combines features from multiple levels and dimensions, making the features characterizing the conformation more representative and discriminative, thereby enabling the dihedral angle energy prediction model to more accurately learn the relationship between the characterization conformation set and the label energy value, thereby improving the accuracy of the trained energy prediction model.
[0020] In some optional embodiments, the method also includes: after the dihedral angle energy prediction model is trained, using the optimized dihedral angle energy prediction model, generating a set of second predicted energy values corresponding to the second subset of the feature matrix set according to the second subset of the feature matrix set, and generating a second loss determined based on the difference between each second predicted energy value and the corresponding label energy value, the second loss is used to update the parameter values of the transfer layer, residual connection and normalization layer of the optimized dihedral angle energy prediction model; the optimized dihedral angle energy prediction model sets a transfer layer between the multi-head attention layer and the residual connection and normalization layer of the self-attention module of the trained dihedral angle energy prediction model; the second subset of the feature matrix set includes: the feature matrix corresponding to the characterization conformation set of each dihedral angle fragment sample in the second sample subset of the dihedral angle fragment sample set, and the accuracy of the label energy value of the second sample in the second sample subset is higher than the accuracy of the label energy value of the first sample in the first sample subset.
[0021] The training method of the dihedral angle energy prediction model in this embodiment generates a second predicted energy value through a second subset of the feature matrix set, calculates a second loss based on the difference between the second predicted energy value and the corresponding label energy value, and then uses the second loss to update the parameter values of the parameters of the transfer layer. Therefore, on the basis of the parameters of the trained dihedral angle energy prediction model remaining unchanged, the feature expression of training samples with higher accuracy is learned through the transfer layer of the optimized dihedral angle energy prediction model, thereby improving the accuracy of the feature expression and thus improving the accuracy of the prediction result. In addition, since the optimized dihedral angle energy prediction model is trained with training samples of different accuracy, the generalization ability of the optimized dihedral angle energy prediction model is improved.
[0022] In some optional embodiments, the method further includes at least one of the following: using a first evaluation data set of dihedral angle fragments of different dimensions to evaluate the trained dihedral angle energy prediction model to obtain a first evaluation index of the trained dihedral angle energy prediction model; and using a second evaluation data set of dihedral angle fragments of different dimensions to evaluate the trained optimized dihedral angle energy prediction model to obtain a second evaluation index of the trained optimized dihedral angle energy prediction model.
[0023] The training method of the dihedral energy prediction model in this embodiment can use evaluation data sets of dihedral angle fragments of different dimensions to evaluate the trained model and obtain evaluation indicators of the model. In this process, the evaluation data of dihedral angle fragments of different dimensions are used to make the evaluation results include more evaluation angles, accurately reflect the performance of the trained model, and provide a basis for improving the trained model.
[0024] In some optional embodiments, the method further includes at least one of the following: optimizing the trained dihedral energy prediction model based on a first evaluation index; and optimizing the trained optimized dihedral energy prediction model based on a second evaluation index.
[0025] The training method of the dihedral angle energy prediction model in this embodiment, since the evaluation indicators include more evaluation angles, uses the evaluation indicators to optimize the optimized dihedral angle energy prediction model trained, which can improve the model's fitting and generalization capabilities, thereby improving the model's reliability and stability.
[0026] In a second aspect, the present disclosure provides a dihedral angle energy prediction method, the method comprising: obtaining a dihedral angle fragment to be predicted, generating a third characterization conformation set corresponding to the dihedral angle fragment; obtaining a third feature matrix corresponding to the third characterization conformation set; inputting the third feature matrix into a dihedral angle energy prediction model obtained by the dihedral angle energy prediction model training method according to the above-mentioned first aspect or any corresponding embodiment thereof, to obtain a third predicted energy value corresponding to the dihedral angle fragment to be predicted.
[0027] The dihedral angle energy prediction method in this embodiment first obtains the dihedral angle fragment to be predicted, and generates a third characterization conformation set corresponding to the dihedral angle fragment; then obtains a third feature matrix corresponding to the third characterization conformation set; finally, the third feature matrix is input into the dihedral angle energy prediction model obtained by the training method of the dihedral angle energy prediction model according to the first aspect or any corresponding embodiment above, to obtain the third predicted energy value corresponding to the dihedral angle fragment to be predicted, thereby improving the accuracy of the energy of the predicted dihedral angle fragment.
[0028] In a third aspect, the present disclosure provides a training device for a dihedral angle energy prediction model, the device comprising: a fragment segmentation module, used to segment the molecular structure used for training when training the dihedral angle energy prediction model to obtain a dihedral angle fragment set; a sample generation module, used to generate a first sample subset of a dihedral angle fragment sample set based on a first fragment subset of the dihedral angle fragment set, the dihedral angle fragment sample comprising: a characterization conformation set and a label energy value characterizing the conformation set; a feature acquisition module, used to acquire a first subset of a feature matrix set corresponding to the first sample subset, the feature matrix in the feature matrix set corresponding to the characterization conformation set of the dihedral angle fragment sample , the features in the feature matrix correspond to the representation conformations of the dihedral angle fragment samples; a model training module is used to adopt a dihedral angle energy prediction model, generate a set of first predicted energy values corresponding to the first subset of the feature matrix set according to the first subset of the feature matrix set, and generate a first loss determined based on the difference between each first predicted energy value and the corresponding label energy value, and the first loss is used to update the parameter value of the dihedral angle energy prediction model; the dihedral angle energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module connected in sequence, and the self-attention module generates a feature matrix that implies the relationship between each representation conformation according to the input feature matrix.
[0029] In a fourth aspect, the present disclosure provides a dihedral angle energy prediction device, which includes: a conformation generation module, used to obtain dihedral angle fragments to be predicted, and generate a third characterization conformation set corresponding to the dihedral angle fragments; a feature acquisition module, used to obtain a third feature matrix corresponding to the third characterization conformation set; and an energy prediction module, used to input the third feature matrix into a dihedral angle energy prediction model obtained by the dihedral angle energy prediction model training method according to the above-mentioned first aspect or any corresponding embodiment, to obtain a third predicted energy value corresponding to the dihedral angle fragment to be predicted.
[0030] In a fifth aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the training method of the dihedral energy prediction model of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions, or thereby executes the dihedral energy prediction method of the above-mentioned second aspect.
[0031] In a sixth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the training method for a dihedral angle energy prediction model of the first aspect or any corresponding embodiment thereof, or to execute the dihedral angle energy prediction method of the second aspect.
[0032] In a seventh aspect, the present disclosure provides a computer program product comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the training method of the dihedral angle energy prediction model of the above-mentioned first aspect or any corresponding embodiment thereof, or to execute the dihedral angle energy prediction method of the above-mentioned second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 is a flow chart of a method for training a dihedral energy prediction model according to an embodiment of the present disclosure;
[0035] Figure 2 It is a flow chart of a method for determining a characterization conformation set of a dihedral angle fragment sample and a label energy value of the characterization conformation set according to an embodiment of the present disclosure;
[0036] Figure 3a is an exemplary schematic diagram of determining the distance characteristics between two atoms according to an embodiment of the present disclosure;
[0037] Figure 3b is an exemplary schematic diagram of determining three interatomic angle characteristic values of a combination of oxygen and nitrogen (ON) element types according to an embodiment of the present disclosure;
[0038] Figure 3c is an exemplary schematic diagram of determining the four interatomic dihedral angle features of the combination of element types of atoms i and l as a carbon-carbon (CC) type according to an embodiment of the present disclosure;
[0039] Figure 3d is an exemplary schematic diagram of a framework diagram of a base model according to an embodiment of the present disclosure;
[0040] Figure 3e is an exemplary schematic diagram of a framework diagram of a fine-tune model according to an embodiment of the present disclosure;
[0041] Figure 4 is a flow chart of a dihedral angle energy prediction method according to an embodiment of the present disclosure;
[0042] Figure 5 is a structural block diagram of a training device for a dihedral energy prediction model according to an embodiment of the present disclosure;
[0043] Figure 6is a structural block diagram of dihedral energy prediction according to an embodiment of the present disclosure;
[0044] Figure 7 It is a schematic diagram of the hardware structure of the computer device of an embodiment of the present disclosure (for a computer device having an input device and an output device). DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0046] In the field of medicinal chemistry, the conformation (i.e., the spatial arrangement of molecules) of small drug molecules has a crucial influence on their biological activity. The interaction between small drug molecules and biological macromolecules (biological targets) is often highly dependent on their three-dimensional shape, and these interactions determine the efficacy and specificity of the drug. Conformational analysis occupies a central position in the drug design and development process because the correct conformation can promote the binding of the drug to its target, thereby improving its therapeutic effect. The dihedral angle (or torsion angle) is one of the key parameters to describe this conformation. In small drug molecules, dihedral angles are particularly critical because they affect the overall shape of the molecule and thus affect how the molecule binds to its biological target.
[0047] The dihedral angle is defined by four adjacent atoms in a molecule, usually between two connected chemical bonds. When looking at the bond formed by the middle two atoms, the angle between the first and third pairs of atoms is called the dihedral angle. This angle determines the relative position of the first and third pairs of atoms in space.
[0048] The main methods for studying the dihedral angles of molecular conformations include experimental techniques (such as X-ray crystallography, nuclear magnetic resonance spectroscopy) and computational simulation (CADD methods such as molecular dynamics simulation). With the exponential growth of the chemical space of synthesizable small molecules, experimental techniques and traditional computational-assisted drug design (CADD) methods face huge challenges. It far exceeds the scope of effective screening and research through traditional experimental and computational methods. In order to overcome these limitations, machine learning and AI technologies have been introduced into the drug discovery process. Deep learning models, such as deep neural networks (DNNs), graph neural networks (GNNs), sequence-to-sequence models based on attention mechanisms, transformers, etc., are now used to predict the distribution of dihedral angles of molecular conformations. These models can learn patterns from a large amount of chemical data. At present, the main solution in the industry is to use machine learning methods to learn high-precision dihedral angle distribution data, which are mainly calculated by density functional theory (DFT).
[0049] The embodiments of the present disclosure provide a training method for a dihedral angle energy prediction model, a dihedral angle energy prediction method, an apparatus, a device, a storage medium, and a program product, which divide the molecular structure fragments used for training into a dihedral angle fragment set, then generate a first sample subset in a dihedral angle fragment sample set based on a first fragment subset in the dihedral angle fragment set, then obtain a first subset of a feature matrix set corresponding to the first sample subset, extract the features of the characterization conformation of each dihedral angle fragment sample in the characterization conformation set of the dihedral angle fragment samples in the first sample subset, organize the features of the characterization conformation set of the corresponding dihedral angle fragment samples into a feature matrix, then use the dihedral angle energy prediction model to generate a predicted energy value and calculate the loss, and update the parameters of the dihedral angle energy prediction model. value, thereby improving the performance of the dihedral angle energy prediction model; wherein, the dihedral angle energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module, and the self-attention module generates a feature matrix that implicitly represents the relationship between each conformation according to the input feature matrix, which reflects the intrinsic relationship between the conformations and can improve the dihedral angle energy prediction model's understanding of the complex interaction between dihedral angle fragments and energy. The output of the self-attention module is then converted into a format suitable for processing by the deep neural network module through the flattening layer. Thereafter, the complex mapping relationship from the feature matrix to the energy value is learned through the deep neural network module, thereby improving the accuracy of the dihedral angle energy prediction model in predicting the energy of the dihedral angle fragments and improving the performance of the trained dihedral angle energy prediction model.
[0050] According to an embodiment of the present disclosure, an embodiment of a method for training a dihedral energy prediction model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] In this embodiment, a dihedral angle energy prediction model training method is provided, which can be used in the above-mentioned computer system, such as a mobile terminal, a portable computer, a tablet computer, etc. Figure 1 is a flow chart of a training method for a dihedral energy prediction model according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:
[0052] Step S101, when training a dihedral angle energy prediction model, segmenting the molecular structure used for training to obtain a dihedral angle segment set.
[0053] Among them, molecular fragmentation is to decompose complex molecular structures into smaller, simpler substructures or fragments. In the scenario of dihedral energy prediction, local structural fragments containing specific dihedral angles can be extracted. In some specific examples, small molecular formulas can be extracted from the molecular library first, and then based on the dihedral angle fragment cutting technology, the molecules can be cut into dihedral angle fragments to extract the dihedral angle fragment collection.
[0054] The technology for segmenting dihedral angle segments may be a technology for segmenting dihedral angle segments in the existing technology or in the future, and this application does not limit this. For example, the dihedral angle segments may be segmented based on rules, graphs, or attention mechanisms in deep learning.
[0055] Specifically, when segmenting dihedral angle segments based on rules, segmentation rules may be predefined, and then the dihedral angle segments are segmented according to the segmentation rules. For example, the segmentation rules may be defined according to the type, angle or distance of chemical bonds, and the dihedral angle segments are identified and extracted according to the segmentation rules.
[0056] When segmenting dihedral angles based on graphs, molecules can be represented as graph structures where atoms are nodes and chemical bonds are edges. Graph algorithms such as subgraph matching can then be used to identify segments containing specific dihedral angles.
[0057] When adopting the attention mechanism in deep learning to segment the dihedral angle segments, the attention mechanism can be used to allow the deep learning model to automatically learn and focus on the segments most relevant to the dihedral angle energy.
[0058] Step S102: generating a first sample subset of a dihedral angle fragment sample set based on a first fragment subset of a dihedral angle fragment set, wherein the dihedral angle fragment sample includes: a characterizing conformation set and a label energy value characterizing the conformation set.
[0059] Among them, the first fragment subset of the dihedral angle fragment set can be determined from the dihedral angle fragment set based on a preset standard for screening training samples. The preset standard can be determined by a person skilled in the art according to the needs or experience of the application scenario, and the present application does not limit this. For example, the preset standard may include the representativeness, size, complexity, etc. of the dihedral angle fragments, and the preset standard may also be the number of dihedral angle fragments, the ratio of dihedral angle fragments, etc. determined manually. This first fragment subset will be used to generate the first sample subset.
[0060] For each dihedral angle fragment in the first fragment subset, a corresponding set of representative conformations can be generated. A conformation is a representation of a specific geometric shape of a molecule in space, and different conformations may result in different dihedral angle energies. The method for generating the corresponding set of representative conformations may be a method for generating conformations in the prior art or in a technology to be developed in the future, and this application does not limit this. For example, conformations may be generated by simulation, experiment, conformation search algorithm (e.g., Monte Carlo, genetic algorithm), etc.
[0061] For each set of representative conformations, the corresponding label energy value can be generated through quantum mechanical calculations (such as density functional theory), experimental measurements or other calculation methods, that is, the energy value of each dihedral angle in these representative conformation sets is generated.
[0062] Step S103: obtaining a first subset of the feature matrix set corresponding to the first sample subset.
[0063] Among them, the feature matrix in the feature matrix set corresponds to the characterization conformation set of the dihedral angle fragment sample, and the features in the feature matrix correspond to the characterization conformation of the dihedral angle fragment sample. That is, the feature matrix set is the set of feature matrices of all dihedral angle fragment samples, and each dihedral angle fragment sample has a corresponding feature matrix, and the size of the feature matrix set is the same as the size of the dihedral angle fragment sample set.
[0064] The first subset of the feature matrix set is a subset selected from the feature matrix set and corresponding to the first sample subset. That is, for each sample in the first sample subset, there is a corresponding feature matrix in the first subset of the feature matrix set.
[0065] Step S104, using the dihedral energy prediction model, generates a set of first predicted energy values corresponding to the first subset of the feature matrix set according to the first subset of the feature matrix set, and generates a first loss determined based on the difference between each first predicted energy value and the corresponding label energy value.
[0066] Among them, the first loss is used to update the parameter value of the dihedral energy prediction model; the dihedral energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module connected in sequence. The self-attention module allows the model to learn and identify the dependencies in the input feature matrix, so as to generate a feature matrix that implicitly represents the relationship between each conformation based on the input feature matrix. The flattening layer is used to convert the multi-dimensional feature matrix into a one-dimensional feature vector. The deep neural network module is a module composed of a multi-layer neural network, which is used to receive the feature vector output by the flattening layer and output the predicted energy value.
[0067] When training the dihedral angle energy prediction model, the first subset of the feature matrix set can be input into the self-attention module of the dihedral angle energy prediction model, thereby generating a corresponding first set of predicted energy values through the forward propagation of the self-attention module, flattening layer, and deep neural network module of the dihedral angle energy prediction model.
[0068] In addition, the difference between the first predicted energy value and the corresponding label energy value can be calculated, and the accuracy of the prediction result of the dihedral energy prediction model can be determined based on the loss function determined by the difference. The loss function here can be a loss function used for regression problems in existing or future technologies, and this application does not limit this. For example, the loss function here can be a mean square error (MSE) function, a mean absolute error (MAE) function, an L1 loss function, an L2 loss function, etc.
[0069] After calculating the loss value, the dihedral energy prediction model can update its parameters through a back-propagation algorithm or an optimized back-propagation algorithm. The back-propagation algorithm is a method for calculating gradients, which can guide the direction of parameter update based on the derivative of the loss function with respect to the parameters of the dihedral energy prediction model. Through the back-propagation algorithm or an optimized back-propagation algorithm (such as the gradient descent algorithm or its variants), the parameters of the dihedral energy prediction model are updated to minimize the loss function, thereby improving the prediction performance of the model.
[0070] In the training process of the dihedral angle energy prediction model, the steps of inputting a feature matrix, generating a predicted energy value, calculating a first loss, and updating the parameters of the dihedral angle energy prediction model can be repeated until a certain stop condition is met (such as reaching a preset number of training rounds, the loss value drops below a certain threshold, or the performance of the validation set no longer improves). After iterative training of the dihedral angle energy prediction model, the dihedral angle energy prediction model can gradually learn the mapping relationship from the feature matrix to the energy value, and can predict a more accurate energy value for the feature matrix of the dihedral angle fragment to be predicted.
[0071] The training method of the dihedral angle energy prediction model in the present embodiment divides the molecular structure fragments used for training into a dihedral angle fragment set, and then generates a first sample subset in the dihedral angle fragment sample set based on the first fragment subset in the dihedral angle fragment set, and then obtains the first subset of the feature matrix set corresponding to the first sample subset, extracts the features of the characterization conformation of each dihedral angle fragment sample in the characterization conformation set of the dihedral angle fragment samples in the first sample subset, and organizes the features of the characterization conformation set of the corresponding dihedral angle fragment samples into a feature matrix, and then uses the dihedral angle energy prediction model to generate a predicted energy value and calculate the loss, thereby updating the parameter value of the dihedral angle energy prediction model and improving the performance of the dihedral angle energy prediction model. The dihedral angle energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module. The self-attention module generates a feature matrix that implicitly represents the relationship between each conformation based on the input feature matrix, which reflects the intrinsic relationship between the conformations and can improve the dihedral angle energy prediction model's understanding of the complex interaction between dihedral angle fragments and energy. The output of the self-attention module is then converted into a format suitable for processing by the deep neural network module through the flattening layer. After that, the deep neural network module learns the complex mapping relationship from the feature matrix to the energy value, which improves the accuracy of the dihedral angle energy prediction model in predicting the energy of the dihedral angle fragments and improves the performance of the trained dihedral angle energy prediction model.
[0072] In some optional implementations of the above embodiment, the above dihedral energy prediction model training method may further include step S105.
[0073] Step S105, after the dihedral energy prediction model is trained, the optimized dihedral energy prediction model is used to generate a set of second predicted energy values corresponding to the second subset of the feature matrix set according to the second subset of the feature matrix set, and a second loss determined based on the difference between each second predicted energy value and the corresponding label energy value.
[0074] Among them, the second loss is used to update the parameter values of the transfer layer, residual connection and normalization layer of the optimized dihedral angle energy prediction model; the optimized dihedral angle energy prediction model sets a transfer layer between the multi-head attention layer and the residual connection and normalization layer of the self-attention module of the trained dihedral angle energy prediction model; the second subset of the feature matrix set includes: the feature matrix corresponding to the characterization conformation set of each dihedral angle fragment sample in the second sample subset of the dihedral angle fragment sample set.
[0075] Specifically, the accuracy of the label energy value of the second sample in the second sample subset is higher than the accuracy of the label energy value of the first sample in the first sample subset. Since the label energy value corresponding to the feature matrix in the second subset has higher accuracy, by setting the adapter layer, the complex mapping relationship between the feature matrix in the second subset of the feature matrix set and its corresponding label energy value can be learned, and by gradually adjusting the parameters of the adapter layer, the model predicts the second predicted energy value closer to the actual label value, thereby quickly and effectively improving the prediction accuracy of the trained optimized dihedral energy prediction model on the basis of the trained dihedral energy prediction model.
[0076] In some optional implementations of the above embodiment, the above dihedral energy prediction model training method may further include step S106 and / or step S107.
[0077] Step S106, using a first evaluation data set of dihedral angle segments of different dimensions to evaluate the trained dihedral angle energy prediction model, and obtaining a first evaluation index of the trained dihedral angle energy prediction model.
[0078] Step S107, using a second evaluation data set of dihedral angle segments of different dimensions to evaluate the trained optimized dihedral angle energy prediction model, and obtaining a second evaluation index of the trained optimized dihedral angle energy prediction model.
[0079] The training method of the dihedral energy prediction model in this embodiment can use evaluation data sets of dihedral angle fragments of different dimensions to evaluate the trained model and obtain evaluation indicators of the model. In this process, the evaluation data of dihedral angle fragments of different dimensions are used to make the evaluation results include more evaluation angles, accurately reflect the performance of the trained model, and provide a basis for improving the trained model.
[0080] In some optional implementations of the above embodiment, the above dihedral energy prediction model training method may further include step S108 and / or step S109.
[0081] Step S108: optimizing the trained dihedral energy prediction model based on the first evaluation index.
[0082] Step S109: optimizing the trained optimized dihedral energy prediction model based on the second evaluation index.
[0083] The training method of the dihedral angle energy prediction model in this embodiment, since the evaluation indicators include more evaluation angles, uses the evaluation indicators to optimize the optimized dihedral angle energy prediction model trained, which can improve the model's fitting and generalization capabilities, thereby improving the model's reliability and stability.
[0084] In some optional implementations of the above embodiments, the features in the above feature matrix can be determined based on the following steps: based on the following features within the characterization conformation of the dihedral angle fragment sample: two interatomic distance features, three interatomic angle features and four interatomic dihedral angle features, features corresponding to the characterization conformation of the dihedral angle fragment sample are generated.
[0085] Among them, the two interatomic distance features can characterize information about the shape, size, and possible chemical bond types of the characteristic conformation of the dihedral fragment sample; for example, the distance between specific amino acid residues can be used to identify functional interactions or domains.
[0086] The three interatomic angle features can characterize the stereostructure and possible chemical environment of the dihedral fragment sample. In organic compounds, specific bond angles are the key to determining the molecular geometry and possible chemical reactions. Among them, the three interatomic angles can be the angles formed by one atom and two other atoms.
[0087] The dihedral angle features between four atoms can characterize the characteristics of dihedral angles (also called torsion angles, which are the relative rotations between two adjacent coplanar atomic groups). In the representative conformation of the dihedral angle fragment sample, the dihedral angles between four atoms provide information about the rotation within the representative conformation of the dihedral angle fragment sample, which can characterize the dynamic behavior, conformational stability and biological activity of the representative conformation of the dihedral angle fragment sample. For example, the dihedral angle of the peptide bond defines the relative position between amino acid residues in order to determine the folding mode and function of the protein.
[0088] After determining the two interatomic distance features, three interatomic angle features, and four interatomic dihedral angle features in the characterization conformation of the above-mentioned dihedral angle fragment sample, a feature generation method in the existing technology or future development technology can be used to generate a comprehensive feature based on the above-mentioned three features, and this application does not limit this. For example, a comprehensive feature can be generated by linear combination (accumulation, weighted accumulation), nonlinear combination (product, square root, exponential function, etc.), combination definition based on domain knowledge, etc., to obtain a feature corresponding to the characterization conformation of the dihedral angle fragment sample.
[0089] The training method of the dihedral angle energy prediction model in this embodiment takes into account various types of features such as the distances between two atoms, three interatomic angles and four interatomic dihedral angles within the characterization conformation, and reflects the structure of the characterization conformation from different dimensions and different granularities, ensuring that the energy prediction model can learn the subtle differences between the characterization conformations, thereby improving the accuracy of the prediction results of the trained energy prediction model.
[0090] In some optional implementations of the above embodiments, the distance characteristics between two atoms in the characterization conformation include: for the intermediate bond of the dihedral angle in the characterization conformation, traversing each atom in the characterization conformation, and determining the sum of the distances between the virtual point and the atom when the atom is of different element types, and the mutual attraction; based on the sum of the distances, the mutual attraction, and the atomic number of the intermediate bond, determining the distance characteristics between the two atoms in the characterization conformation.
[0091] Among them, the middle bond representing the dihedral angle in the conformation is the connecting bond between two adjacent planes, which can determine the relative rotation of the two planes. The virtual point is the center of the middle bond. When calculating the distance between two atoms in the conformation, it is regarded as one of the two atoms, and the distance between the virtual point and the other atom is calculated.
[0092] Specifically, when calculating the distance feature between two atoms in the representation conformation, each atom in the representation conformation can be traversed, and when accessing each atom, according to the different element types of the atom (for example, carbon, oxygen, nitrogen, etc.), a preset distance function is used to calculate the distance between the atom and the virtual point and sum them, and a preset gravity formula is used to calculate the mutual gravity between the atom and the virtual point. Afterwards, based on the sum of the distances, the mutual gravity, and the atomic number of the intermediate bond, the distance feature between the two atoms in the representation conformation is determined.
[0093] The training method of the dihedral angle energy prediction model in this embodiment takes into account the intermediate bond of the dihedral angle, uses the center of the intermediate bond of the dihedral angle as a virtual point, and traverses each atom in the representation conformation, combining the sum of the distances between the virtual point and the atom when the visited atom is of different element types, the mutual attraction, and the atomic number of the intermediate bond to determine the distance characteristics between the two atoms in the representation conformation, distinguishes the interaction between atoms of different element types and the virtual point and the influence of the dihedral angle on the characteristics of the molecular conformation, so that the distance characteristics between the two atoms in the representation conformation represent the complexity of the relative position and spatial relationship between atoms, thereby improving the ability of the energy prediction model to understand the representation conformation and predict the energy of the dihedral angle on this basis.
[0094] In some optional implementations of the above embodiments, the angular characteristics between three atoms in the characterizing conformation include: for the intermediate bond of the dihedral angle in the characterizing conformation, the angular characteristics between three atoms in the characterizing conformation are determined based on the virtual point, the distance between any two atoms in the characterizing conformation, the mutual attraction between the three atoms, the angle between the three atoms, and the atomic number of the intermediate bond.
[0095] Among them, the virtual point is the center of the middle bond, which characterizes the characteristics of the middle bond. The angle between the three is the angle between the virtual point and the straight line corresponding to the distance between any two atoms, that is, the angle between two rays (or line segments) starting from the virtual point and passing through any two atoms mentioned above.
[0096] The training method of the dihedral angle energy prediction model in this embodiment takes into account the distances between virtual points, any two atoms in the representation conformation, mutual attraction, angles, and atomic numbers of intermediate bonds. It describes the relative position, interaction, stability of molecular conformation, directional relationship, three-dimensional structure, characteristics and properties of molecular conformation between the virtual points and any two atoms from multiple dimensions and multiple granularities, thereby improving the accuracy of calculating the angle features between the virtual points and any two atoms in the representation conformation, and thereby improving the accuracy of the dihedral angle energy prediction model.
[0097] In some optional implementations of the above embodiments, the dihedral angle characteristics between four atoms in the characterizing conformation include: for the intermediate bond of the dihedral angle in the characterizing conformation, based on the distances between any two atoms other than the two atoms of the intermediate bond in the characterizing conformation and the atoms of the two atoms of the intermediate bond located on the same side and opposite side of the intermediate bond, respectively, combined with the distance between any two atoms, the mutual attraction corresponding to each distance, the angle of the dihedral angle corresponding to the intermediate bond, and the atomic number of the intermediate bond, the dihedral angle characteristics between the four atoms in the characterizing conformation are determined.
[0098] The training method of the dihedral angle energy prediction model in this embodiment takes into account the shortest distance between any two atoms other than the atoms of the intermediate bond in the representation conformation and the two atoms of the intermediate bond, the distance between any two atoms, the mutual attraction corresponding to these three distances, the dihedral angle, and the atomic number of the two atoms of the intermediate bond, and describes the relationship between the two atoms of the intermediate bond and the atoms on the same side of the intermediate bond as any two atoms, and between the two atoms from multiple dimensions and multiple granularities. These relationships include: relative position, interaction, stability of molecular conformation, directional relationship, three-dimensional structure, characteristics and properties of molecular conformation, etc., which improves the accuracy of calculating the angle characteristics between the two atoms of the intermediate bond in the representation conformation and any two atoms, thereby improving the accuracy of the dihedral angle energy prediction model.
[0099] In some optional implementations of the above embodiments, based on the following features in the characterization conformation of the dihedral angle fragment sample: two interatomic distance features, three interatomic angle features and four interatomic dihedral angle features, features corresponding to the characterization conformation of the dihedral angle fragment sample are generated, including: merging the two interatomic distance features, three interatomic angle features, four interatomic dihedral angle features, the angle of the dihedral angle corresponding to the intermediate bond, the distance between the two atoms of the intermediate bond, the distance between the two end atoms of the dihedral angle, the product of the serial numbers of the two atoms of the intermediate bond, and the serial numbers of the two end atoms in the characterization conformation of the dihedral angle fragment sample to obtain the features corresponding to the characterization conformation of the dihedral angle fragment sample.
[0100] Among them, the method of merging features can adopt the feature merging method in the existing technology or the technology to be developed in the future, and generate a comprehensive feature based on the above-mentioned multiple features, and this application does not limit this. For example, the comprehensive feature can be generated by linear combination (accumulation, weighted accumulation), nonlinear combination (product, square root, exponential function, etc.), splicing, embedding, weighted fusion, aggregation fusion, convolution fusion, attention fusion, combination definition based on domain knowledge, etc., to obtain the feature corresponding to the characterization conformation of the dihedral angle fragment sample.
[0101] The training method of the dihedral angle energy prediction model in this embodiment combines features from multiple levels and dimensions, making the features characterizing the conformation more representative and discriminative, thereby enabling the dihedral angle energy prediction model to more accurately learn the relationship between the characterization conformation set and the label energy value, thereby improving the accuracy of the trained energy prediction model.
[0102] The following combination Figure 2 , describes an exemplary process of a method for determining a set of characterizing conformations of dihedral angle fragment samples and a label energy value of the set of characterizing conformations in the above embodiment. Figure 2 As shown, the process includes the following steps:
[0103] Step S201 : executing a sample generation step for each target dihedral segment in the first segment subset.
[0104] Step S2011, sampling an initial conformation set corresponding to the target dihedral angle fragments, where the initial conformation indicates the arrangement of the target dihedral angle fragments in three-dimensional space.
[0105] The initial conformation set corresponding to the dihedral angle fragment of the sampling target can be realized by using a method of generating conformations based on sampling technology in existing technology or future technology, and this application does not limit this. For example, the algorithm ConfGen / ConfGenX for retrieving biologically active conformations, the ultra-fast molecular conformation search algorithm AlphaConf, etc. can be used to generate the initial conformation set.
[0106] Step S2012, scanning the dihedral angle of each initial conformation in the initial conformation set at intervals of a preset angle to obtain an expanded conformation set.
[0107] Among them, the method for scanning the initial conformation can be a method used in existing technology or future technology to scan conformations to generate a conformation set. This application does not limit this. For example, the scanning method can be used to scan the initial conformation using Gentor, a convenient tool for molecular conformation search, or the scan tool in the conformation search tool RDKit, so as to obtain an expanded conformation set.
[0108] Step S2013, for the expanded conformation set, while keeping the dihedral angle unchanged, local optimization of the conformation is performed with the generation of an expected number of dihedral conformations as a constraint, to obtain candidate conformations corresponding to each dihedral conformation in the expected number of dihedral conformations, for the expected number of dihedral conformations, the candidate conformation with the lowest energy value among the candidate conformations corresponding to each dihedral conformation is used as the characterization conformation, to obtain the characterization conformation set of the target dihedral fragment, and the label energy value of the characterization conformation set is recorded.
[0109] Among them, performing local optimization on the extended conformation set is to adjust other degrees of freedom such as bond length to minimize energy or meet other objective functions while keeping the specified dihedral angle unchanged. Local optimization can be achieved by using local optimization methods for conformations in existing technologies or future technologies, and this application does not limit this. For example, it is completed using a semi-empirical quantum mechanics calculation method XTB (Extended Tight-Binding), a molecular mechanics force field MMFF94, or a molecular mechanics force field AMBER in conjunction with a local optimization algorithm (such as a conjugate gradient method or BFGS). The optimization process can ensure that each conformation reaches the lowest or near-lowest local energy under given constraints.
[0110] The training method of the dihedral angle energy prediction model in the present embodiment obtains a large number of initial conformations through initial sampling, and obtains a large number of extended conformations by scanning the dihedral angles of the initial conformations, and the arrangements of these extended conformations in three-dimensional space are different, thereby increasing the diversity of training data and improving the breadth and versatility of dihedral angle fragment samples; then, while keeping the dihedral angle unchanged, a local optimization method is used to generate an expected number of dihedral angle conformations, and from the candidate conformations of each conformation, the candidate conformation with the lowest energy value is screened out as the characterization conformation, and a characterization conformation set and a label energy value of the characterization conformation set are obtained, thereby obtaining a characterization conformation set of dihedral angle fragment samples with stable energy and reasonable energy and a label energy value of the characterization conformation set, thereby improving the quality of training samples and improving the accuracy and reliability of the trained dihedral angle energy prediction model.
[0111] In a specific application scenario of the above embodiment of the present application, the training method of the above dihedral energy prediction model may include:
[0112] 1. Data Production
[0113] From the commercial molecular library GOSTAR and the crystal library CSD, 3 million small molecular formulas were extracted, and then the molecules were cut into dihedral angle fragments based on the dihedral angle fragment cutting technology, and 5 million fragments were extracted. The lowest energy value of 24 different dihedral angles was calculated for each fragment. The low-precision semi-empirical quantum mechanics calculation method XTB was used for 4,900,000 fragments, and the high-precision density functional theory calculation method DFT was used for 50,000 fragments.
[0114] Specifically, the data sources for data production include: training data and evaluation data are divided into three categories: GOSTAR commercial library molecular library data, crystal library CSD library drug small molecules, molecules generated by self-built generation models, and the establishment of a proprietary molecular library, referred to as the StoneWise library. The data characteristics of the GOSTAR commercial library are that the small molecules in the library have undergone biosynthesis and tested their biological activity with the target, and the data volume is about 5,000,000. The small molecule characteristics of the CSD library are the binding of small molecules to target proteins, and the binding conformation of small molecules is described in three-dimensional space. There are currently 70,000 such data. The StoneWise library is characterized by high novelty and diversity of molecules. The data is generated from internal projects. These molecules have been evaluated by pharmaceutical experts, and the data volume is about 1,000.
[0115] The data calculation is mainly divided into two parts. The first part is to extract fragments from the molecules, and the second part is to calculate the lowest energy value of the fragments at different dihedral angles.
[0116] There are two main steps in fragment extraction:
[0117] 1) Traverse all four adjacent atoms in the molecule that can form dihedral angles.
[0118] 2) The four atoms expand outward according to the rules to form molecular fragments. The expansion rules are: starting from the four atoms, include the atoms within the range of a bond; if the bond is a structure on a ring, include the entire ring structure; if the bond is a bond on a functional group, include the entire functional group; include the ortho-substituents; because the fragment is separated from the molecule, a broken bond is generated, if it is a heteroatom, a methyl group is added, if it is a carbon atom, a hydrogen is added. In short, each fragment is extracted from a complete molecule.
[0119] The calculation of the 24 dihedral angle energies of a fragment is divided into five steps:
[0120] 1) Generate fragment conformations: ConfGenX, an algorithm for retrieving biologically active conformations, was used to sample 20 conformations for each fragment.
[0121] 2) Scanning dihedral angles: Use the scan tool in the conformation search tool RDKit to scan the dihedral angles in each conformation, scanning once every 15 degrees, and generating 24 scanned conformations for each initial conformation. A total of 20×24 conformations are generated.
[0122] 3) Use the semi-empirical quantum mechanics calculation method XTB (Extended Tight-Binding) or the molecular mechanics force field MMFF94 to perform local optimization of the 20×24 conformation while keeping the dihedral angle unchanged. The goal of local optimization of the conformation is to search for a conformational spatial structure with the lowest energy, and find this lowest energy spatial structure through genetic algorithms.
[0123] 4) Each dihedral angle has 20 conformations. From the 20 conformations, the conformation with the lowest energy value is selected according to the energy value as the representative conformation of this angle. There are a total of 24 dihedral angles, so there are 24 conformations and energy values.
[0124] 5) Use the local optimization tool in the DFT calculation software to generate 24 conformations and calculate the optimized energy value.
[0125] In short, multiple data sources ensure the diversity of our data, and calculation methods based on multiple precisions ensure the polymorphism of the data, providing a basic guarantee for the generalization and accuracy of the model.
[0126] 2. Feature Extraction
[0127] The spatial chemical environment characterization around the dihedral angles of molecular fragments is extracted using the symmetry function SF method, which requires the three-dimensional spatial structure of each dihedral angle of the molecular fragment.
[0128] During the data production process, 24 conformations and energy values were generated for each fragment, and each conformation corresponds to an energy value. Our goal is to establish the relationship between conformation and energy value. How to use features to represent the conformation of the fragment is the key to the model. In order to ensure that the representation of the conformation is rotationally invariant, the symmetry function (SF) can be used to extract the chemical environment representation of the conformation. SF mainly extracts representations from three aspects, namely, two interatomic distance features within the conformation, three interatomic angle features, and four interatomic dihedral angle features.
[0129] 1) Characteristics of the distance between two atoms:
[0130] Select the center of the middle bond of the dihedral angle as a virtual atom i for calculating the distance between two atoms, also called virtual point i, and select any atom in the conformation as another atom j for calculating the distance between two atoms. The specific formula is as follows:
[0131]
[0132] in, is the threshold, and its values are [1.5, 2.0, 2.5, 3.0, 4.0, 6.0, 10], Indicates the distance between virtual atom i and atom j when the element type of atom j is a, with superscript It is the element type of the atom, which are H, C, N, O, F, S, Cl plus positive and negative formal charges, a total of 9 element types; is pi; express The cosine function of .
[0133] In finding the interatomic distance characteristics When considering the atomic number of the intermediate bond, the mutual attraction between the atom j of each element type and the virtual point i, and the Gaussian sum of the distance formula, the formula is as follows:
[0134]
[0135] in, , are the atomic numbers of the middle bonds, and They are the empirical constants and 0. represents the calculated distance between atom j and virtual point i, represents the mutual attraction between atom j and virtual point i when the element type is a, and N represents the number of times element type a appears in the representation conformation of the dihedral angle fragment. A total of 63 (9 elements × 7 )-dimensional features.
[0136] For example, we have a dihedral angle fragment. The distance characteristics between two atoms in the dihedral angle fragment are represented as follows Figure 3a As shown, Figure 3a A schematic diagram showing the determination of the eigenvalue of the distance between two atoms:
[0137] Specifically, the j atom can be distinguished according to the atom type. When j is a C atom, the distance from i to j is 3.52. Bring in When j is a C atom type, the distances from all C atoms in the graph to i are calculated, and then the interatomic distance feature is used. Distance Add and calculate 7 distance features, and the other elements are similar. A total of 63 (9 elements × 7 )-dimensional features.
[0138] 2) Three interatomic angle features:
[0139] Three interatomic angle features The calculation formula is as follows:
[0140]
[0141] Subscript i is the center point of the middle bond of the dihedral angle, that is, virtual atom i, and subscript j and k are any two atoms in the conformation. are the distances between atom i and atom k, For , is the angle formed by the sides. , , are the empirical constants 0.5, 0.5 and , The value is 4.0, are the numbers of the two atoms in the middle bond, There are a total of 45 combinations of element types (CC, CN, CO...Ccl, CS, CH), so the angle feature is a 45-dimensional feature.
[0142] As attached Figure 3b As shown, attached Figure 3b An exemplary schematic diagram of determining three interatomic angle characteristic values for a combination of oxygen and nitrogen (ON) element types is shown in FIG. Figure 3b In the conformation, atom k is an oxygen atom, atom j is a nitrogen atom (blue atom), and the conformation includes 3 nitrogen elements. For the combination of oxygen and nitrogen (ON) element types, there are three combinations as shown in the figure. Therefore, according to the above angle calculation formula , the three interatomic angle eigenvalues of the combination of each oxygen-nitrogen (ON) element type can be calculated to be 2.13, 4.12 and 3.12 respectively, and then the three eigenvalues are added together to obtain the three interatomic angle eigenvalue 9.37 corresponding to the combination of oxygen-nitrogen (ON) element types.
[0143] 3) Four interatomic dihedral angle characteristics:
[0144] The calculation formula for the dihedral angle characteristics between the four atoms is as follows:
[0145]
[0146] Among them, k and j are the two atoms of the middle bond, keeping k and j atoms unchanged, i and l are arbitrarily selected atoms in the conformation except k and j, forming a 4-tuple. is the dihedral angle value, such as Figure 3c The -40.6 in the marker. , , are the empirical constants 0.5, 0.5 and , in the calculation hour, The corresponding The value range is [2.5,3.5,5.0,10.0], The characteristic dimension is The product of the number of 4 and the number of combinations of element types of atoms i and l, 45, that is, The feature dimension is 4×45=180 features.
[0147] As attached Figure 3c As shown, Figure 3c A schematic diagram showing the characteristics of four interatomic dihedral angles that determine the combination of element types of atoms i and l to be of the carbon-carbon (CC) type.
[0148] First, select the k and j atoms of the middle bond of the dihedral angle, and select the i and l atoms in the conformation to generate the figure , The physical distance and dihedral angle ,pass The formula is transformed into a 4-dimensional feature. The subscripts i and l are swapped, and the atoms with subscript i become subscript l, and the atoms with subscript l become subscript i, so as to change , The distance between the two 4-dimensional features is used to form a new 4-dimensional feature. Finally, the two 4-dimensional features are added together to form a CC type feature of the combination of element types. The features of other element types can be deduced in the same way.
[0149] 4) Feature connection:
[0150] Two interatomic distance features, three interatomic angle features and four interatomic dihedral angle features are combined to obtain 287-dimensional features. Then, the angle of the dihedral angle, the distance between the two atoms in the middle bond of the dihedral angle, the distance between the atoms at both ends of the dihedral angle, the product of the serial numbers of the two atoms in the middle bond, and the serial numbers of the atoms at both ends of the dihedral angle are used as five new features and combined with the previous 287-dimensional features to form 293-dimensional features as the input of the model.
[0151] 3. Model Construction
[0152] This paper adopts the self-attention framework to characterize the relationship between the 24 dihedral angles of the same dihedral angle fragment, and combines the deep neural network (DNN) to fit the energy value. The base model is trained based on low-precision data, and the base model is fine-tuned based on high-precision data to improve the prediction accuracy of the base model. Next, it will be explained from three aspects: base model construction and fine-tuning model training efficiency.
[0153] 1) Base model learning:
[0154] The goal of base model learning is to generate a predicted energy value of a dihedral angle given a dihedral angle fragment.
[0155] The dihedral angle fragment will generate 24 conformations through data production, and each conformation represents a type of dihedral angle. In short, a dihedral angle fragment will be represented by a two-dimensional matrix of 24*293. Considering that different conformations in the same fragment are interrelated, this relationship is characterized by the self-attention framework. The model fits the energy value of each conformation, connects DNN after self-attention, and finally outputs a 24*1 dimension result through DNN transformation. The framework diagram of the base model is as follows Figure 3d shown.
[0156] First, input the feature vector to the self-attention framework, that is, input the 24*293 matrix M, each row of M is the characteristic corresponding to the conformation, There is a sequence, arranged from small to large according to the value of the dihedral angle. After self-attention, it becomes , the transformation formula is as follows:
[0157]
[0158] Each Decompose into and , in, and They are The query vector, key vector, and value vector obtained by multiplying the three preset weight matrices or coefficients, With others of Multiply them together to get 24 values, and select the largest value through the normalized exponential function softmax function. The largest value is Multiplying together finally gives us 293 dimensions. . After the self-attention framework, a new 24*293 matrix representation is finally generated. These representations imply the internal relationship of 24 conformations. Among them, self-attention includes a multi-head attention layer and a residual connection layer (that is, the residual connection and normalization layer Add&layerNorm in the above embodiment) to realize the transformation of the feature matrix, which will not be repeated here.
[0159] After that, the 24*293-dimensional matrix is flattened into a 7032-dimensional vector through the flatten layer operation. The vector passes through the DNN (including the fully connected layers 1-N) and finally outputs a 24*1-dimensional vector. The loss of the model is the mean absolute error (MAE) of the energy value, and the formula is as follows:
[0160]
[0161] in, To predict the energy value; It is the energy value calculated by XTB or DFT, that is, the label energy value. It is the logarithmic hyperbolic cosine function of the difference between the predicted energy value and the label energy value.
[0162] That is, by describing the internal relationship of 24 dihedral angles in the same fragment through self-attention, and transforming the fitting energy value through the fully connected layer 1-fully connected layer N in the deep neural network DNN, a base model with 30,000,000 parameters was generated.
[0163] 2) Model fine-tune:
[0164] The above method constructs the base model. In order to improve the accuracy of the model while maintaining the generalization ability of the model, the adapter layer (also translated as adaptation layer) can be used to fine-tune the model. The framework diagram of the fine-tune model is as follows Figure 3e As shown:
[0165] The adapter is a feedforward neural network layer (FNN) added to the self-attention framework in the base model, and the other parameters of the base model are frozen and remain unchanged. The yellow part in the figure is the newly added layer adapter, and the pink residual connection layer (that is, the residual connection and normalization layer in the above embodiment) is the retrained part. The adapter is a feedforward neural network, in which information flows only in one direction: from input to output, without any feedback loop, as shown in the figure. High-precision training data is input into the trained base model. If it is not an adapter layer, the model parameters of this layer are not changed. Only the network parameters of the FNN layer corresponding to the adapter layer are updated, as well as the network parameters of the residual connection layer (add&layerNorm layer). In a specific example, Figure 3e As shown in the left part, the adapter is two fully connected layers, the input dimension is a 293-dimensional vector, after fully connected layer 1 and fully connected layer 2, the output dimension is a 293-dimensional vector, the total number of parameters is more than 800,000 parameters, the number of parameters in the first layer is 293*1465+1465=430710, and the number of parameters in the second layer is 1465*293+293=429538.
[0166] Understandably, Figure 3e In the fine-tune model, in addition to the modified self-attention framework, other structures, such as the flattening layer ( Figure 3e ), deep neural network, etc., which have the same structure as that in the base model and will not be described here.
[0167] 3) Training efficiency:
[0168] The base model is composed of self-attention and 6-layer DNN. The self-attention has more than 5 million training parameters, and the 6-layer deep neural network DNN has more than 25 million training parameters. Based on the 120 million training data (generated by the xtb process, details are in the data production section), the training parameters of the base model are set to 30 million. Under the premise of such big data and large models, a multi-card strategy is adopted to train the model. It took 3 days to train the model on 4 graphics cards NVIDIA V100.
[0169] The fine-tune model is trained on 1 million data sets (generated by the DFT process, details are in the data production section), with 600,000 parameters updated. It takes about a day to train using an Nvidia 2080 graphics card.
[0170] 4. Model evaluation.
[0171] 1) Expert-annotated data set. This data comes from molecules generated by AI in internal projects. Pharmaceutical chemistry experts annotate the unreasonable dihedral angles of the molecules as a criterion for evaluating the recognition rate of bad cases in the model.
[0172] 2) CSD crystal structure data set. About 10,000 small molecules were selected from the CSD library, and then 70,000 dihedral angles were extracted to examine whether the values of these dihedral angles were less than 2 kcal / mol compared with the values predicted by the model. Recall and precision were used as evaluation indicators.
[0173] 3) 5000 dihedral angle data generated based on high-precision density functional theory (DFT). This evaluation set is generated using DFT sp accuracy in a liquid environment. It is the highest accuracy in DFT and consumes a lot of computing resources. Recall, precision and Pearson correlation are used as indicators to measure this data set.
[0174] 4) Torsionnet500 dataset. This dataset contains 500 DFT data with general accuracy in a vacuum environment disclosed by Pfizer.
[0175] 5) 500,000 XTB data. This data is calculated using the low-precision XTB method.
[0176] The data from the above five data sets are used to evaluate the trained models. The evaluation results are shown in the following table:
[0177]
[0178] From the results in the above table, we can see that on high-precision data (CSD data, 5000 high-precision data), fine-tune has a significant improvement over the base model. On low-precision data (xtb data, torsionnet500), the performance is worse than the base model, but from the correlation of the Pearson coefficient, the fine-tune model still retains the low-precision fitting ability. In short, the fine-tune base model method can well improve the accuracy of the model while retaining the generalization ability.
[0179] In this embodiment, a method for determining features in a feature matrix corresponding to a dihedral angle segment sample is provided, which can be used in the above-mentioned computer system, etc. Figure 4 is a flow chart of a dihedral angle energy prediction method according to an embodiment of the present disclosure. Figure 4 As shown, the process includes the following steps:
[0180] Step S401, obtaining a dihedral angle segment to be predicted, and generating a third representation conformation set corresponding to the dihedral angle segment.
[0181] Specifically, the method for generating a set of conformation representations corresponding to dihedral angle fragments may be a method for generating conformations in the prior art or in future technologies, and this application does not limit this. For example, conformations may be generated by simulation, experiment, conformation search algorithm (e.g., Monte Carlo, genetic algorithm), etc.
[0182] In some optional implementations, the method for generating a set of characterization conformations corresponding to dihedral angle fragments may also use the method of generating a set of characterization conformations in steps S2011, S2012, and S2013 to generate a set of characterization conformations corresponding to dihedral angle fragments.
[0183] Step S402, obtaining a third feature matrix corresponding to a third characterization conformation set.
[0184] Specifically, the third feature matrix is a matrix of feature components representing the third representation conformation set. Each row of features corresponds to a representation conformation. The method for generating features can be a method for generating features in the existing technology or in the technology to be developed in the future, and this application does not limit this.
[0185] In some optional embodiments, the method for determining the features in the above-mentioned feature matrix may be used to determine the third feature matrix corresponding to the third characterizing conformation set.
[0186] Step S403: input the third feature matrix into the dihedral angle energy prediction model obtained by the training method of the dihedral angle energy prediction model according to the above embodiment to obtain a third predicted energy value corresponding to the dihedral angle segment to be predicted.
[0187] The dihedral angle energy prediction method provided in this embodiment first obtains the dihedral angle fragment to be predicted, and generates a third characterization conformation set corresponding to the dihedral angle fragment; then obtains a third feature matrix corresponding to the third characterization conformation set; finally, the third feature matrix is input into the dihedral angle energy prediction model obtained by the training method of the dihedral angle energy prediction model according to the first aspect or any corresponding embodiment thereof, to obtain the third predicted energy value corresponding to the dihedral angle fragment to be predicted, thereby improving the accuracy of the energy of the predicted dihedral angle fragment.
[0188] In the present embodiment, a training device for a dihedral energy prediction model is also provided, and the device is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0189] This embodiment provides a training device for a dihedral energy prediction model, such as Figure 5 As shown, the device comprises:
[0190] The fragment segmentation module 501 is used to segment the molecular structure used for training to obtain a dihedral angle fragment set when training the dihedral angle energy prediction model;
[0191] The sample generating module 502 is used to generate a first sample subset of a dihedral angle fragment sample set based on a first fragment subset of a dihedral angle fragment set, wherein the dihedral angle fragment sample includes: a characterizing conformation set and a label energy value characterizing the conformation set.
[0192] The feature acquisition module 503 is used to acquire a first subset of the feature matrix set corresponding to the first sample subset, wherein the feature matrices in the feature matrix set correspond to the characterization conformation set of the dihedral angle fragment samples, and the features in the feature matrix correspond to the characterization conformations of the dihedral angle fragment samples.
[0193] The model training module 504 is used to adopt the dihedral angle energy prediction model to generate a set of first predicted energy values corresponding to the first subset of the feature matrix set according to the first subset of the feature matrix set, and to generate a first loss determined based on the difference between each first predicted energy value and the corresponding label energy value, and the first loss is used to update the parameter value of the dihedral angle energy prediction model; the dihedral angle energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module connected in sequence, and the self-attention module generates a feature matrix that implicitly represents the relationship between each conformation according to the input feature matrix.
[0194] In some optional implementations, the above-mentioned device may further include functional modules corresponding one-to-one to the steps in the above-mentioned method, which will not be described in detail here.
[0195] The further functional description of each of the above modules is the same as that of the corresponding method embodiments above, and will not be repeated here.
[0196] In the present embodiment, a training device for a dihedral energy prediction model is also provided, and the device is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0197] This embodiment provides a dihedral energy prediction device, such as Figure 6 As shown, the device comprises:
[0198] The conformation generation module 601 is used to obtain the dihedral angle fragments to be predicted and generate a third representative conformation set corresponding to the dihedral angle fragments.
[0199] The feature acquisition module 602 is used to acquire a third feature matrix corresponding to the third characterization conformation set.
[0200] The prediction energy module 603 is used to input the third feature matrix into the dihedral angle energy prediction model obtained by the training method of the dihedral angle energy prediction model according to the first aspect or any corresponding embodiment thereof, to obtain a third predicted energy value corresponding to the dihedral angle fragment to be predicted.
[0201] The training device of the dihedral angle energy prediction model and the dihedral angle energy prediction device in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0202] See also Figure 7 , Figure 7 1 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present disclosure, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0203] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0204] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0205] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0206] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0207] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.
[0208] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0209] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0210] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0211] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A training method for a dihedral energy prediction model, characterized in that: The method comprises: When training the dihedral angle energy prediction model, the molecular structure used for training is segmented to obtain a dihedral angle segment set; Based on the first fragment subset of the dihedral angle fragment set, generating a first sample subset of the dihedral angle fragment sample set, wherein the dihedral angle fragment sample includes: a characterizing conformation set and a label energy value of the characterizing conformation set; Acquire a first subset of a feature matrix set corresponding to the first sample subset, wherein the feature matrices in the feature matrix set correspond to the characterization conformation set of the dihedral angle fragment samples, and the features in the feature matrix correspond to the characterization conformations of the dihedral angle fragment samples; The dihedral angle energy prediction model is used to generate a set of first predicted energy values corresponding to the first subset of the feature matrix set according to the first subset of the feature matrix set, and to generate a first loss determined based on the difference between each first predicted energy value and the corresponding label energy value, wherein the first loss is used to update the parameter value of the dihedral angle energy prediction model; the dihedral angle energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module connected in sequence, wherein the self-attention module generates a feature matrix that implicitly represents the relationship between each conformation according to the input feature matrix; The characterizing conformation set of the dihedral angle fragment sample and the label energy value of the characterizing conformation set are determined based on the following steps: For each target dihedral angle segment in the first segment subset, a sample generation step is performed, including: Sampling a set of initial conformations corresponding to the target dihedral angle fragments, wherein the initial conformations indicate an arrangement of the target dihedral angle fragments in three-dimensional space; Scanning the dihedral angle of each initial conformation in the initial conformation set at intervals of a preset angle to obtain an expanded conformation set; For the expanded conformation set, while keeping the dihedral angle unchanged, local optimization of the conformation is performed with the generation of an expected number of dihedral conformations as a constraint to obtain candidate conformations corresponding to each dihedral conformation in the expected number of dihedral conformations. For the expected number of dihedral conformations, the candidate conformation with the lowest energy value among the candidate conformations corresponding to each dihedral conformation is taken as the characterization conformation to obtain the characterization conformation set of the target dihedral fragment, and the label energy value of the characterization conformation set is recorded.
2. The method according to claim 1, characterized in that: The features in the feature matrix are determined based on the following steps: A feature corresponding to the representative conformation of the dihedral angle fragment sample is generated based on the following features within the representative conformation of the dihedral angle fragment sample: two interatomic distance features, three interatomic angle features, and four interatomic dihedral angle features.
3. The method according to claim 2, characterized in that The two interatomic distance features characterizing the conformation include: For the intermediate bond of the dihedral angle in the characterization conformation, traverse each atom in the characterization conformation to determine the sum of the distances and the mutual attraction between the virtual point and the atom when the atom is of different element types; based on the sum of the distances, the mutual attraction, and the atomic number of the intermediate bond, determine the distance characteristics between the two atoms in the characterization conformation, and the virtual point is the center of the intermediate bond.
4. The method according to claim 3, characterized in that The three interatomic angle features within the characterization conformation include: For the intermediate bond of the dihedral angle in the characterizing conformation, the angle characteristics between the three atoms in the characterizing conformation are determined based on the virtual point, the distances between any two atoms in the characterizing conformation, the mutual attraction between the three, the angle between the three, and the atomic number of the intermediate bond. The angle between the three is the angle between the straight lines corresponding to the distances between the virtual point and the any two atoms.
5. The method according to claim 4, characterized in that The four interatomic dihedral angle features in the characterization conformation include: For the intermediate bond of the dihedral angle in the characterizing conformation, the dihedral angle characteristics between the four atoms in the characterizing conformation are determined based on the distances between any two atoms other than the two atoms of the intermediate bond in the characterizing conformation and the atoms of the two atoms of the intermediate bond that are located on the same side and opposite side of the intermediate bond, respectively, combined with the distance between the any two atoms, the mutual attraction corresponding to each distance, the angle of the dihedral angle corresponding to the intermediate bond, and the atomic number of the intermediate bond.
6. The method according to claim 5, characterized in that The generating of features corresponding to the characterization conformation of the dihedral angle fragment sample based on the following features in the characterization conformation of the dihedral angle fragment sample: two interatomic distance features, three interatomic angle features and four interatomic dihedral angle features, comprises: The two interatomic distance features, three interatomic angle features, four interatomic dihedral angle features, the angle of the dihedral angle corresponding to the intermediate bond, the distance between the two atoms of the intermediate bond, the distance between the two end atoms of the dihedral angle, the product of the serial numbers of the two atoms of the intermediate bond, and the serial numbers of the two end atoms in the characterization conformation of the dihedral angle fragment sample are combined to obtain the features corresponding to the characterization conformation of the dihedral angle fragment sample.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: After the dihedral angle energy prediction model is trained, the optimized dihedral angle energy prediction model is used to generate a set of second predicted energy values corresponding to the second subset of the feature matrix set according to the second subset of the feature matrix set, and a second loss determined based on the difference between each second predicted energy value and the corresponding label energy value, wherein the second loss is used to update the parameter values of the switching layer, residual connection and normalization layer of the optimized dihedral angle energy prediction model; the optimized dihedral angle energy prediction model sets a switching layer between the multi-head attention layer and the residual connection and normalization layer of the self-attention module of the trained dihedral angle energy prediction model; the second subset of the feature matrix set includes: the feature matrix corresponding to the characterization conformation set of each dihedral angle fragment sample in the second sample subset of the dihedral angle fragment sample set, and the accuracy of the label energy value of the second sample in the second sample subset is higher than the accuracy of the label energy value of the first sample in the first sample subset.
8. The method according to claim 7, characterized in that The method further comprises at least one of the following: Using a first evaluation data set of dihedral angle segments of different dimensions to evaluate the trained dihedral angle energy prediction model, to obtain a first evaluation index of the trained dihedral angle energy prediction model; and A second evaluation data set of dihedral angle segments of different dimensions is used to evaluate the trained optimized dihedral angle energy prediction model to obtain a second evaluation index of the trained optimized dihedral angle energy prediction model.
9. The method according to claim 8, characterized in that The method further comprises at least one of the following: Based on the first evaluation indicator, optimizing the trained dihedral energy prediction model; and Based on the second evaluation indicator, the trained optimized dihedral energy prediction model is optimized.
10. A dihedral angle energy prediction method, characterized in that: The method comprises: Obtaining a dihedral angle fragment to be predicted, and generating a third representation conformation set corresponding to the dihedral angle fragment; Obtaining a third feature matrix corresponding to the third characterization conformation set; The third feature matrix is input into the dihedral angle energy prediction model obtained by the training method of the dihedral angle energy prediction model according to any one of claims 1 to 9 to obtain a third predicted energy value corresponding to the dihedral angle fragment to be predicted.
11. A training device for a dihedral energy prediction model, characterized in that: The device comprises: A fragment segmentation module is used to segment the molecular structure used for training to obtain a dihedral angle fragment set when training a dihedral angle energy prediction model; A sample generation module is used to generate a first sample subset of a dihedral angle fragment sample set based on a first fragment subset of the dihedral angle fragment set, wherein the dihedral angle fragment sample includes: a characterization conformation set and a label energy value of the characterization conformation set; wherein the characterization conformation set of the dihedral angle fragment sample and the label energy value of the characterization conformation set are determined based on the following steps: for each target dihedral angle fragment in the first fragment subset, a sample generation step is performed, including: sampling an initial conformation set corresponding to the target dihedral angle fragment, wherein the initial conformation indicates an arrangement of the target dihedral angle fragment in three-dimensional space; The dihedral angle of each initial conformation in the initial conformation set is scanned at intervals of a preset angle to obtain an extended conformation set; for the extended conformation set, while keeping the dihedral angle unchanged, local optimization of the conformation is performed with the generation of an expected number of dihedral conformations as a constraint to obtain a candidate conformation corresponding to each dihedral conformation in the expected number of dihedral conformations, and for the expected number of dihedral conformations, the candidate conformation with the lowest energy value among the candidate conformations corresponding to each dihedral conformation is used as a characterization conformation to obtain a characterization conformation set of the target dihedral fragment, and the label energy value of the characterization conformation set is recorded; A feature acquisition module, used for acquiring a first subset of a feature matrix set corresponding to the first sample subset, wherein the feature matrices in the feature matrix set correspond to the characterization conformation set of the dihedral angle fragment samples, and the features in the feature matrix correspond to the characterization conformations of the dihedral angle fragment samples; A model training module is used to adopt the dihedral energy prediction model, generate a set of first predicted energy values corresponding to the first subset of the feature matrix set according to the first subset of the feature matrix set, and generate a first loss determined based on the difference between each first predicted energy value and the corresponding label energy value, wherein the first loss is used to update the parameter value of the dihedral energy prediction model; the dihedral energy prediction model includes a self-attention module, a flattening layer, and a deep neural network module connected in sequence, and the self-attention module generates a feature matrix that implicitly represents the relationship between each conformation according to the input feature matrix.
12. A dihedral angle energy prediction device, characterized in that: The device comprises: A conformation generation module is used to obtain the dihedral angle fragment to be predicted and generate a third representation conformation set corresponding to the dihedral angle fragment; An acquisition feature module is used to acquire a third feature matrix corresponding to the third characterization conformation set; A prediction energy module is used to input the third feature matrix into the dihedral angle energy prediction model obtained by the training method of the dihedral angle energy prediction model described in any one of claims 1 to 9 to obtain a third predicted energy value corresponding to the dihedral angle fragment to be predicted.
13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the training method of the dihedral energy prediction model described in any one of claims 1 to 9 by executing the computer instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the training method for the dihedral energy prediction model described in any one of claims 1 to 9.
15. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the training method for the dihedral energy prediction model as described in any one of claims 1 to 9.
