1 Introduction

The identification of novel compound-protein interaction (CPI) is important in drug discovery. Revealing unknown compound-protein interactions is useful to design a new drug for a target protein by screening candidate compounds. The accurate CPI prediction assists in effective drug discovery process. To identify potential CPI effectively, prediction methods based on machine learning and deep learning have been developed. Data for sequences are provided as discrete symbolic data. In the data, compounds are represented as SMILES (simplified molecular-input line-entry system) strings and proteins are sequences in which the characters are amino acids. The outcome is defined as a variable that indicates how strong two molecules interact with each other or whether there is an interaction between them. In this package, a deep-learning based model that takes only sequence information of both compounds and proteins as input and the outcome as output is used to predict CPI. The model is implemented by using compound and protein encoders with useful features. The CPI model also supports other modeling tasks, including protein-protein interaction (PPI), chemical-chemical interaction (CCI), or single compounds and proteins. Although the model is designed for proteins, DNA and RNA can be used if they are represented as sequences.

Multilayer perceptron (MLP) is the simplest form of neural networks consisting only of fully connected layers. Convolutional Neural Network (CNN) has convolutional layers instead of fully connected layers in the initial phase of the network. Recurrent neural network (RNN) are distinguished from other classes by presence of components with memory, containing long short term memory (LSTM) and gated recurrent units (GRU). The graph neural network (GNN) is a class of deep learning methods designed to perform inference on graph data. The graph convolutional network (GCN) is a type of GNN that can work directly on graphs and take advantage of their structural information. The GCN enables to learn hidden layer representations that capture both graph structure and node features. Compounds are represented as graphs and GCN can be used to learn compound-protein interactions. In molecular graph representations, nodes represent atoms and edges represent bonds. Besides graphs, a molecular fingerprint can be extracted from SMILES strings. A molecular fingerprint is a way of encoding the structural features of a molecule. Fingerprints are special kinds of descriptors that characterize a molecule and its properties as a binary bit vector that represents the presence or absence of particular substructure in the molecule. The Chemistry Development Kit (CDK) is an open source toolkit for bioinformatics and cheminformatics. It can accept the SMILES notation of a molecule as input to calculate molecular descriptors and fingerprints or get structural information. It can be implemented in R by the rcdk package.



2 Example

2.1 compound-protein interaction

The “example_cpi” dataset has compound-protein pairs and their interactions. Each line has a SMILES string, an amino acid sequence, and a label. Here, the label 1 means that the pair of SMILES and amino acid sequences has interaction and 0 means that the pair does not have interaction. In order to avoid overfitting, the data is split into a training sample and a validation sample. The training sample is used to estimate parameters or weights of the deep learning models. The validation sample is an independent sample, set aside to monitor the misclassification error. Here, 70% of the data are used for training and 30% for validation.

## Loading required package: keras

The input sequences are fed into encoders. We need to provide the list of arguments for compound and protein encoder networks and for fully connected layer. For compound and protein networks, input and output tensors of encoders are required. Here, we can choose the graph convolutional network (GCN), recurrent neural network (RNN), convolutional neural network (CNN), and multilayer perceptron (MLP) as encoders. Additionally, we can use our own encoders. Note that the GCN is only available for compounds. The arguments for the “compound” and “protein” are the function of encoders with input and output tensors. The “compound_arg” and “protein_arg” are the arguments of the functions. The compound and protein encoders are concatenated and they are passed to the dense layer. A dense layer is a fully connected layer. We now need to compile the model, this step configures the learning process for our neural network architecture. We need to provide three arguments including the optimization algorithm to be used, the loss function to be optimized and metrics for evaluation.

## Loaded Tensorflow version 2.4.1

