<figure><img src="image_1.png" /></figure>

HAL
open science

# Extracting Knowledge from Recombinations of SMILES Representations

Christos Didachos, Andreas Kanavos

► To cite this version:

Christos Didachos, Andreas Kanavos. Extracting Knowledge from Recombinations of SMILES Representations. 19th IFIP International Conference on Artificial Intelligence Applications and Innovations (AIAI), Jun 2023, León, Spain. pp.325-334, 10.1007/978-3-031-34171-7_26. hal-05419401

HAL Id: hal-05419401

https://inria.hal.science/hal-05419401v1

Submitted on 16 Dec 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# Extracting Knowledge
from Recombinations of SMILES
Representations

Christos Didachos<fnref n="1" /> and Andreas Kanavos<fnref n="2" />(✉)

christosdidachos@upatras.gr

akanavos@ionio.gr

**Abstract.** The exploitation of all possible combinations of the non-common substructure of compounds using Simplified Molecular-Input Line-Entry System (SMILES) representations is an essential part in terms of accurate chemical information processing. SMILES is a widely used encoding for representing chemical compounds as strings of charac ters. In our paper, a novel approach, which treats the SMILES strings as a sequence of letters, numbers and symbols in order to extract meaningful knowledge, is presented. It identifies the common substructure between two given SMILES. For the non-common substructure, we extensively search all possible combinations of the string characters of all possible lengths. Finally, for all these character combinations, we accept only those that are chemically correct. So, our approach suggests all possi ble substructures that may be present for the non-common substructure between two compounds using the atoms that already exist in the ini tial non-common substructure. This approach can generate all possible fragments that could exist for a given non-common substructure while maintaining the common substructure and could be used in drug discov ery and other chemical applications.

**Keywords:** Knowledge Extraction · Text Mining · Computational Drug Design · De-novo Fragment Design

## 1 Introduction

Machine learning algorithms can play a crucial role in solving problems related to text mining [3]; it has a great impact in the way we analyze, handle and transform unstructured and structured text data. Taking into consideration the high availability of a plethora of digital information sources (e.g. social media, research publications), machine learning has become a remarkably useful tool of extracting knowledge. This can be extended to the demanding process of discovering and developing new drugs [11, 12, 27].

<footnote n="1">¹ Computer Engineering and Informatics Department, University of Patras,
Patras, Greece</footnote>

<footnote n="2">² Department of Informatics, Ionian University, Corfu, Greece</footnote>
Text mining has been involved in a plethora of applications in a variety of fields, including but not limited to healthcare, social media, business, cyber-security and more. One of the most common applications of text mining is sentiment analysis, also known as opinion mining, which identifies and extracts subjective information from text data, such as opinions and emotions. Obviously, this kind of analysis has been used extensively in marketing and customer service to gain insights into consumer behavior and preferences [20]. Another common application of text mining is topic modeling, which is a kind of statistical modeling and is used to identify the main themes or topics in a collection of documents. However, topic modeling has been extensively used in political science, where it has been used to identify public opinion on a variety of political issues [4].

More to the point, text mining helps in information extraction due to its capability to identify and extract structured information from unstructured text data. This approach is extremely useful in healthcare, as text mining has been used to extract valuable information from Electronic Health Records (EHRs) to improve patient care and outcomes. For example, text mining has been used to detect adverse drug reactions from unstructured EHR data, which can be a valuable tool for healthcare providers to manage in a more efficient way patients' medications and avoid potentially harmful drug interactions [29].

Text mining is being used in the process of drug discovery and development to analyze a lot of unstructured data (scientific literature and electronic health records) in order to extract valuable insights that can aid in drug design. For example, text mining can be used not only to identify potential drugs' targets but even to understand disease mechanisms, and predict drug efficacy and safety (toxicity) [19]. Text mining has also been used to develop predictive models for drug discovery and drug repurposing. For example, a study [13] used text mining approaches to extract information of drug-protein interactions from scientific literature. This approach offered the capability of training machine learning models to predict the bioactivity of new drug candidates.

Our approach designs new compounds, handling SMILES representations [28] as strings, and utilizing statistical methods in order to recombine sets of atoms to create novel compounds. SMILES representations are commonly used to describe chemical compounds in a format which could be more understandable from computers, and consist of a string of characters that represents the chemical structure of a molecule. Treating SMILES as strings offers the ability of easily comparing different compounds and identifying similarities and differences between them [16]. Furthermore, this corresponding method can be applied to Quantitative Structure Activity Relationship (QSAR) modeling [7,26], which is a rapidly evolving technique that investigates the correlation between chemical structure and biological activity in large compound libraries.

