Skip to main content
. 2022 Dec 29;15(1):119. doi: 10.3390/pharmaceutics15010119
Algorithm 1 Grouping predicted ligandable points into binding sites.
1: function binding_sites(yp,points)
2:     a←0.3           ▹ Real values a and b define the interval in which we look for the best c value.
3:     b←1
4:     c←0.5    ▹ Real value c is the threshold for classification of ligandability predictions in each iteration of the while loop.
5:     ligandablePoints← select_ligandable_points(yp,points,c)
6:     bindingSites←emptyList
7:     iteration←0
8:     condition←“continue”
9:     while condition is not “break” do
10:         clusters← components(ligandablePoints)
11:         for cluster∈clusters do
12:              if cluster properties fit into quantile bounds then
13:                  append cluster to bindingSites
14:            end if
15:         end for
16:         points←points−bindingSites.points
17:         if condition is “increase a” then
18:              a←0.2·(b−a)+a
19:         else if condition is “decrease b” then
20:              b←0.2·(a−b)+b
21:         end if
22:         c←(a+b)/2
23:         iteration←iteration+1
24:         ligandablePoints← select_ligandable_points(yp,points,c)
25:         condition← compute_condition(clusters,iteration,#points)
26:     end while
27:     return bindingSites
28: end function
 
29: function compute_condition(clusters,iteration,#points)
30:      if iteration>20 then return “break”
31:      else if len(clusters.points)#points>0.2 then return “increase a”
32:      else if clusters is an emptyList then return “decrease b”
33:      else if max(size(clusters))<qv(0.1) then return “decrease b”
34:      else if max(size(clusters))>qv(0.9) then return “increase a”
35:      else if max(avg_distance(clusters))<qa(0.1) then return “decrease b”
36:      else if max(avg_distance(clusters))<qa(0.9) then return “increase a”
37:      else if max(std_distance(clusters))<qs(0.1) then return “decrease b”
38:      else if max(std_distance(clusters))<qs(0.9) then return “increase a”
39:      else
40:           return “decrease b”
41:     end if
42: end function
 
43: function components(points)
44:     V←points
45:     E←{(x,y)|d2(x,y)<4}            ▹ Two points are connected if they are closer than 4Å
46:     G←(V,E)                                                       ▹ Create a graph with vertices V and edges E
47:     return connected_components(G)
48: end function
 
49: function select_ligandable_points(yp,points,c)
50:     ligandablePoints←emptyList
51:     for point∈points do
52:         if yp[point]>c then                  ▹ Check if prediction for point is higher than threshold c
53:              append point to ligandablePoints
54:         end if
55:     end for
56:     return ligandablePoints
57: end function