For example, consider the GCN for compounds and the CNN for proteins. For the GCN, we have to set the maximum number of atoms since every compound has not the same number of atoms. The degree of an atom in the graph representation and the atomic symbol and implicit hydrogen count for an atom are used as molecular features. Similarly, we define the maximum number of amino acids because there will be proteins of different lengths. In other words, naturally, some of the proteins are shorter and longer. The layer for embeddings to help us map strings to vectors. For them, we need to provide the dimension of the dense embedding. The n-gram is available only for protein sequences. We can use “callbacks”. The callback functions can terminate the training process, modify the learning rate, and save snapshots of the best version of our model during the training process.

## checking sequences...
## preprocessing for compounds...
## preprocessing for proteins...
## fitting model...
## Warning in is.na(d): is.na() applied to non-(list or vector) of type
## 'environment'

## Warning in is.na(d): is.na() applied to non-(list or vector) of type
## 'environment'

Using the trained model, we can predict whether pairs of SMILES and amino acid sequences have interaction or not. A very convenient way to evaluate the accuracy of a model is the use of a table that summarizes the performance of our algorithm against the data provided. The Receiver Operator Characteristic (ROC) is a quantitative analysis technique used in binary classification. The ROC curve is a helpful diagnostic for a model. The Area Under the Curve (AUC) can be calculated and provide a single score to summarize the plot that can be used to compare models. An alternative to the ROC curve is the precision-recall curve that can be useful for imbalanced data.

## checking sequences...
## preprocessing for compounds...
## preprocessing for proteins...
## predicting model...

2.2 chemical-chemical interaction

The chemical-chemical interactions such as drug-drug interactions (DDI) have become one of the emerging topics of the clinical drug development. Predictions of DDI are fueled by recent growth of knowledge in molecular biology, computation based simulation or predictions, and a better understanding of the inhibition and induction mechanisms. Here, the molecular fingerprint is used from SMILES strings.

## checking sequences...
## preprocessing for compounds...
## fitting model...
## checking sequences...
## preprocessing for compounds...
## predicting model...
##           
## pred_calss   0   1
##          0 118  34
##          1  41 107

2.3 protein-protein interaction

The protein-protein interactions (PPIs) are biochemical events that play an important role in the functioning of the cell. The prediction of protein-protein interactions has important implications for understanding the behavioral processes of life, preventing diseases, and developing new drugs. Here, the n-gram for proteins is available. However, the q-gram would be better than the n-gram, since the q-gram is a string of q characters. In literature on text classification, the term n-gram is often used instead of the q-gram.

## checking sequences...
## preprocessing for proteins...
## fitting model...
## checking sequences...
## preprocessing for proteins...
## predicting model...
##           
## pred_calss   0   1
##          0 527 237
##          1 252 484

Although the function “fit_cpi” is designed for amino acid sequences, we may instead use nucleic acid sequences, if they are composed of capital letters of an alphabet.

## checking sequences...
## preprocessing for proteins...
## fitting model...
## checking sequences...
## preprocessing for proteins...
## predicting model...
##           
## pred_calss  0  1
##          0 30  1
##          1  0  1

2.4 single compound

Even though the function “fit_cpi” is designed for pairs of compounds, proteins, or both, we may instead use single compounds alone.

## checking sequences...
## preprocessing for compounds...
## fitting model...
## checking sequences...
## preprocessing for compounds...
## predicting model...
##           smiles
## pred_calss  0  1
##          0  3  1
##          1 21 35

2.5 single protein

In a similar way, we can use single proteins, too. Our model can be extended to multiclass problems.