In order to design new compounds, we use statistical methods to extract all possible combinations of atoms that exist in a SMILES that can be recombined to form a large variety of new compounds potentially with desirable properties. This approach could be useful in a variety of drug discovery applications, including the design of new anticancer drugs [12]. By applying statistical methods on SMILES
representations, it offers the capability of searching for new compounds that may
have potential desired bioactivity against specific molecular targets.

The rest of the paper is organized as follows. Section 2 provides the related work for our paper. The material needed for acknowledging the contribution of this paper along with the methods utilized and the dataset used are introduced in Sect. 3. Section 4 presents the research results, and finally, Sect. 5 depicts conclusions and draws directions for future work.

## 2 Related Work

In silico drug discovery approaches involve generating large molecular libraries using combinatorial techniques, which are then filtered and characterized using computational methods such as QSAR [26] and docking [15]. Another common approach uses metaheuristics such as genetic algorithms to explore the chemical space and identify novel active compounds [24]. These methods rely on generating vast numbers of molecules to discover potential drug candidates, which can then be further analyzed and optimized for their biological functionality.

De novo drug design [17] is a computational approach that involves the in-silico generation of novel chemical compounds with desired properties for drug discovery. Recently, various computational methods have been developed for de novo drug design, including de novo molecular design and de novo fragment design. De novo fragment design is a method to develop potent small-molecule compounds starting from fragments binding weakly to targets [14].

For example, in [21], authors proposed a deep reinforcement learning framework for de novo drug design, which combined deep neural networks with reinforcement learning to generate diverse and chemically valid molecules. They used two different neural networks, the one was responsible to generate feasible SMILES representations, while the second one detected which of the generated SMILES appeared to have desired molecular properties. Sequentially, other research studies have used machine learning approaches such as Recurrent Neural Networks (RNNs), and Generative Adversarial Networks (GANs) in order to computationally design new compounds [10, 18, 23].

On the other hand, de novo fragment design aims to generate smaller molecular fragments and link them into a larger novel molecule with desired properties. Techniques of detecting common substructures [8] between molecules could be very essential in the de novo fragment design as it offers the capability to detect fragments of a compound that may be essential.

In [1], authors proposed an approach which uses a RNN to detect the basic structure - scaffold of a chemical structure. Sequentially, another model searches the chemical space and suggests new fragments in order to design novel molecules. Our proposed approach not only detects the essential substructure between two compounds, but also calculates all possible atom combinations for each compound in the cluster without introducing new atoms. This ensures that the generated fragments are derived from the existing atoms in the active compounds, maintaining the chemical feasibility.
# 3 Material and Methods

## 3.1 SMILES Notation

SMILES representations are a method used to describe the chemical structure of a molecule mostly to create a format that could be used in computational methods. SMILES notations are written as strings of characters, where each character represents a particular atom or bond of the molecule. The notation can be thought of as a linear sequence of atoms, where the order of the atoms in the sequence reflects the connectivity between them.

SMILES encoding provides a simple and standard way of describing simple or even complex chemical structures and is widely used in chemical databases and in ChemInformatic tools for drug discovery [2,25]. SMILES representations can be generated automatically from the 2D or 3D structure of a molecule or can be set manually by a chemist researcher. Overall, SMILES representations are a powerful tool for chemists and researchers working in the field of drug discovery and development, as they enable the efficient exchange and analysis of chemical information.

Our approach uses the below equation in order to define the number of all possible combinations for a given SMILES string.

$$ combinations = \sum_{k=1}^{n} \frac{n!}{k!(n-k)!} \quad (1) $$

where *k* is the length of each combination and *n* the length of the string.

## 3.2 Dataset

Our approach of designing new compounds is based on working with datasets that include compounds represented in SMILES notation and the usage of statistical methods to get all potential combinations. Each dataset of bioactive compounds which are represented in SMILES encoding can be used to design different molecular structures and choose a subset of them for further analysis.

