Method and system for realizing automatic expansion of chemical molecular structure data
Patent Information
- Application Number
- CN202410176827.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-02-08
AI Technical Summary
由于SMILES表达式的构造方式具有一定的灵活性,对于同一个分子结构,可以有多种不同的SMILES表达式来表示,因此现有技术是采用随机遍历分子结构图,以得到不同的分子结构原子组成顺序,然后使用SMILES来描述这个分子的不同原子组成顺序,得到随机排列的但又表达同一个分子的SMILES字符串,从而实现化学分子结构数据的扩增;这种通过随机遍历方式得到的SMILES字符串数据是随机排布的,以致造成字符串中的字符顺序和字符组合凌乱,无法体现分子结构特征,不利于人工智能模型提取数据中的特征块,从而大大降低了扩增数据的利用效果,进而也影响了人工智能模型的性能
[0038]This invention not only enables amplified chemical molecular structure data to possess clear structural features, but also ensures that the character order and character groups in the resulting SMILES strings are orderly, avoiding the defect of easily losing the feature structure of amplified data due to the disordered character order and character groups in the SMILES strings caused by random traversal amplification methods. This effectively improves the performance of chemical artificial intelligence models and enables more convenient, faster, and more efficient automatic amplification of chemical molecular structure data, serving as the basis for subsequent data feature extraction. It promotes the progress of big data research in chemical science and can be used to construct training datasets for models such as chemical structure-activity relationships, machine learning, and neural networks, or directly for the development of generative large language models based on chemical structures. Therefore, it has significant application value in the field of chemical artificial intelligence research.
Smart Images