if (keras::is_keras_available() & reticulate::py_available()) {
    example_prot <- example_prot[1:500,]
    example_prot[,2] <- as.numeric(factor(example_prot[,2])) - 1
    
    validation_split <- 0.3
    idx <- sample(seq_len(length(example_prot[,1])))
    train_idx <- seq_len(length(example_prot[,1])) %in%
        idx[seq_len(round(length(example_prot[,1]) * (1 - validation_split)))]
    
    protein_embedding_dim <- 16
    protein_length_seq <- 100
    rnn_prot <- fit_cpi(
        AAseq = example_prot[train_idx, 1],
        outcome = to_categorical(example_prot[train_idx, 2]),
        protein_length_seq = protein_length_seq,
        protein_embedding_dim = protein_embedding_dim,
        AAseq_val = example_prot[!train_idx, 1],
        outcome_val = to_categorical(example_prot[!train_idx, 2]),
        net_args = list(
            protein = "rnn_in_out",
            protein_args = list(
                rnn_type = c("gru"),
                rnn_bidirectional = c(TRUE),
                rnn_units = c(50),
                rnn_activation = c("relu"),
                fc_units = c(10),
                fc_activation = c("relu")),
            fc_units = c(3),
            fc_activation = c("softmax"),
            loss = 'categorical_crossentropy',
            optimizer = keras::optimizer_adam(clipvalue = 0.5),
            metrics = "accuracy"),
        epochs = 20, batch_size = 64,
        callbacks = keras::callback_early_stopping(
            monitor = "val_accuracy",
            patience = 10,
            restore_best_weights = TRUE))
    ttgsea::plot_model(rnn_prot$model)
    
    val_index <- seq_len(length(example_prot[,2]))[!train_idx]
    if (!is.null(rnn_prot$preprocessing$removed_AAseq_val)) {
        pred <- predict_cpi(rnn_prot,
            AAseq = example_prot[val_index[-rnn_prot$preprocessing$removed_AAseq_val[[1]]], 1])
        pred_calss <- apply(pred$values, 1, which.max) - 1
        table(pred_calss, example_prot[val_index[-rnn_prot$preprocessing$removed_AAseq_val[[1]]], 2])
    } else {
        pred <- predict_cpi(rnn_prot, AAseq = example_prot[!train_idx, 1])
        pred_calss <- apply(pred$values, 1, which.max) - 1
        table(pred_calss, example_prot[!train_idx, 2])
    }
}
## checking sequences...
## at least one of protein sequences may not be valid
## preprocessing for proteins...
## fitting model...
## checking sequences...
## preprocessing for proteins...
## predicting model...
##           
## pred_calss  0  1  2
##          0 70 39 40



3 Case Study

The process of developing drugs is extensive, laborious, expensive, and time consuming. Drug repurposing, also referred to as repositioning, significantly reduces the cost, risk, and time compared to traditional drug development strategies, by recycling already established drugs. In the drug discovery process, it is required to determine the cause of a disease and, thus, a potential biological target. A target can be any biological entity from RNA to a protein to a gene that is ‘druggable’ or accessible to binding with a drug-like compound. Drug interactions with a biological target change the shape or confirmation of some facet of the target when bound to a small molecule and alter the target’s ability to function. This conformational change ideally triggers a desired biological response involved in the particular disease process. Here, deep learning models can be used to identify the candidate drugs for selected targets and disease.

Suppose that we want to identify which existing antiviral drugs can be repurposed to target the SARS coronavirus 3C-like Protease. For training the deep learning model, we use the data from past bioassay data such as high throughput screening (HTS) assay on SARS-CoV 3CL Protease, which conserves large portion of the gene with SARS-CoV-2. For repurposing for COVID-19, the deep learning model is trained using this data to rank drug candidates from the antiviral library.

