Добавил:
kiopkiopkiop18@yandex.ru t.me/Prokururor I Вовсе не секретарь, но почту проверяю Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5364_Библиотеки_им_академика_М_И_Перельмана.pdf
Скачиваний:
0
Добавлен:
02.09.2026
Размер:
21 Мб
Скачать
5 Clustering of Small Molecules 111
may be highly impractical. Moreover, some similarities between objects may not be obvious from a fast visual inspection.
Computer-aided clustering of chemical entities therefore has three potential advantages: (a) automation, (b) high-throughput, and (c) the possibility of detecting clustering patterns that exceed prior knowledge and prior judgments regarding which molecular features are relevant for meaningful and informative clustering.
1.1 Applications in Drug Discovery
The clustering of small molecules is of substantial importance in the eld of computer-guided drug discovery and in conducting virtual and wet screening exper­iments. Depending on the pursued goals, the structure of chemical data in suitable subspaces of the chemical space can be relevant to sample chemical data sets in a representative or biased manner.
First, the stratied split of data sets into representative training and validation sets is regularly performed when building quantitative structure–activity relationships (QSAR) and, in general, for any kind of machine-learning application. Such a practice can respond to two different (and, in a certain sense, opposite) purposes: (a) ensure that the training data present maximum coverage of the chemical space covered by the data set, in order to expand the generalizability and the applicability domain of the inferred models [21, 30], and (b) avoid compo und biases and overoptimistic validation output by allocating very similar compounds in both the training and validation sets ([32, 58]). For more details, see Chap. 6.
Second, structuring data in the chemical space can be useful in investigating unexplored regions for novel bioactive compounds [16, 52]. On the contrary, focusing on specic already-explored regions that congregate active compounds may be of interest to generate preferred screening collections or focused compound libraries ([6, 59]), or simply to increase the probability of nding a bioactive compound (at the expense of chemical novelty).
Third, the clustering of small molecules c an be useful to guide the selection of subsets of in silico hits that will be submitted for experimental conrmation [38]. Because of funding limitations, the number of virtual hits that arise from in silico screening experiments most often exceeds the number that can be physically accessed (synthesized, isolated, or acquired from vendors) and evaluated experi­mentally. Clustering and subsequent representative sampling can guarantee the coverage of as much chemical diversity as possible with those relatively scarce in silico hits submitted to wet assays. Later, those experimentally conrmed hits can be enriched by testing other compounds present in the library with the same or similar scaffolds. Likewise, the same principle can be used to expedite structure-based screening without exhaustive docking of every molecule in ultra-large chemical libraries [54, 55].
112 A. Talevi et al.
1.2 Classication
Broadly speaking, clustering approaches in general (and also in the particular case of small molecule clustering) can be classied as hierarchical or nonhierarchical methods.
In hierarchical clustering, the data are partitioned successively, in a nested way [18]. Bottom-up or agglomerative approaches proceed by a series of consecutive fusions of the N objects into groups (eventually merging them all together in the last step of the procedure). Top-down or divisive approaches, in contrast, serially divide the N objects into smaller groups (eventually resulting in isolated elements). Hier­archical clustering is most often graphically represented as a dendrogram or tree (a representation of clusters at multiple levels). A disadvantage of these approaches is that once the individual elements have been merged (into supra-clusters, agglom- erative approaches) or segregated (into subclusters, divisive approaches), this cannot be reverted or revised in subsequent steps, that is, they cannot be optimized. Typical examples of hierarchical methods are single, complete, and Ward linkage, with the latter being frequently used in the context of chemical library clustering [37]. Another example is the Maximal Common Substructure (MCS) approach, which groups compounds based on their common subgraph of the great est cardinal­ity. It has been implemented at Chemaxon s Jchem (https://chemaxon.com/).
Nonhierarchical methods, for their part, do not resort to a tree-like structure, and usually require, on the part of the user, to predene the number of clusters that they wish to obtain or the initial data points that will be assigned to each cluster, which generally requires prior knowledge regarding the structure of the data. Moreover, as hierarchical methods decide locally, step by step, which objects should be merged into the same clusters or split into different clusters, they avoid hard combinatorial optimization problems. In contrast, optimization approaches, such as those used in nonhierarchical methods, often involve iterative processes to minimize an objective function, which can be computationally intensive. The clusters are iteratively rened by either minimizing or maximizing some numerical criterion, as in the popular K-means [60] (where each cluster is represented by its centroid or center of gravity, which in general does not match actual data point) or K-medoids algorithms [26] (where each cluster is represented by actual data points that minimize the sum of distances to other members of the same cluster). Both K-means and K-medoids algorithms can be regarded as prototype-based clustering, as the data are arranged around representative points for each partition. Sphere-exclusion algorithms, a type of contiguity-based clustering, as in the popular method by Butina [10], represent another example of a frequently used nonhierarchical approach.
The preceding classication is, however, extremely basic, and only one of many other possible classication schemes [1, 14, 46, 47, 56]. For instance, we may consider density-based algorithms (which construct density functions that reect the spatial distribution of the data points: each cluster corresponds to a high-density region separated from other high-density regions by sparsely populated regions of the space), distribution- or model-based clustering (in which the algorithms assume
5 Clustering of Small Molecules 113
Fig. 5.2 Schematic representation of some of the types of clustering mentioned in the main text
that the data are generated from a mixture of underlying probability distributions, e.g., Gaussian); grid-based algorithms (which quantize the space into a nite number of cells for the sake of efciency), fuzzy or soft clustering (which, in line with fuzzy logic, considers that a given object belongs to multiple clusters, in contrast to traditional hard or exclusive clustering, in which each object exclusively corresponds to a single cluster), or partial clustering (which considers that some object may be outliers that may not belong to any cluster, in contrast with complete clustering), among other possible classications. Some of these approximations are graphically schematized in Fig. 5.2.
114 A. Talevi et al.

2 Validations and Controls

A common issue in the applications of clustering techniques in the eld of small molecules is the frequent omission of validation procedures and validity indexes (or evaluation measures) to establish the goodness of the results obtained or, occasionally, to compare the performance of different clustering methods or param­eters. The problem of the lack of adequate validation in a large number of applica­tions cuts across many domains of cheminformatics and bioinform atics (e.g., very frequently molecular docking applications do not resort to any sort of scoring power validation). An exception is the eld of quantitative structure–activity relationships, where recognized experts and international organizations have long advocated the use of well-dened techniques and metrics to evaluate the generalizability and robustness of models [20, 4850], which have even been used with regulatory scope in the eld of toxicology.
Cluster vali dation should be part of any cluster analysis because clustering approaches will generally nd clusters in any given data set, even if it does not present a naturalcluster structure.
We can mention three general approaches to validate the result of a clustering experiment, which are [8, 47] internal, external,andrelative cluster validation. These will be next described in separate subsections.
2.1 Internal Validation
Internal clustering validation measures how good and stable the proposed clustering structure is, without resorting to any criterion external to the data set. Internal validation is possibly the most objective (or pure) way to judge the goodness of a given clustering structure since it does not obey any external criteria unrelated (or diffusely connect ed) to the structure of the data. It should be noted that, in principle, any external criterion could respond to a subjective interest of the researcher and, therefore, bias what is considered a good result toward one that conrms a previous hypothesis about the data. In fact, cluster techniques are usually described as unsupervised machine-learning techniques, precisely to highlight that they are not based on any type of prior judgment, information, or assumptions about the data. Therefore, it sounds quite reasonable to resort to unsupervised methods to evaluate the validity of an unsupervised method . However, as discussed extensively in Sect. 3, the product of a clust er analysis is usually rather evaluated in practical terms, based on its usefulness or functionality for specic objectives.
An ideal clustering structure is usually recognized as one that provides highly cohesive clusters (i.e., with small within-cluster or intra-cluster distances) well separated in space from each other (i.e., with large intercluster or between-cluster distances). Connectedness, that is, to what extent an object is assigned to the same cluster as its nearest neighbor in the data space, is also sometimes assessed. On the
5 Clustering of Small Molecules 115
other hand, a stable clustering structure would be one that is not substantially modied when the data set is subjected to perturbation (which would suggest that the structure of the data that has been found obeys a natural underlying structure, if such a structure exists).
To begin with, we could point out that cohesion can be calculated based on the sum of distances or the sum of proximities between elements assigned to the same cluster Ci, usually weighting it by the size of the corresponding cluster, while separation could be calculated in an analogous way but considering the distances or proximities of elements assigned to different clusters Ci and Cj [47], where x and y are elements of clusters:
Cohesion C
Separation C
ðÞ=
i
, C
i
proximity x, yðÞ ð5:1Þ
xϵC
i
yϵC
i
=
j
proximity x, yðÞ ð5:2Þ
xϵC
i
yϵC
j
Eventually, cohesion can also be calculated as the sum of distances between an object and the centroid or medoid of the corresponding cluster, whereas separation can be estimated as the distance between centroids or medoids of different clusters, or the minim al distance between elements from different clusters.
The metrics most used to evaluate the goodness of the clustering structure produced by a certain method simultaneously reect, in a single variable, the cohesion and separation of the clustering, which makes sense since cohesion and separation show opposite trends versus the number of clusters (cohesion increases with the number of clusters considered, while separation decreases). The Dunn index [17] and the silhouet te width [43] are two popular examples of internal validity measures used to validate nonhierarchical clustering approaches.
The Dunn index D is computed as the ratio between the minimal between-cluster distance to the maximal within-cluster distance (which is also regarded as the maximal diameter):
separation
D =
diameter
ð5:3Þ
The Dunn index can assume values between zero and innity and must be maximized.
The silhouette width or silhouette index can be calculated as the average of the silhouette value S(i) across all the elements of the clustered data set.
If we call a(i) the average distance of the ith element of the data set with respect to all the other elements of its own cluster, and if we call b(i) the minimum average
116 A. Talevi et al.
distance between the ith element and the elements of any other cluster than its own (in other words, the average distance between element i and those elements assigned to the close st foreign cluster), then S(i ) is calculated as
SiðÞ=
aiðÞ- biðÞ
max aiðÞ, biðÞ
fg
ð5:4Þ
A negative S(i) indicates that, probably, the ith element has been assigned to an incorrect cluster since it is on average closer to the objects of a foreign cluster than to those of its own. An S(i) close to zero suggests that element i is positioned equidistantly between two clusters. The closer S(i) is to 1, the more condence there will be that the cluster assignment has been correct. The silhouette width ranges from -1 to 1, and a value equal to 1 reects ideal clustering: dense and well-spaced clusters, with a correct assignment of all elements to their respective clust ers.
Other internal validation measures that combine within- and between-cluster distances are the Calinski and Harabasz index, also known as the variance ratio criterion [ 11], McClain and Rao index [33], the Gamma index [5], the Davies– Bouldin index [15], and the SD and SDbw indexes [14], among others. The Frey index [61], for its part, also combines measures of cohesion and separation, but can only be used in the context of hierarchical clustering techniques. This index calcu­lates the ratio of difference scores from two successive levels in the hierarchic tree (level j and level j + 1). The difference between the average between-cluster distance for each of the two hierarchical levels is placed in the numerator, while the difference between the average within-cluster distance for the two successive levels is placed in the denominator:
d
- d
K =
b
d
w
jþ1
jþ1
- d
b
j
w
j
ð5:5Þ
where
dbrepresents the mean between-cluster distance and dwrepresents the mean
within-cluster distance. Its authors proposed using a ratio score of 1.00 to identify the correct cluster level. Other validation metrics commonly used in the context of hierarchical clustering, such as the cophenetic correlation coefcient, measure the degree of agreement between the cophenetic matrix and the proximity matrix. The cophenetic distance between two objects, in the framework of an agglomerative clustering approach, is the distance at which the algorithm merges those objects in the same cluster at the same time. In the cophenetic matrix, the entries are the cophenetic distances betw een the different pairs of objects. Further information on these and other internal measures can be found in [14].
Stability measures, on the other hand, compare the results of clustering when it is performed using the entire data set or after excluding one or more data points (i.e., they are based on a re-sample and re-cluster strategy to assess the signicance of the cluster derived from the original data set) [8, 22]. In some ways, the procedure used to assess stability is like cross-validation procedures used in the context of
5 Clustering of Small Molecules 117
supervised machine learning techniques (such as leave-one-out or leave-some-out cross-validation), only that in this case other numerical measures to quantitatively evaluate the robustness of the originally generated partitions [23]. For example, the Average Proportion of Nonoverlap measures the average proportion of observations not placed in the same cluster by clustering based on the complete data set and clustering based on the fraction of the data set that remains after the removal of one or more data points. Other options include calculating and comparing the mean within- and between-cluster distances before and after data removal. Naturally, the greater the perturbation that a data structure resists, without substantial modica­tions, the more stable such a data structure will be considered. In this case, the size of the perturbation would be related, fundamentally, to the proportion of data that are removed.
Cluster replicability is another similar approach that can be used to assess the robustness of a given data structure. This may be done, for instance, by separately clustering two subsamples of a dataset and comparing the resulting clusters (e.g., in the case of prototype-based clustering, by measuring the distances between the corresponding centroids or medoids). Alternately, after clustering the rst subsam­ple, the objects of the second subsample can be assigned to the cluster represented by the nearest centroid and, later, used to conduct a second independent clustering analysis on the second subsam ple and compare the degree of agreement between the predictedand actualcluster structures through a quantitative measure, such as the Rand index or a variant of it [29]. Replication of the results not only across entities but also across techniques and molecular features [40] would be indicative of high-order stability. Importantly, Krieger and Green [29] showed that under certain circumstances (large sample sizes and highly correlated clustering variables), inter­nal validation may fail as criteria of goodness of clustering. Moreover, using synthetic data, it was shown that replication experiments tend to provide high Rand indexes at low numbers of clusters (below 5) even if the truenumber of clusters in the data is higher [7].
2.2 External Validation
External validation uses an external criterion from outside the clustering process (a label or dependent variable that is not used to cluster the data) to verify the ability of the cluster to produce meaningful results [8]. But rst, it is necessary to under­stand what is considered signicant. When working with synthetic data, it is relatively easy to establish an underlying, truestructure of the data. On the other hand, when working with real data, dening a truth criterion can be more compli­cated and, as we discuss in the next section, subject to the researchers personal interests or ideas. As Milligan [36] accurately stated several decades ago: “... the validity of the external criterion variable in an applied situation is usually open to question. Failure to nd signicant group differences may be due to either a lack of cluster structure or an invalid criterion variable.
118 A. Talevi et al.
For example, in the eld of drug discovery, the external data label may be related to a biological activity or other pharmaceutically relevant property. Such properties are undeniably related to the molecular structure of the data set instances; however, the inability of a clustering algorithm to replicate the structure imposed by the external criterion does not necessarily mean that the clustering algorithm is failing. It is possible that the algorithm has detected a truecluster structure unrelated with the chosen external criterion, or that the molecular characteristics used to partition the data do not correlate well with the chosen class label.
Classication and regression metrics for model validation in the eld of super­vised machine learning have been reviewed in Chap. 6.
2.3 Relative Cluster Validation
As many clustering algorithms (e.g., the K-means and K-medoids algorithms) require input from the user on the number of clusters to consider, a frequent incognita when using these approaches is how to decide on such a parameter (and, eventually, on other parameters used as input). This is often done in a rather systematic way, by computing the value of a validity measure (e.g., an internal validity index) across a range of values of the parameter to optimize (e.g., the number of partitions to consider). Therefore, relative validation does not involve a particular type of measure but uses supervised or unsupervised measures commented on in the previous subsections for a specic purpose [47]: to optimize the value of a parameter or hyperparameter.
Occasionally, more than one complementary measure of validity can be consid­ered, with the subsequent visualization of solutions in two- or three-dimensional space. This can be particularly useful for the visualization of the results obtained using conicting measures [22].
The elbow method is an example of a commonly used graphical approach to decide on the number of clusters. It is usually performed in the context of the K-means algorithm, by plotting the within-cluster-sum-of-squares (or other measure of goodness) versus different possible values of K. The optimal K value is the point at which an elbowor knee(i.e., a relatively sharp drop in variance) is formed in the graph. The elbow method (like other visual approaches) has often been criticized because of its subjective nature [62] as, at times, a clear elbow may not appear in the plot (suggesting no naturalgroup structure in the data?) or more than one elbow may be observed (suggesting more than one naturalcluster structure ts the data); even if the optimal value of the parameter under optimization is found by more numerical (rather than just visual means), such as slope analysis, the result can be sensitive to parameter range and pre-processing (e.g., scaling) [44]. Depending on the criterion of goodness under use, the relationship between the validity criterion and the number of clusters may not increase or decrease monotonically, and a peak,instead of a sharp variance drop, could be found at the optimal value. Various studies comparing the capacity of various clustering validity indexes to
5 Clustering of Small Molecules 119
identify the ground-truth cluster structure of synthetic and real-world data sets have been published. In general, validity indices that combine some measure of within­cluster and between-cluster distances are among the best-performing indices. The seminal work of Milligan and Cooper (1985) compared the ability of 30 clustering validity measures available at the time to identify the true structure of 108 synthetic data sets. The Calinski and Harabasz index was the one that demonstrated the best performance (it is worth noting that at that time the silhouet te index had not yet been reported). A much more recent similar study [3] also compared 30 clustering validity indexes, in this case against a much broader spectrum of data that included 720 syn­thetic data sets and 20 real data sets. The silhouette index obtained the best results, closely followed by the Davies–Bouldin and Calinski–Harabasz indexes. Despite the temporal distance between them, both studies agreed on the relatively few studies in which the results of a clustering experiment are evaluated using statistical tests (which is also commonplace in the eld of cheminformatics), a situation that contrasts with what occurs in the eld of supervised machine learning. It should be noted that Arbelaiz et al. observ ed that the performance of validity metrics to identify data structure dropped substantially when noisy data sets or data sets with overlapping clusters were analyzed. Surprisingly, introducing just 10 percent of noisy data dropped the average value of the indices by two-thirds.
Two recently reported small molecular clustering approaches, iRaPCA and deep clustering, use visual inspection of the silhouette width versus K to select the adequate number of clusters [21, 38] (Fig. 5.3).
Another way in which the optimal K can be selected as the initial input for algorithms that require pre-denition of the number of clusters involves a two-step hybrid hierarchical plus nonhierarchical approach in which the hierarchical algo­rithm is used to dene the number of clusters and provides an initial guess of cluster centroids (a stochastically or systematically chosen seed for each cluster, taken from
Fig. 5.3 Silhouette width versus K plots from iRaPCA. One plot is generated per random subspace. In the example, subset 2 (red plot) provides the best cluster structure according to the silhouette index (about 0.9) for K = 4
120 A. Talevi et al.
the partitions of the dendrogram); these data points then serve as the starting points for subsequent nonhierarchical clustering [18, 28]. It has been known for decades that randomly selected seeds typically lead to poorer recoveries of known partitions than seed selection obtained via initial hierarchical clustering [35].
A selection of freely available resources to perform small molecule clustering is included in Table 5.1, with the authorsappraisal of their advantages and disadvan­tages. Some questions to answer when planning a clustering study are listed in Table 5.2.

3 Challenges and Perspectives

Suppose that we were assigned the simpletask of clustering the following three objects: a goldsh, a dolphin, and a human. Some people may argue that the goldsh and the dolphin should be grouped together, based on criteria of shape, living environment, external organs, etc. Other people may suggest that dolphins and humans are more similar based, for instance, on the similarities between their internal organs (lungs, brains, etc.). Both arguments are sound. The previous exam­ple illustrates that the cluster structure of a dataset strongly depends on the features that have been used to partition the data: if different sets of features are considered, we will possibly obtain different results.
It is commonly argued, on the other hand, that the cluster structures that are most interesting are those that are meaningful,a concept that is usually used as a synonym for useful.For instance, it could be said that a classication of books based on subject matter, literary genre, or geographical origin of the author(s) would be of much wider use than a classication based on the color of the books binding [18]. However, if we Google noir books,we may be surprised to see that the colors red and black predominate in the cover images that the search returns. Another curious fact that contributes to this line of argument: in Italy, the books belonging to the genre of crime ction are known as libri gialli (literally, yellow books), because back in the 1920s the prestigious publishing house Mondadori characterized a popula r series of crime ction with yellow covers.
This second example illustrates two other important points. The rst is that the features that a researcher chooses based on the naturalstructure that he subjec­tively anticipates in the data can omit valuable (but unexpected) features that could, in turn, lead to a useful or meaningful cluster structure (e.g., cover colors as a possible feature to group books) and that, at rst glance, would surely be discarded in favor of more reasonablefeatures. Second, if the structure of the data depends on the variables used to partition it, if unsuspected variables can lead to valuable clusters, and if the value criterion varies according to the objective of the clustering experiment, it is possible that there is no natural underlying structure (ground truth) to structure the data.
Although the existence of such ground truth is assured when working with synthetic data, it is not so evident when working with real data. The personal view