Figure CN117976095B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for automatically amplifying chemical molecular structure data, belonging to the field of computer information processing technology. Background Technology
[0002] Chemical molecular structure data describes the molecular structure of chemical substances. Molecular structure refers to the atomic composition, arrangement, and connections of a molecule. It significantly influences the reactivity, polarity, phase state, color, magnetism, and biological activity of chemical substances, making it a crucial fundamental research object in chemical science. Chemical molecular structure data can generally be obtained through experimental determination or calculation and is essential for understanding the properties and behavior of chemical substances. Chemical databases typically store vast amounts of chemical molecular structure data for retrieval and analysis; this data also serves as a foundational resource for chemical artificial intelligence.
[0003] Currently, one method for acquiring large amounts of chemical molecular structure data is data augmentation. Data augmentation increases the quantity and quality of training data, improving the performance and generalization ability of artificial intelligence models, thus enabling better application in the analysis and processing of chemical structure data. In chemical molecular structure data, data augmentation can be achieved in the following ways: increasing the sample size by collecting more chemical substance molecular structure data; and transforming the data to generate new data samples, such as through rotation, translation, and scaling, to increase data diversity. Because in practical applications, chemical molecular structure data often corresponds to property data obtained through experiments, such as toxicity and biological activity, collecting more chemical substance molecular structure data requires significant resources; therefore, data augmentation is typically achieved through data transformation.
[0004] SMILES (Simplified Molecular Input Line Entry System) is a specification for explicitly describing molecular structures using ASCII strings. Because SMILES expressions are flexible in their construction, multiple different SMILES expressions can represent the same molecular structure. Therefore, current techniques involve randomly traversing the molecular structure diagram to obtain different atomic sequences, then using SMILES to describe these different atomic sequences, resulting in randomly arranged SMILES strings that represent the same molecule, thus amplifying chemical molecular structure data. However, this random traversal method results in randomly arranged SMILES strings, leading to disordered character order and combinations, failing to reflect molecular structural features, hindering the extraction of feature blocks by artificial intelligence models, significantly reducing the effectiveness of the amplified data, and consequently affecting the performance of AI models. Therefore, there is an urgent need in this field to develop a technique that enables the amplified chemical molecular structure data to have explicit structural features and ensures that the character order and combinations in the resulting SMILES strings are orderly, thereby providing strong support for chemical artificial intelligence research. Summary of the Invention
[0005] To address the aforementioned problems and needs of existing technologies, the purpose of this invention is to provide a method and system for automatically amplifying chemical molecular structure data, enabling the amplified chemical molecular structure data to have clear structural features and ensuring that the character order and character groups in the obtained SMILES string are orderly, thereby providing strong support for chemical artificial intelligence research.
[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0007] A method for automatically amplifying chemical molecular structure data includes the following steps:
[0008] S1) Use the “MolFromSmiles” function in the RDKit tool to read the SMILES data of the input chemical molecular structure;
[0009] S2) Use the "GetScaffoldForMol" function in the RDKit tool to identify the feature structures in the read chemical molecule structure and output the type of feature structure and the SMILES data of the feature structure;
[0010] S3) Use the “MolFromSmiles” function in the RDKit tool to read the SMILES data of the input chemical molecular structure and the SMILES data of the feature structure respectively, and obtain the chemical molecular structure and feature structure;
[0011] S4) Use the "GetNumAtoms" function in the RDKit tool to create a list of atom numbers for chemical molecular structures, and use the "GetSubstructMatches" function in the RDKit tool to create a list of atom numbers for characteristic structures;
[0012] S5) Compare the numbers in the atomic number list of the chemical molecular structure obtained in step S4) with the atomic number list of the characteristic structure, and form a new list of numbers that do not appear in the atomic number list of the characteristic structure as the atomic number list outside the characteristic structure.
[0013] S6) Randomly shuffle the order of the atomic numbers in the atomic number list other than the feature structure, and then combine it with the atomic number list of the feature structure obtained in step S4) to obtain the atomic number list of the chemical molecular structure aligned with the feature structure.
[0014] S7) Use the “RenumberAtoms” function in the RDKit tool to rearrange the atoms in the chemical molecular structure according to the list of atom numbers of the chemical molecular structure aligned with the feature structure obtained in step S6) to obtain the chemical molecular structure aligned with the feature structure.
[0015] S8) Use the “MolToSmiles” function in the RDKit tool to calculate the SMILES data of the chemical molecular structure aligned with the feature structure obtained in step S7), and store it in the amplification results list.
[0016] S9) Repeat steps S6) to S8) until the maximum number of attempts or the data amplification fold threshold set by the user is reached, and then output the amplified data of the chemical molecular structure.
[0017] In one implementation scheme, if the result of step S1) is empty or an error occurs, the system prompts "The data of the input chemical molecular structure is incorrect" and outputs that the amplification data of the chemical molecular structure is empty.
[0018] In one implementation scheme, the identification in step S2) includes the following specific steps:
[0019] S21) Use the "GetScaffoldForMol" function in the RDKit tool to calculate the skeleton structure in the read chemical molecule structure. If the function returns a result, use the "MolToSmiles" function in the RDKit tool to calculate the SMILES data of the skeleton structure in the returned result, and output the feature structure as "skeleton structure" and the SMILES data of the skeleton structure; if the function returns empty, proceed to step S22).
[0020] S22) Use the regular expression "\([^)*\)]" to delete the parentheses "()" and the characters within the parentheses in the SMILES data of the input chemical molecular structure, and obtain the SMILES data of the main chain structure in the read chemical molecular structure. If the number of characters in the SMILES data of the main chain structure is greater than 3 and less than the number of characters in the SMILES data of the input chemical molecular structure, then the output feature structure type is "main chain structure" and the SMILES data of the main chain structure.
[0021] In one implementation, step S4) involves creating the list of atomic numbers for the chemical molecular structure by using the "GetNumAtoms" function of the RDKit tool to calculate the total number of atoms in the read chemical molecular structure, and then creating a sequential number list from 0 to the total number of atoms minus one based on the obtained total number of atoms.
[0022] In one implementation, step S6) uses the "random.shuffle" function in the Python programming language to randomly shuffle the order of the atom numbers in the atom number list other than the feature structure.
[0023] In a preferred embodiment, before storing the obtained SMILES data of chemical molecular structures aligned with the characteristic structures into the amplification result list in step S8), the SMILES data to be stored is checked to see if it already exists in the amplification result list. If it already exists, it is discarded and not stored.
[0024] In one implementation, if the number of characters in the SMILES data of the main chain structure obtained in step S22) is less than or equal to 3 or equal to the number of characters in the SMILES data of the input chemical molecular structure, then data amplification is performed according to the following steps:
[0025] a) Use the “MolToSmiles” function in the RDKit tool to randomly generate SMILES data based on the SMILES data of the input chemical molecular structure and the “doRandom=True” parameter, and store the obtained SMILES data in the amplification results list.
[0026] b) Repeat step a) until the user-defined maximum number of attempts or data amplification fold threshold is reached, and then output the amplified data of the chemical molecular structure.
[0027] In a preferred embodiment, before storing the obtained SMILES data into the amplification result list in step a), check whether the SMILES data to be stored already exists in the amplification result list. If it already exists, discard it and do not store it.
[0028] A system for automatically amplifying chemical molecular structure data, comprising:
[0029] Input module for inputting SMILES data of chemical molecular structures;
[0030] The identification module is used to identify the characteristic structures of the read-in chemical molecules and obtain characteristic structure data.
[0031] Alignment module for creating a list of atom numbers for chemical molecular structures that are aligned to obtain characteristic structures;
[0032] An amplification module for expanding and storing SMILES data of chemical molecular structures aligned with characteristic structures;
[0033] Output module for outputting amplified data of chemical molecular structures.
[0034] In addition, the present invention also provides a storage medium storing one or more computer programs including execution instructions, which can be read and executed by electronic devices (including but not limited to computers, servers, or network devices) to realize the method for automatically amplifying chemical molecular structure data described above.
[0035] The present invention also provides an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores program instructions executable by the at least one processor, the program instructions being executed by the at least one processor to enable the at least one processor to perform the method described above for automatically amplifying chemical molecular structure data according to the present invention.
[0036] The present invention also provides a computer program product, including a computer program stored on a storage medium, the computer program including program instructions, which, when executed by a computer, can realize the method described above for automatically amplifying chemical molecular structure data.
[0037] Compared with the prior art, the beneficial technical effects of the present invention are as follows:
[0038] This invention not only enables amplified chemical molecular structure data to possess clear structural features, but also ensures that the character order and character groups in the resulting SMILES strings are orderly, avoiding the defect of easily losing the feature structure of amplified data due to the disordered character order and character groups in the SMILES strings caused by random traversal amplification methods. This effectively improves the performance of chemical artificial intelligence models and enables more convenient, faster, and more efficient automatic amplification of chemical molecular structure data, serving as the basis for subsequent data feature extraction. It promotes the progress of big data research in chemical science and can be used to construct training datasets for models such as chemical structure-activity relationships, machine learning, and neural networks, or directly for the development of generative large language models based on chemical structures. Therefore, it has significant application value in the field of chemical artificial intelligence research. Attached Figure Description
[0039] Figure 1 The diagram shown is a flowchart of a method for automatically amplifying chemical molecular structure data provided by the present invention.
[0040] Figure 2 The diagram shown is a system block diagram for automatically amplifying chemical molecular structure data provided by the present invention. Detailed Implementation
[0041] The technical solution of the present invention will be further described in detail and completely below with reference to the embodiments and accompanying drawings.
[0042] Example
[0043] This embodiment uses the chemical molecular structure data of abscisic acid as an example to illustrate in detail how the present invention achieves automatic amplification of chemical molecular structure data.
[0044] Figure 1 The diagram shown is a flowchart of the method for automatically amplifying chemical molecular structure data according to the present invention. Figure 1 As shown, the method for automatically amplifying chemical molecular structure data according to the present invention includes the following steps:
[0045] S1) Use the "MolFromSmiles" function in the RDKit tool to read the SMILES data of the input chemical molecular structure; for example, in this implementation, the SMILES data of the input abscisic acid chemical molecular structure is read as "CC(C=CC1(O)C(C)=CC(=O)CC1(C)C)=CC(=O)O", and the reading result is successful without error.
[0046] S2) Use the "GetScaffoldForMol" function in the RDKit tool to identify the feature structures in the read chemical molecule structure and output the type of the feature structure and the SMILES data of the feature structure; the specific identification steps are as follows:
[0047] S21) Use the "GetScaffoldForMol" function in the RDKit tool to calculate the skeleton structure in the read chemical molecule structure. If the function returns a result, use the "MolToSmiles" function in the RDKit tool to calculate the SMILES data of the skeleton structure in the returned result, and output the feature structure as "skeleton structure" and the SMILES data of the skeleton structure; if the function returns empty, proceed to step S22).
[0048] S22) Use the regular expression "\([^)*\)]" to delete the parentheses "()" and the characters in the parentheses in the SMILES data of the input chemical molecular structure, and obtain the SMILES data of the main chain structure in the read chemical molecular structure. If the number of characters in the SMILES data of the main chain structure is greater than 3 and less than the number of characters in the SMILES data of the input chemical molecular structure, then the type of the output feature structure is "main chain structure" and the SMILES data of the main chain structure.
[0049] In this embodiment, the “GetScaffoldForMol” function in the RDKit tool is used to calculate the backbone structure in the read abscisic acid molecule structure. The function returns a result, so the “MolToSmiles” function in the RDKit tool is used to calculate the SMILES data of the backbone structure in the returned result, and the type of the feature structure is “backbone structure” and the SMILES data of the backbone structure is “O=C1C=CCCC1”.
[0050] S3) Use the “MolFromSmiles” function in the RDKit tool to read the SMILES data of the input chemical molecular structure and the SMILES data of the feature structure respectively, and obtain the chemical molecular structure and feature structure;
[0051] S4) Use the "GetNumAtoms" function in the RDKit tool to create a list of atomic numbers for the chemical molecular structure (specifically, use the "GetNumAtoms" function in the RDKit tool to calculate the total number of atoms in the read chemical molecular structure, and create a sequential list of numbers from 0 to the total number of atoms minus one based on the obtained total number of atoms), and use the "GetSubstructMatches" function in the RDKit tool to create a list of atomic numbers for the feature structure.
[0052] In this embodiment, the "GetNumAtoms" function of the RDKit tool is used to calculate that the number of atoms in the read abscisic acid molecule structure is 19. Based on the obtained number of atoms, a list of numbers from 0 to the number of atoms minus one is created to obtain the atom number list of the chemical molecule structure as: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; and the "GetSubstructMatches" function of the RDKit tool is used to calculate that the atom number list of the skeleton structure is: [10,9,8,6,4,12,11];
[0053] S5) Compare the numbers in the atom number list of the chemical molecular structure obtained in step S4) with the numbers in the atom number list of the characteristic structure, and form a new list of numbers that do not appear in the atom number list of the characteristic structure as the atom number list outside the characteristic structure; after comparison, the atom number list outside the characteristic structure obtained in this embodiment is: [0,1,2,3,5,7,13,14,15,16,17,18];
[0054] S6) Randomly shuffle the atomic numbers in the atomic numbering list outside the feature structure, and then combine it with the atomic numbering list of the feature structure obtained in step S4) to obtain the atomic numbering list of the chemical molecular structure aligned with the feature structure; for example: assuming that this embodiment uses the "random.shuffle" function in the programming language Python to randomly shuffle the atomic numbering list outside the feature structure, we get: [3,0,1,16,14,13,5,2,7,15,18,17]; then combine it with the atomic numbering list of the skeleton structure [10,9,8,6,4,12,11] obtained in step S4) to obtain the atomic numbering list of the chemical molecular structure aligned with the feature structure as: [10,9,8,6,4,12,11,3,0,1,16,14,13,5,2,7,15,18,17];
[0055] S7) Use the “RenumberAtoms” function in the RDKit tool to rearrange the atoms in the chemical molecular structure according to the list of atom numbers of the chemical molecular structure aligned with the feature structure obtained in step S6) to obtain the chemical molecular structure aligned with the feature structure.
[0056] S8) Use the "MolToSmiles" function in the RDKit tool to calculate the SMILES data of the feature-aligned chemical molecular structure based on the feature-aligned chemical molecular structure obtained in step S7), and store it in the amplification result list; as a preferred option, before storing the obtained feature-aligned chemical molecular structure SMILES data in the amplification result list, check whether the SMILES data to be stored already exists in the amplification result list. If it already exists, discard it and do not store it.
[0057] S9) Repeat steps S6) to S8) until the maximum number of attempts threshold set by the user (assuming it is set to "10" in this embodiment) or the data amplification factor threshold (assuming it is set to "5" in this embodiment) is reached, and then the amplified data of the chemical molecular structure is output.
[0058] Assuming that steps S6) to S8) are repeated in this embodiment, the specific results are as follows:
[0059] The number of attempts was 1, and the SMILES data obtained was:
[0060] “O=C1C=C(C)C(C=CC(=CC(=O)O)C)(O)C(C)(C)C1”, the amplification result list is empty. Add this SMILES data to the amplification result list and change the number of amplification result lists to 1.
[0061] The number of attempts was 2, and the SMILES data obtained was:
[0062] “O=C1C=C(C)C(C=CC(=CC(O)=O)C)(O)C(C)(C)C1”, upon inspection, it was found that this SMILES data does not exist in the amplification result list. Therefore, this SMILES data is added to the amplification result list, and the number of amplification result lists is changed to 2.
[0063] After 3 attempts, the following SMILES data was obtained:
[0064] “O=C1C=C(C)C(C=CC(C)=CC(=O)O)(O)C(C)(C)C1”, it was found that this SMILES data did not exist in the amplification result list. Therefore, this SMILES data was added to the amplification result list and the number of amplification result lists was changed to 3.
[0065] After 4 attempts, the following SMILES data was obtained:
[0066] “O=C1C=C(C)C(C=CC(C)=CC(O)=O)(O)C(C)(C)C1”, it was found that this SMILES data did not exist in the amplification result list. Therefore, this SMILES data was added to the amplification result list and the number of amplification result lists was changed to 4.
[0067] After 5 attempts, the following SMILES data was obtained:
[0068] “O=C1C=C(C)C(C=CC(C)=CC(O)=O)(O)C(C)(C)C1”, upon inspection, it was found that this SMILES data already existed in the amplification result list, so this SMILES data was discarded and not stored in the amplification result list, and the number of amplification result lists remained 4;
[0069] After 6 attempts, the following SMILES data was obtained:
[0070] The query "O=C1C=C(C)C(O)(C=CC(=CC(=O)O)C)C(C)(C)C1" indicates that the SMILES data is not present in the amplification result list. Therefore, this SMILES data is added to the amplification result list, and the number of amplification result lists is increased to 5. Since the user-defined data amplification fold threshold of "5" has been reached, steps S6) to S8) are stopped from being repeated. The 5-fold amplification data of the abscisic acid molecular structure is then output as follows:
[0071] O=C1C=C(C)C(C=CC(=CC(=O)O)C)(O)C(C)(C)C1
[0072] O=C1C=C(C)C(C=CC(=CC(O)=O)C)(O)C(C)(C)C1
[0073] O=C1C=C(C)C(C=CC(C)=CC(=O)O)(O)C(C)(C)C1
[0074] O=C1C=C(C)C(C=CC(C)=CC(O)=O)(O)C(C)(C)C1
[0075] O=C1C=C(C)C(O)(C=CC(=CC(=O)O)C)C(C)(C)C1.
[0076] The results of amplifying the chemical molecular structure data of abscisic acid by 5 times using the random traversal method are as follows:
[0077] C1(=CC(CC(C)(C)C1(C=CC(=CC(=O)O)C)O)=O)C
[0078] CC1C(O)(C(CC(=O)C=1)(C)C)C=CC(C)=CC(O)=O
[0079] C(C=CC1(O)C(C)=CC(CC1(C)C)=O)(=CC(O)=O)C
[0080] CC1=CC(=O)CC(C1(C=CC(C)=CC(O)=O)O)(C)C
[0081] C1(C(C)(C)CC(=O)C=C1C)(O)C=CC(C)=CC(O)=O.
[0082] As can be seen from the above, the random traversal amplification method suffers from the defect of disordered character order and character combination in the SMILES string. However, the method described in this invention not only enables the amplified chemical molecular structure data to have clear structural features and the character order and character combination in the obtained SMILES string to be orderly, but also enables more convenient, faster, and more efficient automatic amplification of chemical molecular structure data. This can significantly promote the progress of big data research in chemical science and the construction of training datasets for models such as chemical structure-activity relationships, machine learning, and neural networks, or be directly used for the development of generative large language models based on chemical structures. It has important application value in the field of chemical artificial intelligence research.
[0083] Additionally, it should be noted that:
[0084] If the number of characters in the SMILES data of the main chain structure obtained in step S22) is less than or equal to 3 or equal to the number of characters in the SMILES data of the input chemical molecular structure, then data amplification is performed according to the following steps:
[0085] a) Use the “MolToSmiles” function in the RDKit tool to randomly generate SMILES data based on the SMILES data of the input chemical molecular structure and the “doRandom=True” parameter, and store the obtained SMILES data in the amplification results list.
[0086] b) Repeat step a) until the user-defined maximum number of attempts or data amplification fold threshold is reached, and then output the amplified data of the chemical molecular structure.
[0087] As a preferred option, before storing the obtained SMILES data into the amplification result list in step a), check whether the SMILES data to be stored already exists in the amplification result list. If it already exists, discard it and do not store it.
[0088] Figure 2The diagram shown is a system block diagram for automatically amplifying chemical molecular structure data provided by the present invention. Figure 2 As can be seen, the system for automatically amplifying chemical molecular structure data according to the present invention includes:
[0089] Input module for inputting SMILES data of chemical molecular structures;
[0090] The identification module is used to identify the characteristic structures of the read-in chemical molecules and obtain characteristic structure data.
[0091] Alignment module for creating a list of atom numbers for chemical molecular structures that are aligned to obtain characteristic structures;
[0092] An amplification module for expanding and storing SMILES data of chemical molecular structures aligned with characteristic structures;
[0093] Output module for outputting amplified data of chemical molecular structures.
[0094] The aforementioned functional modules generally include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. Each module can exist physically separately, or two or more can be integrated into one module. The modules can be implemented in hardware or as software functional modules. If the physical or integrated modules are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium.
[0095] The present invention also provides a storage medium storing one or more programs including execution instructions, which can be read and executed by electronic devices (including but not limited to computers, servers, or network devices) to perform the method described above for automatically amplifying chemical molecular structure data.
[0096] The present invention also provides an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores program instructions executable by the at least one processor, the program instructions being executed by the at least one processor to enable the at least one processor to perform the method described above for automatically amplifying chemical molecular structure data according to the present invention.
[0097] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the system for automatically amplifying chemical molecular structure data. Furthermore, the memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the system for automatically amplifying chemical molecular structure data via a network. The network includes, but is not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0098] The electronic device can exist in various forms, including but not limited to:
[0099] (1) Mobile communication devices: These devices are characterized by having mobile communication functions and are primarily designed to provide voice and data communication. These terminals include: smartphones (such as iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0100] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, have computing and processing functions, and generally also have mobile Internet access capabilities. These terminals include: PDA, MID and UMPC devices, such as iPad;
[0101] (3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio and video players (e.g., iPod), handheld game consoles, e-books, as well as smart toys and portable car navigation devices;
[0102] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0103] (5) Other electronic devices with data interaction functions.
[0104] This invention also provides a computer program product, comprising a computer program stored on a storage medium, the computer program including program instructions that, when executed by a computer, enable the computer to perform the method described above for automatically amplifying chemical molecular structure data. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or certain portions of the embodiments.
[0105] Additionally, logic and / or steps represented in the flowchart or otherwise described herein, for example, executable instructions that can be considered for implementing logical functions, can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections having one or more wires (electronic devices), portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0106] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. Those skilled in the art will understand that all or part of the steps carried out by the methods of the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0107] Finally, it should be pointed out that the above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. In the absence of conflict, the embodiments and features in the embodiments of this application can be combined with each other. Furthermore, for the foregoing method embodiments, for the sake of simplicity, they are all described as a combination of a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously; secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments.
Claims
1. A method for automatically amplifying chemical molecular structure data, characterized in that, The method includes the following steps: S1) Use the "MolFromSmiles" function in the RDKit tool to read the SMILES data of the input chemical molecular structure; S2) Use the "GetScaffoldForMol" function in the RDKit tool to identify the feature structures in the read chemical molecular structure and output the type of the feature structure and the SMILES data of the feature structure; the identification includes the following specific steps: S21) Use the "GetScaffoldForMol" function in the RDKit tool to calculate the skeleton structure in the read chemical molecule structure. If the function returns a result, use the "MolToSmiles" function in the RDKit tool to calculate the SMILES data of the skeleton structure in the returned result, and output the feature structure as "skeleton structure" and the SMILES data of the skeleton structure. If the function returns null, then execute step S22); S22) Use the regular expression "\([^)*\)]" to delete the parentheses "()" and the characters within the parentheses in the SMILES data of the input chemical molecular structure, and obtain the SMILES data of the main chain structure in the read chemical molecular structure. If the number of characters in the SMILES data of the main chain structure is greater than 3 and less than the number of characters in the SMILES data of the input chemical molecular structure, then the output feature structure type is "main chain structure" and the SMILES data of the main chain structure. S3) Use the "MolFromSmiles" function in the RDKit tool to read the SMILES data of the input chemical molecular structure and the SMILES data of the feature structure respectively, and obtain the chemical molecular structure and feature structure; S4) Use the "GetNumAtoms" function in the RDKit tool to create a list of atom numbers for chemical molecular structures, and use the "GetSubstructMatches" function in the RDKit tool to create a list of atom numbers for characteristic structures; S5) Compare the numbers in the atomic number list of the chemical molecular structure obtained in step S4) with the atomic number list of the characteristic structure, and form a new list of numbers that do not appear in the atomic number list of the characteristic structure as the atomic number list outside the characteristic structure. S6) Randomly shuffle the order of the atomic numbers in the atomic number list other than the feature structure, and then combine it with the atomic number list of the feature structure obtained in step S4) to obtain the atomic number list of the chemical molecular structure aligned with the feature structure. S7) Use the "RenumberAtoms" function in the RDKit tool to rearrange the atoms in the chemical molecular structure according to the list of atom numbers of the chemical molecular structure aligned with the feature structure obtained in step S6) to obtain the chemical molecular structure aligned with the feature structure. S8) Use the "MolToSmiles" function in the RDKit tool to calculate the SMILES data of the feature-aligned chemical molecular structure based on the feature-aligned chemical molecular structure obtained in step S7), and store it in the amplification results list. S9) Repeat steps S6) to S8) until the maximum number of attempts or the data amplification fold threshold set by the user is reached, and then output the amplified data of the chemical molecular structure.
2. The method according to claim 1, characterized in that: If the result of step S1) is empty or an error occurs, the message "The input data of the chemical molecular structure is incorrect" will be displayed, and the amplification data of the chemical molecular structure will be output as empty.
3. The method according to claim 1, characterized in that: Step S4) involves creating the list of atomic numbers for the chemical molecular structure by using the "GetNumAtoms" function of the RDKit tool to calculate the total number of atoms in the read chemical molecular structure, and then creating a sequential number list from 0 to the total number of atoms minus one based on the obtained total number of atoms.
4. The method according to claim 1, characterized in that: Step S6) Use the "random.shuffle" function in the Python programming language to randomly shuffle the order of the atom numbers in the atom number list other than the feature structure.
5. The method according to claim 1, characterized in that: Before storing the obtained SMILES data of chemical molecular structures aligned with the characteristic structures into the amplification result list in step S8), check whether the SMILES data to be stored already exists in the amplification result list. If it already exists, discard it and do not store it.
6. A system for performing the method of claim 1 to automatically amplify chemical molecular structure data, characterized in that, The system includes: Input module for inputting SMILES data of chemical molecular structures; The identification module is used to identify the characteristic structures of the read-in chemical molecules and obtain characteristic structure data. Alignment module for creating a list of atom numbers for chemical molecular structures that are aligned to obtain characteristic structures; An amplification module for expanding and storing SMILES data of chemical molecular structures aligned with characteristic structures; Output module for outputting amplified data of chemical molecular structures.
7. A storage medium having a computer program stored thereon, characterized in that: When executed by a processor, the program can implement the method described in any one of claims 1 to 5.
8. An electronic device comprising at least one processor and a memory communicatively connected to said at least one processor, wherein, The memory stores program instructions that can be executed by the at least one processor; characterized in that: the at least one processor is capable of executing the method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program stored on a storage medium, the computer program including program instructions, characterized in that: When the program instructions are executed by the processor, they can implement the method described in any one of claims 1 to 5.