## checking sequences...
## preprocessing for compounds...
## preprocessing for proteins...
## fitting model...
## checking sequences...
## preprocessing for compounds...
## preprocessing for proteins...
## predicting model...
##                    drug probability
## 9           Bictegravir 0.986276031
## 68           Telaprevir 0.985673130
## 71           Tipranavir 0.983858228
## 64           Simeprevir 0.983570874
## 27          Enfuvirtide 0.974917531
## 8             Baloxavir 0.974327087
## 29           Etravirine 0.955767035
## 59           Remdesivir 0.935420752
## 46           Nelfinavir 0.899412513
## 55          Glecaprevir 0.881424129
## 41            Lopinavir 0.853496194
## 58          Raltegravir 0.833120286
## 39              Inosine 0.763344288
## 14           Cobicistat 0.700861692
## 76           Vicriviroc 0.643524289
## 37             Imunovir 0.640861154
## 35          Idoxuridine 0.616992235
## 56          Grazoprevir 0.540063262
## 69          Telbivudine 0.484550089
## 78          Taribavirin 0.461728215
## 70 Tenofovir_disoproxil 0.436394185
## 61          Rilpivirine 0.410539687
## 11            Tenofovir 0.396619380
## 1              Abacavir 0.389616907
## 49            Ritonavir 0.335215747
## 28            Entecavir 0.304388285
## 19          Delavirdine 0.271385610
## 67          Chloroquine 0.247325063
## 36            Imiquimod 0.245998383
## 40           Letermovir 0.244568586
## 73         Tromantadine 0.207982719
## 65           Sofosbuvir 0.203472316
## 38            Indinavir 0.191828579
## 42             Loviride 0.189323634
## 20           Didanosine 0.176720649
## 43            Maraviroc 0.174390286
## 13            Cidofovir 0.171611369
## 12           Boceprevir 0.163252383
## 26         Elvitegravir 0.146346480
## 51          Penciclovir 0.144450009
## 15           Lamivudine 0.131378531
## 22         Dolutegravir 0.130403638
## 47           Nevirapine 0.129563779
## 44          Methisazone 0.126330197
## 24            Edoxudine 0.115958124
## 72         Trifluridine 0.115310192
## 63           Saquinavir 0.110618114
## 30          Famciclovir 0.095501035
## 5            Amprenavir 0.091864705
## 57           Pyrimidine 0.089536458
## 60            Ribavirin 0.080130130
## 2             Aciclovir 0.072492003
## 52            Peramivir 0.065117866
## 45           Moroxydine 0.062666446
## 32            Foscarnet 0.055622250
## 18            Darunavir 0.055180848
## 81   Hydroxychloroquine 0.050572813
## 21            Docosanol 0.047526419
## 10        Emtricitabine 0.046124548
## 25            Efavirenz 0.035898209
## 77           Vidarabine 0.035373509
## 23           Doravirine 0.035259277
## 6               Arbidol 0.034519762
## 16           Zidovudine 0.029622972
## 74         Valacyclovir 0.025962204
## 7            Atazanavir 0.024633259
## 3              Adefovir 0.023861855
## 79          Zalcitabine 0.023465455
## 33          Ganciclovir 0.020339042
## 31        Fosamprenavir 0.020171970
## 48         Nitazoxanide 0.018921942
## 53           Pleconaril 0.017953545
## 34          Ibacitabine 0.017316073
## 50          Oseltamivir 0.015298963
## 17          Daclatasvir 0.013243318
## 54      Podophyllotoxin 0.009165674
## 66            Stavudine 0.006658316
## 80            Zanamivir 0.006570220
## 4            Amantadine 0.005075514
## 75       Valganciclovir 0.004409343
## 62          Rimantadine 0.003650188



4 Session information