In our case, we selected two compounds with similar structures but different functional groups, which are represented as SMILES strings in following Table 1. These compounds were chosen as they share a common substructure, while having different functional groups at the other end of the molecule. By comparing these compounds and identifying the similarities and differences between their SMILES representations, we are able to leverage the common substructure and generate new compounds by recombining the functional groups in different ways.

<table><caption>**Table 1.** SMILES Representations</caption><tr><td>First Compound</td><td>CC(=O)O[C@H](CC(=O)[O-])C[N+](C)(C)C</td></tr><tr><td>Second Compound</td><td>CCC(=O)OC(CC(=O)[O-])C[N+](C)(C)C</td></tr></table>
This approach could contribute in research fields which are related to drug discovery, as the identification of new compounds with desired functionality is crucial. By working with datasets of SMILES representations and leveraging statistical methods to identify new molecular structures, we can accelerate the process of drug discovery and help identify new compounds that may appear important therapeutic action.

Table 2 reflects some examples of the SMILES representation and presents how the SMILES encoding encodes the chemical structure in terms of atoms and bonds [28].

<table><caption>**Table 2.** SMILES examples</caption><thead><tr><td>SMILES</td><td>Structure</td></tr></thead><tbody><tr><td>CC</td><td>ethane (CH<sub>3</sub>CH<sub>3</sub>)</td></tr><tr><td>C=C</td><td>ethylene (CH<sub>2</sub> = CH<sub>2</sub>)</td></tr><tr><td>COC</td><td>dimethyl ether (CH<sub>3</sub>OCH<sub>3</sub>)</td></tr><tr><td>CCO</td><td>ethanol (CH<sub>3</sub>CH<sub>2</sub>OH)</td></tr><tr><td>C=O</td><td>formaldehyde (CH<sub>2</sub>O)</td></tr><tr><td>O=C=O</td><td>carbon dioxide (CO<sub>2</sub>)</td></tr><tr><td>O=CO</td><td>formic acid (HCOOH)</td></tr><tr><td>C#N</td><td>hydrogen cyanide (HCN)</td></tr><tr><td>[H][H]</td><td>molecular hydrogen (H<sub>2</sub>)</td></tr></tbody></table>

## 3.3 Methodology

In our approach, we utilize the SMILES representations of two selected compounds, and we aim to design new molecules by recombining the functional groups that are not shared between these two compounds. The first step in our approach is to identify the common substructure between the two SMILES representations, as this may be an essential component of the desired molecule. We achieve this by comparing the SMILES strings character by character, and identifying the longest common subsequence between them. The identification of common substructures between two compounds is critical in drug discovery research. Common substructures provide insights into the stereo-chemistry of compounds, helping researchers understand the key molecular features responsible for the observed biological activity. This knowledge enables rational drug design, guiding the modification of compounds to enhance their potency, selectivity, and safety [9].

Once the common substructure is detected, we then focus on the non-common substructure of the second SMILES string. Sequentially, we use a statistical approach to generate and extract all possible combinations of SMILES characters for this non-common substructure. However, not all combinations of characters will be valid molecules, and so we use the RDKIT framework to check the syntax of each combination and eliminate any that violates the chemical rules.
Our approach ultimately generates a list of all possible recombinations of the non-common substructure (of the two compounds), reserving the common substructure. This process could be characterised as a de novo fragment design approach, which is a method for designing new molecules using a combination of computational and experimental techniques. In de novo fragment design [22], the goal is to design molecules that are structurally distinct from existing com- pounds, yet possess desirable pharmacological properties. This approach has potential applications in drug discovery, as it can help identify novel lead com- pounds for further optimization and development.

## 4 Results

The similarity of the two compounds (similarity based on the SMILES string) is 22.2%. The SequenceMatcher algorithm was used to calculate the similarity of the initial compounds based on their SMILES notation. This ratio, available as a Python class, offers basic information of the structural relevance among the initial compounds [30]. For the non-common substructure, 511 total combina- tions were checked but only 48 of them were found correct from the perspective of chemical syntax. The structure of the two compounds is represented in Fig. 1, whereas in Fig. 2, a sample of the structures that our approach generated is shown for the non-common substructure.

Figure 1 illustrates the structure of the first two compounds and the non common substructure of them. Specifically, Fig. 1(a) presents the SMILES rep- resentation of the first compound, whereas Fig. 1(b) shows the SMILES represen- tation of the second compound and Fig. 1(c) presents the non common substruc- ture between the compounds (a) and (b); actually there were two non-common substructures but for the first one, no meaningful recombination of atoms could exist. All potential atom recombination scenarios have been investigated and examined for the non-common substructure of image Fig. 1(c).

