A method for generating three-dimensional molecular conformation based on attribute importance screening and diffusion model
Patent Information
- Application Number
- CN202310967073.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-08-03
AI Technical Summary
以往的研究多专注于一维和二维的分子结构,忽略了分子三维结构的研究,导致生成分子的性能较低
[0064](1)本发明使用了机器学习领域下的决策树模型,能够得到属性特征的重要性排序,针对不同的数据集筛选出重要性程度最高的N个属性,指导生成更加具有应用价值的分子;
Smart Images

Figure CN117037948B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for generating three-dimensional molecular conformations of attribute importance screening and diffusion models, belonging to the fields of computer technology software and biomedicine. Background Technology
[0002] New drug development is extremely costly, time-consuming, and has a low success rate. Screening candidate drug molecules is a crucial early stage, and the rapid development of computer science and artificial intelligence has significantly improved the efficiency of molecule screening. Next-generation drug discovery strategies have opened up a pathway for directly designing entirely new molecules. Specifically, this involves pre-setting desired properties for new molecules, such as efficacy, for a specific disease or target. Based on the structures of existing related drug molecules, computational methods using computer simulations are used to design entirely new molecular structures, based on the principle that "similar structures are likely to have similar properties." These new molecules are then artificially synthesized using chemical synthesis methods, and their efficacy and other physicochemical properties are further tested in real chemical, biological, and human environments, thus completing the development of a new drug. This approach can significantly shorten the time for new drug development and clinical trials, and has broad application prospects.
[0003] Molecules can be represented in one, two, and three dimensions. Existing molecular generation methods generally use string representations such as SMILES (Simplified Molecular Input Line Entry Specification) and molecular fingerprints to represent one-dimensional molecules. Two-dimensional molecules are represented using graphs, with nodes representing atoms and edges representing chemical bonds. However, the most important aspect is the three-dimensional molecular structure. The three-dimensional structure of a molecule determines its biological, chemical, and physical properties. A two-dimensional molecular structure is influenced by factors such as bond lengths, bond angles, and torsion angles, which can generate a variety of three-dimensional molecules with different structures. Previous studies have focused primarily on one-dimensional and two-dimensional molecular structures, neglecting the study of three-dimensional molecular structures, resulting in lower performance in generating molecules.
[0004] Currently, the most widely used methods for generating three-dimensional molecular conformations include: (1) Traditional sampling methods: such as using existing software or Python third-party libraries like RDKit, which can only roughly optimize the calculated coordinate results using force fields and boundary matrices, and cannot obtain accurate three-dimensional molecular results. This type of method often consumes a lot of time, resulting in low efficiency and other problems. (2) Molecular generation methods based on deep generative models: such as variational autoencoders and generative adversarial networks, etc. The generation process of this type of method is unstable and relatively complex, and it is easy to accumulate errors in the process.
[0005] Meanwhile, current algorithms can only allow the model to learn the generation of 3D molecular conformations during the iterative process, lacking intervention from the incorporation of attribute knowledge. Different molecules exhibit different properties (such as water solubility and toxicity), and failing to consider prior knowledge of specific attributes will result in generated 3D molecules with poor properties in various aspects, lacking application value. Therefore, it is also difficult to obtain optimal drug molecules through algorithm design.
[0006] In the field of machine learning, decision tree algorithms can determine the importance of different features within the same dataset. It typically involves recursively selecting the optimal feature and splitting the training dataset based on that feature, resulting in the best classification for each subset. This process corresponds to the partitioning of the feature space and the construction of the decision tree. Finally, the cumulative gain of each feature can be used as the feature importance of the decision tree model, enabling the selection of the top N most important attributes under different evaluation labels as prior knowledge to guide the subsequent generation of 3D molecular conformations.
[0007] Therefore, in order to overcome the shortcomings of the above algorithms and generate three-dimensional molecules with high application value, it is necessary to use a decision tree model that combines machine learning to select the most important attributes as prior knowledge for guidance, and to use an end-to-end deep learning three-dimensional molecular conformation generation algorithm for generation. Summary of the Invention
[0008] To overcome the above-mentioned shortcomings of the prior art, this invention proposes a method for generating three-dimensional molecular conformations based on attribute feature importance screening and diffusion model.
[0009] A method for generating 3D molecular conformations based on attribute importance screening and a diffusion model mainly includes constructing an effective drug molecule dataset, designing and implementing a decision tree algorithm for screening attribute importance, designing and implementing a training phase algorithm for the diffusion generation model, designing and implementing a 3D molecular conformation generation phase algorithm, and validating the generation results. The specific steps are as follows:
[0010] S1: Constructing an effective drug molecule dataset:
[0011] S11: By selectively collecting existing molecular datasets, a molecular information database for algorithm development is established, and information about molecules in different datasets is labeled; at the same time, SAscore is used to evaluate the difficulty of molecule synthesis, and the total dataset D is obtained.
[0012] S2: Design and implement a decision tree algorithm for determining attribute importance. A decision tree is a commonly used machine learning algorithm for classifying and predicting data. Decision trees are based on a tree structure, where each internal node represents a feature or attribute, and each leaf node represents a category or outcome. The steps of the decision tree algorithm are as follows:
[0013] S21: Constructing the inputs and outputs and defining the parameters. First, we need to extract dataset D from the molecular information database, using the SAscore from the dataset as y, and the feature information after removing the SAscore as X. We then divide dataset D into a training set and a validation set. The training set is input into the decision tree algorithm for training, while the validation set prevents the model from overfitting.
[0014] S22: Training iterations of the decision tree:
[0015] S221: If the number of samples flowing to this node is less than the threshold W num If there are no more distinguishable features, then the recursion stops at that node, and the decision tree stops growing at that node.
[0016] S222: If the Gini coefficient of the sample set flowing to this node is less than the threshold W gini If all samples corresponding to this node belong to the same class, the recursion stops, and the decision tree stops growing at this point.
[0017] S223: For each feature x on this node, for each possible value a, the dataset is divided into two classes: equal to a and not equal to a. Then, the Gini coefficient is calculated according to formula (1). This node has N features, and each feature has A possible values. So, a total of N*A Gini coefficient values need to be calculated.
[0018] S224: From all these Gini coefficient values, select the feature and feature value partitioning method corresponding to the smallest value as the optimal partition for that node, and divide the dataset into two subsets;
[0019] S225: For each subset, recursively partition using the same process S223 and S224 until the conditions of S221 and S222 are met, and the decision tree is constructed.
[0020] S23: After the decision tree is constructed, the importance of each attribute feature can be calculated based on the Gini coefficient calculated during the decision tree split. The calculation formula is as follows:
[0021] importance = GI x -GI l -GI r (2)
[0022] GI x GI is the Gini coefficient of the current node. l GI is the Gini coefficient of the left node split from the current node. r This is the Gini coefficient of the right node split from the current node.
[0023] Ultimately, the importance of different molecular properties can be obtained and incorporated into the construction of two-dimensional molecular characterization in subsequent algorithms.
[0024] S3: Design and implement the training phase algorithm for the diffusion generation model:
[0025] S31: The MPNN framework is used to extract and obtain a two-dimensional structural graph representation of molecules. Since molecules in the molecular information database are represented as one-dimensional structures (SMILES), directly generating three-dimensional molecular conformations from one-dimensional molecular structures would result in the loss of most information, leading to extremely low usability of the obtained molecular conformations. Therefore, it is necessary to convert the one-dimensional molecular structure into a two-dimensional graph form to assist the diffusion model in generating three-dimensional molecular structures. This invention uses MPNN, or Message Passing Neural Network, a supervised learning framework specifically for graphs. MPNN is divided into a message passing phase and a reading phase. The message passing phase is further divided into a neighbor aggregation phase and a state update phase. For a two-dimensional molecular object G = (V, E, A), where V is the set of atoms, E is the set of bonds, and A represents the molecular attributes with the highest importance selected by S2. Here, molecular attributes can be a custom set of attributes. The formula for MPNN to aggregate neighbor information is as follows:
[0026]
[0027] h i l+1 =COMBINE(h i l ,x i l (4)
[0028]
[0029] Among them, Aggregate is an aggregation function that represents a node, its connected nodes, and edges; Combine aggregates the representations of adjacent nodes; and Readout computes the representation of an entire molecular graph.
[0030] Finally, the aggregation yields a two-dimensional structure diagram representation.
[0031] S4: Design and implement the training phase algorithm for the diffusion generation model:
[0032] S41: Three-dimensional structural characterization of molecules constructed using GFN: Considering that the reverse process must adhere to an important property of rotation and translation invariance, this invention introduces the zero-CoM concept, which can simultaneously possess rotation and translation invariance; among which, it is necessary to ensure For rotational isomorphism, and because μ θ After parameterization, the expression is as follows:
[0033]
[0034] ∈ θ For multi-layer MLP networks, the diffusion model uses ∈ θ Learning to predict the noise required to disrupt the conformation. Because ∈ θ Assuming translation and rotation are equivalent, a GFN (Graph Neighborhood Network) is used to construct a 3D structural characterization of the molecule, with the following expression:
[0035]
[0036]
[0037]
[0038] Where Φ is a multilayer MLP network, d ij Let N(i) be the distance between atoms, and N(i) be the neighboring nodes of node i. Initialize h. 0 The two-dimensional structure diagram obtained from S3 is a representation of the structure. x 0 These are the coordinates of the molecules, and θ is the parameter that needs to be optimized during the training process.
[0039] S42: The denoising diffusion probability model (DDPM) is used to destroy the structure of the three-dimensional molecule. The denoising diffusion probability model consists of a diffusion stage and a reverse generation stage. This step is the diffusion stage of the denoising diffusion probability model. This invention treats atoms as particles in a thermodynamic system, continuously adding Gaussian noise to the data to destroy the structure of the three-dimensional molecule until a standard Gaussian distribution is fitted. The formula for the diffusion process is as follows:
[0040]
[0041] in, The derivation formula is as follows:
[0042]
[0043] in, For the original three-dimensional molecular characterization, Gaussian noise is gradually added as the time step t increases, where the time step T is a known standard Gaussian distribution;
[0044] S43: Building upon S33, this involves reverse-engineering the three-dimensional molecular structure, i.e., progressive denoising, and generating and reconstructing a near-realistic sample. The reverse process is as follows, incorporating a molecular graph, i.e., a two-dimensional representation of the molecule. After T time steps, the formula generated in reverse is as follows:
[0045]
[0046] in, The derivation formula is as follows:
[0047]
[0048] S44: Model Training and Hyperparameter Optimization. After building the model, use the PyTorch framework for training. Simultaneously, the model parameters need to be defined in the configuration file to ensure successful training.
[0049] S45: Select the best-fit diffusion generation model and save it as a pt file for later use.
[0050] S5: Design and implement an algorithm for the three-dimensional conformation generation stage of molecules:
[0051] S51: Manually input and upload a txt file containing the molecular information for generating the 3D conformation. This file must include the smils sequence, structural information, and characteristic information of the molecule. The validity of the input file content is determined through regular expression matching and string matching.
[0052] S511: If the content of the txt file is valid, the model proceeds to the next step;
[0053] S512: If the content of the txt file is invalid, then return to step S41;
[0054] S52: Extract the contents of the txt file and use the MPNN framework in S3 to obtain a two-dimensional structural representation of the molecule.
[0055] S53: Retrieve the saved model pt file. The trained diffusion generative model can be represented by the initial 3D coordinate information and 2D structure diagram input. Generate specific three-dimensional molecular conformations
[0056] S54: Output and save the information of the generated three-dimensional molecular conformation;
[0057] S6: Verification of the generated results.
[0058] The properties of the candidate molecules generated by the above generative model are then tested.
[0059] 1) In this invention, the SAscore is used to evaluate the ease of molecule synthesis. The SAscore evaluates the ease of small molecule synthesis using a value ranging from 1 to 10, with values closer to 1 indicating easier synthesis and values closer to 10 indicating more difficult synthesis. The calculation weight is the fragment contribution minus the complexity: SAscore = fragmentScore - complexityPenalty. The fragment contribution value is calculated based on the commonalities of millions of molecules in the PubChem database, while the complexity considers the proportion of non-standard structural features in the molecule, such as macrocycles, merging of non-standard rings, stereoisomers, and molecular weight.
[0060] 2) In this invention, the FID (Fr'echet ChemNet Distance) reconstruction score is used to evaluate the generative properties of molecules. FID is a measure for assessing molecular structural diversity and property-level similarity, mathematically defined as:
[0061]
[0062] Among them, (m,C) and (m w C w ) represent the mean and covariance of the real molecule and the generated molecule, respectively.
[0063] The present invention has the following advantages:
[0064] (1) This invention uses a decision tree model in the field of machine learning, which can obtain the importance ranking of attribute features and select the N most important attributes for different datasets to guide the generation of molecules with more application value;
[0065] (2) The present invention incorporates molecular property characterization with high importance in both the training and generation stages, which can generate three-dimensional molecular conformations with higher quality and higher application value.
[0066] (3) The present invention uses a diffusion generation model, which can perform end-to-end training naturally without involving any complex technology, thereby avoiding the accumulation of any intermediate errors and solving the shortcomings of previous algorithms. Therefore, more accurate predictions of three-dimensional molecular conformations can be obtained. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 This is the overall flowchart of the method of the present invention;
[0069] Figure 2 This is a schematic diagram of the decision tree model splitting provided in an embodiment of the present invention;
[0070] Figure 3 This is a visual schematic diagram of the diffusion stage of the diffusion generation model provided in the embodiments of the present invention;
[0071] Figure 4 This is a visual schematic diagram of the reverse generation stage of the diffusion generation model provided in this embodiment of the invention;
[0072] Figure 5 This is a flowchart of the algorithm for the three-dimensional conformation generation stage of molecules provided in an embodiment of the present invention;
[0073] Figure 6 This is a visual diagram of a txt file provided in an embodiment of the present invention. Specific implementation methods
[0074] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0075] like Figure 1 The image shows an embodiment of the present invention, which provides a method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models, including the following steps: constructing an effective drug molecule dataset, designing and implementing a decision tree algorithm for screening attribute importance, designing and implementing a training phase algorithm for a diffusion generation model, designing and implementing a three-dimensional conformation generation phase algorithm for molecules, and verifying and applying the generation results.
[0076] S1: Constructing an effective drug molecule dataset:
[0077] Specifically, this invention uses five different datasets—QM9, GEOM-Drugs, Tox21, FreeSolv, and ESOL—to construct a molecular information database. The QM9 dataset provides the geometry, energy, electronic, and thermodynamic properties of molecules; this database contains 4.314 million stable organic molecules, each containing up to nine heavy atoms. GEOM-Drugs consists of larger drug molecules, with up to 181 atoms. This dataset also provides molecular properties, including conformational entropy, Gibbs free energy, average energy, and the number of unique conformations. The Tox21 dataset is used to measure the molecular toxicity of compounds, including toxicity information for 7831 drug molecules at 12 different target sites. The FreeSolv dataset provides calculated and experimental hydration free energies for 642 small molecules in water. The ESOL dataset contains SMILES sequences and water solubility data for 1128 drug molecules.
[0078] Specifically, the molecular properties selected in this invention are mainly divided into the following three categories: (1) quantum properties of molecules: such as coordinates, energy, partial charge, etc.; (2) physicochemical properties: such as water solubility, metabolic stability, hydrophobicity, hydration free energy, permeability, etc.; (3) biological properties: such as toxicity, side effects, etc.
[0079] By selectively collecting existing molecular datasets, a molecular information database for algorithm development is established, and the characteristic information of molecules in different datasets is labeled, such as toxicity, water solubility, geometric structure (e.g., atoms, bonds, three-dimensional coordinates), and other physical, chemical, and biological properties. At the same time, the SAscore is used to evaluate the ease of synthesis of molecules. Molecules in the molecular information database are scored using SAscore. Specifically, the score records corresponding to each molecule are sorted in descending order of SAscore from high to low, and the top 50% of the data with the highest SAscore are selected to obtain the total dataset D.
[0080] S2: Design and implement a decision tree algorithm for selecting attribute importance. Decision trees are a commonly used machine learning algorithm that can classify and predict data. Decision trees are based on a tree structure, where each internal node represents a feature or attribute, and each leaf node represents a category or outcome. (Combined with...) Figure 2 As shown, the steps of the decision tree algorithm are as follows:
[0081] S21: Constructing the inputs and outputs and defining the parameters. First, we need to extract dataset D from the molecular information database, using the SAscore from the dataset as y, and the feature information after removing the SAscore as X. We then divide dataset D into a training set and a validation set. The training set is input into the decision tree algorithm for training, while the validation set prevents the model from overfitting.
[0082] Specifically, let the molecular characteristic information be X, the number of molecular characteristic information X be N, the decision tree algorithm require a user-defined parameter W, and the Gini coefficient be selected as the splitting index, where the threshold of the Gini coefficient is W. gini The threshold for the number of samples is W. num The formula for calculating the Gini coefficient is as follows:
[0083]
[0084] Each feature has A possible values, p a This represents the proportion of samples belonging to a certain feature 'a' within the same node out of the total number of samples.
[0085] Preferably, a threshold W for the Gini coefficient is set. gini The threshold W for the number of samples is 0.01. num It is 1000.
[0086] S22: Training iterations of the decision tree:
[0087] S221: If the number of samples flowing to this node is less than the threshold W num If there are no more distinguishable features, then the recursion stops at that node, and the decision tree stops growing at that node.
[0088] S222: If the Gini coefficient of the sample set flowing to this node is less than the threshold W gini If all samples corresponding to this node belong to the same class, the recursion stops, and the decision tree stops growing at this point.
[0089] S223: For each feature x on this node, for each possible value a, the dataset is divided into two classes: equal to a and not equal to a. Then, the Gini coefficient is calculated according to formula (1). This node has N features, and each feature has A possible values. So, a total of N*A Gini coefficient values need to be calculated.
[0090] S224: From all these Gini coefficient values, select the feature and feature value partitioning method corresponding to the smallest value as the optimal partition for that node, and divide the dataset into two subsets;
[0091] S225: For each subset, recursively partition using the same process S223 and S224 until the conditions of S221 and S222 are met, and the decision tree is constructed.
[0092] S23: After the decision tree is constructed, the importance of each attribute feature can be calculated based on the Gini coefficient calculated during the decision tree split. The calculation formula is as follows:
[0093] importance = GI x-GI l -GI r (2)
[0094] GI x GI is the Gini coefficient of the current node. l GI is the Gini coefficient of the left node split from the current node. r This is the Gini coefficient of the right node split from the current node.
[0095] Ultimately, we can obtain the importance of different molecular properties, which can then be incorporated into the construction of two-dimensional molecular characterization in subsequent algorithms.
[0096] Preferably, in this embodiment, energy, water solubility, number of unique conformations, toxicity, and metabolic stability are obtained by prioritizing importance and used as attribute features to be added in subsequent steps.
[0097] S3: Design and implement the training phase algorithm for the diffusion generation model:
[0098] S31: The MPNN framework is used to extract and obtain a two-dimensional structural graph representation of molecules. Since molecules in the molecular information database are represented as one-dimensional structures (SMILES), directly generating three-dimensional molecular conformations from one-dimensional molecular structures would result in the loss of most information, leading to extremely low usability of the obtained molecular conformations. Therefore, it is necessary to convert the one-dimensional molecular structure into a two-dimensional graph form to assist the diffusion model in generating three-dimensional molecular structures. This invention uses MPNN, or Message Passing Neural Network, a supervised learning framework specifically for graphs. MPNN is divided into a message passing phase and a reading phase. The message passing phase is further divided into a neighbor aggregation phase and a state update phase. For a two-dimensional molecular object G = (V, E, A), where V is the set of atoms, E is the set of bonds, and A represents the molecular attributes with the highest importance selected by S2. Here, molecular attributes can be a custom set of attributes. The formula for MPNN to aggregate neighbor information is as follows:
[0099]
[0100] h i l+1 =COMBINE(h i l ,x i l (4)
[0101]
[0102] Specifically, Aggregate is an aggregation function that represents a node, its connected nodes, and edges. Preferably, a 3-layer MLP fully connected network is used to map the feature vectors of the input node, its neighboring nodes, and edge features to form new dimensional features. Preferably, the feature dimensions mapped by the 3 fully connected network layers are [1024, 512, 128], which avoids dimensionality explosion and retains most of the information. Then, the aggregated information of all neighbors is summed.
[0103] Combine aggregates the representations of adjacent nodes;
[0104] Readout is used to compute the representation of an entire molecular graph. Commonly used methods include Mean aggregator, Max aggregator, and LSTM aggregator. Preferably, in this embodiment, an LSTM aggregator is used, which means that the feature vectors of all nodes are input into an LSTM, the LSTM network is used to extract information, and then the output of the last time step is used as the representation of the entire graph.
[0105] S4: Design and implement the training phase algorithm for the diffusion generation model:
[0106] S41: Three-dimensional structural characterization of molecules constructed using GFN: Considering that the reverse process must adhere to an important property of rotation and translation invariance, this invention introduces the zero-CoM concept, which can simultaneously possess rotation and translation invariance; among which, it is necessary to ensure For rotational isomorphism, and because μ θ After parameterization, the expression is as follows:
[0107]
[0108] ∈ θ For multi-layer MLP networks, the diffusion model uses ∈ θ Learning to predict the noise required to disrupt the conformation. Because ∈ θ Assuming translation and rotation are equivalent, a GFN (Graph Neighborhood Network) is used to construct a 3D structural characterization of the molecule, with the following expression:
[0109]
[0110]
[0111]
[0112] Where Φ is a multilayer MLP network, d ij Let N(i) be the distance between atoms, and N(i) be the neighboring nodes of node i. Initialize h. 0 The two-dimensional structure diagram obtained from S3 is a representation of the structure. x0 These are the coordinates of the molecules, and θ is the parameter that needs to be optimized during the training process.
[0113] S42: The denoising diffusion probability model (DDPM) is used to disrupt the structure of three-dimensional molecules. The denoising diffusion probability model consists of a diffusion stage and a reverse generation stage. For example... Figure 3 As shown, step S33 uses the diffusion stage of the denoising diffusion probability model. This invention treats atoms as particles in a thermodynamic system, continuously adding Gaussian noise to the data to disrupt the structure of the three-dimensional molecules until a standard Gaussian distribution is fitted. The formula for the diffusion process is as follows:
[0114]
[0115] in, The derivation formula is as follows:
[0116]
[0117] in, For the original three-dimensional molecular characterization, Gaussian noise is gradually added as the time step t increases, where the time step T is a known standard Gaussian distribution;
[0118] S43: Based on S33, it achieves reverse generation of three-dimensional molecular structures, i.e., progressive denoising, and generates and restores near-realistic samples. For example... Figure 4 As shown, the reverse process is as follows: during the reverse process, a molecular graph, i.e., a two-dimensional representation of the molecule, is added. After T time steps, the formula generated in reverse is as follows:
[0119]
[0120] in, The derivation formula is as follows:
[0121]
[0122] S44: Model Training and Hyperparameter Optimization. After building the model, use the PyTorch framework for training. Simultaneously, you need to define the hyperparameters in the model's configuration file to ensure successful training.
[0123] Specifically, to improve the model's fitting ability, it is necessary to continuously reduce the true value Y during the training process. label Compared with the predicted value Y pred The difference. The loss function is used to measure the true value Y. label Compared with the predicted value Y predThe difference can be indirectly optimized by continuously reducing the value of the loss function. Since a denoising diffusion probability model is used, directly optimizing the log-likelihood is difficult. Preferably, this invention uses ELBO (maximizing the variational lower bound) as the loss function, with the following formula:
[0124]
[0125]
[0126]
[0127] Where α = 1 - β, It is the cumulative product of all previous α values, therefore only β needs to be initialized during training. start β end By finding the value of T and continuously optimizing the fit of the diffusion model during training, the goal of optimizing the hyperparameter θ of the entire model can be achieved.
[0128] Preferably, initialize β start β end The values of T are 0.00001, 0.01, and 3000, respectively.
[0129] S45: Preferably, select the best-fit diffusion generation model and save it as a pt file for later use.
[0130] S5: Design and implement the algorithm for the three-dimensional conformation generation stage of molecules. The specific flowchart is as follows: Figure 5 As shown
[0131] S51: Manually input and upload the molecular information (txt file) of the three-dimensional conformation to be generated, such as... Figure 6 As shown, the input file content needs to include the smiles sequence, structural information, and characteristic information of the molecule. Regular expression matching and string matching are used to determine the validity of the input file content.
[0132] S511: If the content of the txt file is valid, the model proceeds to the next step;
[0133] S512: If the content of the txt file is invalid, then return to step S41;
[0134] S52: Extract the contents of the txt file and characterize the molecular two-dimensional structure using the MPNN framework of S3.
[0135] S53: Retrieve the saved model pt file. The trained diffusion generative model can be represented by the initial 3D coordinate information and 2D structure diagram input. Generate specific three-dimensional molecular conformations Then, iterative optimization is performed in reverse to finally generate a three-dimensional molecular conformation.
[0136] S54: Output and save the information of the generated three-dimensional molecular conformation;
[0137] S6: Verification of the generated results:
[0138] The properties of the candidate molecules generated by the above generative model are then tested.
[0139] 1) In this invention, the SAscore is used to evaluate the ease of molecule synthesis. The SAscore evaluates the ease of small molecule synthesis using a value ranging from 1 to 10, with values closer to 1 indicating easier synthesis and values closer to 10 indicating more difficult synthesis. The calculation weight is the fragment contribution minus the complexity: SAscore = fragmentScore - complexityPenalty. The fragment contribution value is calculated based on the commonalities of millions of molecules in the PubChem database, while the complexity considers the proportion of non-standard structural features in the molecule, such as macrocycles, merging of non-standard rings, stereoisomers, and molecular weight.
[0140] 2) This invention uses the FID (Fr'echet ChemNet Distance) reconstruction score to evaluate the generative properties of molecules. FID is a measure of molecular structural diversity and property-level similarity. Evaluating the generative properties of molecules using FID can measure the difference between their actual molecular properties and those of the true molecules. Mathematically, it is defined as:
[0141]
[0142] Among them, (m,C) and (m w C w ) represent the mean and covariance of the real molecule and the generated molecule, respectively.
[0143] Preferably, three-dimensional molecular conformations that perform well on SAscore and FID are selected and stored in the molecular information database.
[0144] The embodiments described in this specification are merely examples of implementations of the inventive concept. The scope of protection of this invention should not be considered as limited to the specific forms stated in the embodiments. The scope of protection of this invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A method for generating three-dimensional molecular conformations based on attribute importance screening and a diffusion model, which generates three-dimensional molecules based on a decision tree algorithm and a diffusion generation model, comprising: The process includes the following steps: constructing an effective molecular dataset; designing and implementing a decision tree algorithm for selecting attribute importance; designing and implementing an MPNN algorithm for generating two-dimensional molecular conformations; designing and implementing a training phase algorithm for a diffusion generation model; designing and implementing a three-dimensional molecular conformation generation phase algorithm; and validating the generation results. Step 1: By selectively collecting existing molecular datasets, a molecular information database for algorithm development is established, and information about molecules in different datasets is labeled; at the same time, SAscore is used to evaluate the difficulty of molecule synthesis, and the total dataset D is obtained. Step 2: Design and implement a decision tree algorithm for selecting attribute importance. The decision tree is based on a tree structure, where each internal node represents a feature or attribute, and each leaf node represents a category or outcome. The decision tree algorithm includes the following steps: S21: Construct inputs and outputs and define parameters; First, it is necessary to extract dataset D from the molecular information database, take the SAscore in the dataset as y, remove the feature information of SAscore as X, divide dataset D into training set and validation set, input the training set into decision tree algorithm for training, and use the validation set to prevent the model from overfitting. S22: The training iteration process of a decision tree includes the following steps: S221: If the number of samples flowing to this node is less than the threshold W num If there are no more distinguishable features, then the recursion at that node stops, and the decision tree stops growing at that node. S222: If the Gini coefficient of the sample set flowing to this node is less than the threshold W gini If all samples corresponding to this node belong to the same class, the recursion stops, and the decision tree stops growing at this point. S223: For each feature c on this node, for each possible value a, the dataset is divided into two classes: equal to a and not equal to a. Then, the Gini coefficient is calculated according to the above formula. This node has N features, and each feature has S possible values. Therefore, a total of N*A Gini coefficient values need to be calculated. S224: From all these Gini coefficient values, select the feature and feature value partitioning method corresponding to the smallest value as the optimal partition for that node, and divide the dataset into two subsets; S225: For each subset, recursively partition using the same process S223 and S224 until the conditions of S221 and S222 are met, and the decision tree is constructed. S23: After the decision tree is constructed, the importance of each attribute feature can be calculated based on the evaluation index of each attribute feature when splitting the decision tree; finally, the importance of different molecular attributes can be obtained and added to the construction of two-dimensional molecular representation in subsequent algorithms. Step 3: Design and implement the training phase algorithm for the diffusion generation model. The steps are as follows: S31: The MPNN framework is used to extract and obtain a two-dimensional structural graph representation of molecules. Since the molecules in the molecular information database are represented in the form of one-dimensional molecular structures (SMILES), directly generating three-dimensional molecular conformations from one-dimensional molecular structures would result in the loss of most information, leading to extremely low usability of the obtained molecular conformations. Therefore, it is necessary to convert the one-dimensional molecular structure into a two-dimensional graph form to assist the diffusion model in generating three-dimensional molecular structures. MPNN, or Message Passing Neural Network, is a supervised learning framework specifically designed for graphs. MPNN consists of a message passing phase and a reading phase. The message passing phase is further divided into a neighbor aggregation phase and a state update phase. For a two-dimensional molecular object G = (V, E, A), where V is the set of atoms, E is the set of bonds, and A represents the molecular attributes with the highest importance selected by S2. Here, the molecular attributes are a user-defined set of attributes. The formula for MPNN to aggregate neighbor information is as follows: h i l+1 =COMBINE(h i l ,x i l ) (4) Aggregate is an aggregation function that represents a node, its connected nodes, and edges; Combine aggregates the representations of adjacent nodes; Readout computes the representation of an entire molecular graph. Finally, the aggregation yields a two-dimensional structure diagram representation. Step 4: Design and implement the training phase algorithm for the diffusion generation model: S41: Three-dimensional structural characterization of molecules constructed using GFN: Considering that the reverse process must adhere to an important property of rotation and translation invariance, the zero-CoM concept was introduced, which can simultaneously possess rotation and translation invariance; among which, it is necessary to ensure For rotational isomorphism, and because μ θ After parameterization, the expression is as follows: ∈ θ For multi-layer MLP networks, the diffusion model uses ∈ θ Learning to predict the noise required to disrupt the conformation; due to ∈ θ Assuming translation and rotation are equivalent, a GFN (Graph Neighborhood Network) is used to construct a 3D structural characterization of the molecule, with the following expression: Where Φ is a multilayer MLP network, d ij Let N(i) be the distance between atoms, and N(i) be the neighboring nodes of node i; initialize h. 0 The two-dimensional structure diagram obtained from S3 is a representation of the structure. x 0 These are the coordinates of the molecules, and θ is the parameter that needs to be optimized during the training process. S42: Two-dimensional molecule generation is performed using the denoised diffusion probability model (DDPM). The denoised diffusion probability model consists of a diffusion stage and a reverse generation stage. This step is the diffusion stage of the denoised diffusion probability model. Atoms are treated as particles in a thermodynamic system. Gaussian noise is continuously added to the data to disrupt the structure of the three-dimensional molecule until a standard Gaussian distribution is fitted. The formula for the diffusion process is as follows: in, The derivation formula is as follows: in, For the original three-dimensional molecular characterization, Gaussian noise is gradually added as the time step t increases, where the time step T is a known standard Gaussian distribution; S43: Building upon S33, this involves reverse-engineering a three-dimensional molecular structure, i.e., progressive denoising, to generate a near-realistic sample. The reverse process is as follows: a molecular graph, i.e., a two-dimensional representation of the molecule, is incorporated during the reverse process. After T time steps, the formula generated in reverse is as follows: in, The derivation formula is as follows: S44: Model Training and Hyperparameter Optimization; After building the model, use the PyTorch framework to train it; at the same time, you also need to define the hyperparameters in the model in the configuration file to ensure that the training can proceed. To improve the model's fitting ability, the true value Y must be continuously reduced during training. label Compared with the predicted value Y pred The gap; using a loss function to measure the true value Y label Compared with the predicted value Y pred The difference can be indirectly optimized by continuously reducing the value of the loss function. Since a denoising diffusion probability model is used, directly optimizing the log-likelihood is difficult. Therefore, ELBO, which maximizes the variational lower bound, is used as the loss function, and its formula is as follows: Where α = 1 - β, It is the cumulative product of all previous α values, therefore only β needs to be initialized during training. start β end By finding the value of T and continuously optimizing the fit of the diffusion model during training, the goal of optimizing the hyperparameters of the entire model can be achieved. S45: Select the best-fit diffusion generation model and save it as a pt file for later use; Step 5: Design and implement the algorithm for the three-dimensional conformation generation stage of molecules: S51: Manually input and upload the molecular information txt file to be used to generate the three-dimensional conformation. The file must include the molecular SMILES sequence, molecular structural information, and molecular characteristic information. The validity of the input file content is determined by regular expression matching and string matching. S511: If the content of the txt file is valid, the model proceeds to the next step; S512: If the content of the txt file is invalid, then proceed to step S41; S52: Use the MPNN framework to extract the contents of a txt file and obtain a two-dimensional structural representation of the molecule. S53: Retrieve the saved model pt file. The trained diffusion generative model can be represented by the initial 3D coordinate information and 2D structure diagram input. Generate specific three-dimensional molecular conformations Then, iterative optimization is performed in reverse to finally generate a three-dimensional molecular conformation. S54: Output and save the information of the generated three-dimensional molecular conformation; Step 6, Verification of the generated results: The properties of the candidate molecules generated by the above generative model are then tested. Through the above steps, the generation of three-dimensional molecular conformations based on attribute importance screening and diffusion models can be achieved.
2. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, The molecular information in step 1 includes molecular property information, specifically including: toxicity, water solubility, and geometric structure, which includes atoms, bonds, and three-dimensional coordinates.
3. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, In step 2, the decision tree selects the Gini coefficient as the splitting criterion, and the threshold W of the Gini coefficient in step 2 is... gini The threshold W for the number of samples is 0.
01. num The Gini coefficient is set to 1000, and the formula for calculating it is as follows:
4. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, In step 3, a 3-layer MLP fully connected network is used as the aggregation function. The feature dimensions mapped by the 3 fully connected network layers are [1024, 512, 128].
5. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, In step 3, LSTM is used as the readout function to input the feature vectors of all nodes into the LSTM, and the LSTM network is used to extract information. Then, the output of the last time step is used as the representation of the whole image.
6. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, In step S41, the official Python RDKit library is used to convert the SMILES format plus the geometric structure information in the information library into a three-dimensional structural characterization of the molecule, and the MMFF94 force field and default parameters are used to optimize the three-dimensional structural characterization.
7. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, In step S44, the initialization parameters are respectively the initialization of β. start β end The values of T are 0.00001, 0.01, and 3000, respectively.
8. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, In step S53, the official Python RDKit library is used to convert the SMILES format plus the geometric structure information in the information library into a three-dimensional structural characterization of the molecule, and the MMFF94 force field and default parameters are used to optimize the three-dimensional structural characterization.
9. The method for generating three-dimensional molecular conformations based on attribute importance screening and diffusion models as described in claim 1, characterized in that, The evaluation metrics used in step 6 are SAscore and FID.