## R version 4.1.3 (2022-03-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.14-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.14-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
##  [3] LC_TIME=en_GB                 LC_COLLATE=C                 
##  [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
##  [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
##  [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
## [11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] DeepPINCS_1.2.2 keras_2.8.0    
## 
## loaded via a namespace (and not attached):
##  [1] httr_1.4.2             sass_0.4.1             jsonlite_1.8.0        
##  [4] RhpcBLASctl_0.21-247.1 here_1.0.1             bslib_0.3.1           
##  [7] PRROC_1.3.1            assertthat_0.2.1       lgr_0.4.3             
## [10] highr_0.9              rcdklibs_2.3           yaml_2.3.5            
## [13] slam_0.1-50            pillar_1.7.0           lattice_0.20-45       
## [16] fingerprint_3.5.7      glue_1.6.2             reticulate_1.24       
## [19] digest_0.6.29          RColorBrewer_1.1-3     rvest_1.0.2           
## [22] htmltools_0.5.2        Matrix_1.4-1           tm_0.7-8              
## [25] rsparse_0.5.0          pkgconfig_2.0.3        textstem_0.1.4        
## [28] DiagrammeR_1.0.9       purrr_0.3.4            itertools_0.1-3       
## [31] stringdist_0.9.8       whisker_0.4            webchem_1.1.2         
## [34] tibble_3.1.6           generics_0.1.2         ellipsis_0.3.2        
## [37] NLP_0.2-1              cli_3.2.0              ttgsea_1.2.1          
## [40] magrittr_2.0.3         crayon_1.5.1           evaluate_0.15         
## [43] float_0.2-6.1          data.tree_1.0.0        stopwords_2.3         
## [46] tokenizers_0.2.1       fansi_1.0.3            SnowballC_0.7.0       
## [49] xml2_1.3.3             koRpus_0.13-8          tools_4.1.3           
## [52] data.table_1.14.2      lifecycle_1.0.1        stringr_1.4.0         
## [55] matlab_1.0.2           CatEncoders_0.1.1      rcdk_3.6.0            
## [58] compiler_4.1.3         jquerylib_0.1.4        mlapi_0.1.0           
## [61] rlang_1.0.2            grid_4.1.3             rstudioapi_0.13       
## [64] iterators_1.0.14       rappdirs_0.3.3         htmlwidgets_1.5.4     
## [67] visNetwork_2.1.0       base64enc_0.1-3        rmarkdown_2.13        
## [70] koRpus.lang.en_0.1-4   sylly_0.1-6            DBI_1.1.2             
## [73] R6_2.5.1               sylly.en_0.1-3         tfruns_1.5.0          
## [76] knitr_1.38             dplyr_1.0.8            tensorflow_2.8.0      
## [79] fastmap_1.1.0          utf8_1.2.2             zeallot_0.1.0         
## [82] rprojroot_2.0.3        text2vec_0.6           rJava_1.0-6           
## [85] stringi_1.7.6          parallel_4.1.3         Rcpp_1.0.8.3          
## [88] vctrs_0.4.0            png_0.1-7              tidyselect_1.1.2      
## [91] xfun_0.30



5 References

Balakin, K. V. (2009). Pharmaceutical data mining: approaches and applications for drug discovery. John Wiley & Sons.

Huang, K., Fu, T., Glass, L. M., Zitnik, M., Xiao, C., & Sun, J. (2020). DeepPurpose: A Deep Learning Library for Drug-Target Interaction Prediction. Bioinformatics.

Kipf, T. N., & Welling, M. (2016). Semi-supervised classification with graph convolutional networks. ICLR.

Nguyen, T., Le, H., & Venkatesh, S. (2020). GraphDTA: prediction of drug-target binding affinity using graph convolutional networks. Bioinformatics.

O’Donnell, J. J., Somberg, J., Idemyor, V., & O’Donnell, J. T. (Eds.). (2019). Drug Discovery and Development. CRC Press.

Pedrycz, W., & Chen, S. M. (Eds.). (2020). Deep Learning: Concepts and Architectures. Springer.

Srinivasa, K. G., Siddesh, G. M., & Manisekhar, S. R. (Eds.). (2020). Statistical Modelling and Machine Learning Principles for Bioinformatics Techniques, Tools, and Applications. Springer.

Trabocchi, A. & Lenci, E. (2020). Small molecule drug discovery: methods, molecules and applications. Elsevier.

Tsubaki, M., Tomii, K., & Sese, J. (2019). Compound-protein interaction prediction with end-to-end learning of neural networks for graphs and sequences. Bioinformatics.

Van der Loo, M., & De Jonge, E. (2018). Statistical data cleaning with applications in R. John Wiley & Sons.

Vogel, H. G., Maas, J., & Gebauer, A. (Eds.). (2010). Drug discovery and evaluation: methods in clinical pharmacology. Springer.

Wang, L., Wang, H. F., Liu, S. R., Yan, X., & Song, K. J. (2019). Predicting protein-protein interactions from matrix-based protein sequence using convolution neural network and feature-selective rotation forest. Scientific reports.