More to the point, Fig. 2 depicts a selection of generated fragments represent- ing the non-common substructure between the two initial compounds. Out of the total of 48 fragments that adhere to the established chemical rules and syn- tax, only a sample is presented here for illustrative purposes. It should be noted that while the total 48 generate fragments may be syntactically correct, their feasibility in terms of chemical synthesis may vary. Therefore, additional opti- mization is necessary by a medicinal chemist. Nonetheless, the proposed meth- ods hold promise as a valuable tool for aiding scientists in the field of medicinal chemistry.

## 5 Conclusions and Future Work

The proposed method generates fragments exploiting all available atom com- binations for the non-common substructures. While we ensure that only com- pounds that appear to be correct as chemical compounds are kept, many of the generated compounds are not feasible or realistic from a synthetic perspective.
<figure><img src="image_4.png" /><figcaption>(a) SMILES representation of the first compound</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>(b) SMILES representation of the second compound</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>(c) The non-common substructure of the second compound</figcaption></figure>

**Fig. 1.** Two compounds and the non-common substructure between these compounds.

These unrealistic compounds may be due to various factors, such as synthesis constraints.

One limitation of the proposed method is the required process time as it is undeniably time-consuming, particularly when dealing with longer SMILES strings. However, there is potential for an extension of the current method that draws on the findings of [5,6] to expedite the process. One approach would be to leverage multiple cloud nodes to perform the necessary calculations for all the recombinations, thus allowing for greater parallelization and reducing the overall time required.

A useful extension of our current work could be to develop a set of rules or fil-
ters to detect and exclude fragments that are not feasible or realistic. Such filters
could be based on chemical or synthetic knowledge and could greatly increase the
efficiency and usefulness of the de novo fragment design approach. For example,
<figure><img src="image_7.png" /><figcaption>(a) 15th chemical fragment</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>(b) 29th chemical fragment</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>(c) 35th chemical fragment</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>(d) 36th chemical fragment</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>(e) 37th chemical fragment</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>(f) 41th chemical fragment</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>(g) 42th chemical fragment</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>(h) 43th chemical fragment</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>(i) 44th chemical fragment</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>(j) 45th chemical fragment</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>(k) 46th chemical fragment</figcaption></figure>

<caption>**Fig. 2.** Sample of 11 different combinations.</caption>

filters could be developed to exclude fragments that violate Lipinski's rule of five or that have a high degree of synthetic difficulty. Overall, the development of such filters could greatly enhance the practicality and applicability of de novo fragment design approaches in drug discovery.
**Acknowledgement.** This research was co-financed by the European Union and Greek national funds through the "Competitiveness, Entrepreneurship and Innovation" Operational Programme 2014-2020, under the Call "Support for regional excellence"; project title: "Intelligent Research Infrastructure for Shipping, Transport and Supply Chain - ENIRISST+"; MIS code: 5047041.

## References

1. Arús-Pous, J., et al.: Smiles-based deep generative scaffold decorator for de-novo drug design. J. Cheminform. **12**(1), 1–18 (2020)

2. Backman, T.W.H., Cao, Y., Girke, T.: Chemmine tools: an online service for analyzing and clustering small molecules. Nucleic Acids Res. **39**(suppl 2), W486–W491 (2011)

3. Baeza-Yates, R.A., Ribeiro-Neto, B.A.: Modern Information Retrieval: The Concepts and Technology Behind Search, 2nd edn. Pearson Education Ltd., Harlow (2011)

4. Blei, D.M., Ng, A.Y., Jordan, M.I.: Latent Dirichlet allocation. J. Mach. Learn. Res. **3**, 993–1022 (2003)

5. Didachos, C., Kintos, D.P., Fousteris, M., Gerogiannis, V.C., Son, L.H., Kanavos, A.: A cloud-based distributed computing approach for extracting molecular descriptors. In: 6th ACM International Conference on Algorithms, Computing and Systems (ICACS), pp. 20:1–20:6 (2022)

6. Didachos, C., Kintos, D.P., Fousteris, M., Mylonas, P., Kanavos, A.: An optimized cloud computing method for extracting molecular descriptors. In: GeNeDis 2022: Genetics, Geriatrics and Neurodegenerative Diseases Research, pp. 165–173 (2021)

7. Dudek, A.Z., Arodz, T., Galvez, J.: Computational methods in developing quantitative structure-activity relationships (QSAR): a review. Comb. Chem. High Throughput Screen. **9**(3), 213–228 (2006)

8. Duesbury, E., Holliday, J.D., Willett, P.: Maximum common subgraph isomorphism algorithms. MATCH Commun. Math. Comput. Chem. **77**(2), 213–232 (2017)

9. Giordano, D., Biancaniello, C., Argenio, M.A., Facchiano, A.: Drug design by pharmacophore and virtual screening approach. Pharmaceuticals **15**(5), 646 (2022)

10. Guimaraes, G.L., Sanchez-Lengeling, B., Outeiral, C., Farias, P.L.C., Aspuru-Guzik, A.: Objective-reinforced generative adversarial networks (organ) for sequence generation models. arXiv preprint arXiv:1705.10843 (2018)

11. Hessler, G., Baringhaus, K.H.: Artificial intelligence in drug design. Molecules **23**(10), 2520 (2018)

12. Lavecchia, A.: Machine-learning approaches in drug discovery: methods and applications. Drug Discov. Today **20**(3), 318–331 (2015)

13. Lavecchia, A., Cerchia, C.: In silico methods to address polypharmacology: current status, applications and future perspectives. Drug Discov. Today **21**(2), 288–298 (2016)

14. Li, Q.: Application of fragment-based drug discovery to versatile targets. Front. Mol. Biosci. **7**, 180 (2020)

15. Lyu, J., et al.: Ultra-large library docking for discovering new chemotypes. Nature **566**(7743), 224–229 (2019)

16. Maggiora, G., Vogt, M., Stumpfe, D., Bajorath, J.: Molecular similarity in medicinal chemistry: miniperspective. J. Med. Chem. **57**(8), 3186–3204 (2014)

17. Mouchlis, V.D., et al.: Advances in de novo drug design: from conventional to machine learning methods. Int. J. Mol. Sci. **22**(4), 1676 (2021)
18. Olivecrona, M., Blaschke, T., Engkvist, O., Chen, H.: Molecular de-novo design through deep reinforcement learning. J. Cheminform. 9(1), 1-14 (2017)

19. Öztürk, H., Özgür, A., Olmez, E.O.: DeepDTA: deep drug-target binding affinity prediction. Bioinformatics 34(17), i821-i829 (2018)

20. Pang, B., Lee, L.: Opinion mining and sentiment analysis. Found. Trends Inf. Retr. 2(1-2), 1-135 (2007)

21. Popova, M., Isayev, O., Tropsha, A.: Deep reinforcement learning for de novo drug design. Sci. Adv. 4(7), eaap7885 (2018)

22. Rodrigues, T., et al.: De novo fragment design for drug discovery and chemical biology. Angew. Chem. Int. Ed. 54(50), 15079-15083 (2015)

23. Sanchez-Lengeling, B., Aspuru-Guzik, A.: Inverse molecular design using machine learning: generative models for matter engineering. Science 361(6400), 360-365 (2018)

24. Schneider, G., Fechner, U.: Computer-based de novo design of drug-like molecules. Nat. Rev. Drug Discov. 4(8), 649-663 (2005)

25. Stumpfe, D., Bajorath, J.: Similarity searching. Wiley Interdisc. Rev. Comput. Mol. Sci. 1(2), 260-282 (2011)

26. Tropsha, A.: Best practices for QSAR model development, validation, and exploitation. Mol. Inf. 29(6-7), 476-488 (2010)

27. Vamathevan, J., et al.: Applications of machine learning in drug discovery and development. Nat. Rev. Drug Discov. 18(6), 463-477 (2019)

28. Weininger, D.: Smiles, a chemical language and information system. 1. Introduction to methodology and encoding rules. J. Chem. Inf. Comput. Sci. 28(1), 31-36 (1988)

29. Wu, H.Y., Chiang, C.W., Li, L.: Text mining for drug-drug interaction. Biomed. Lit. Min. 47-75 (2014)

30. Yan, J., Gao, K.: Research and exploration on the construction method of knowledge graph of water field based on text. In: 2nd IEEE ICISCAE, pp. 71-77 (2019)