Révision f6431316
b/modules/clustering.py | ||
---|---|---|
13 | 13 |
clustering: Directs the clustering process by calling the relevant functions. |
14 | 14 |
""" |
15 | 15 |
import logging |
16 |
import warnings |
|
16 | 17 |
|
17 | 18 |
import hdbscan |
18 | 19 |
import numpy as np |
19 | 20 |
|
20 | 21 |
logger = logging.getLogger('DockOnSurf') |
22 |
warnings.filterwarnings("error") |
|
21 | 23 |
|
22 | 24 |
|
23 | 25 |
def get_rmsd(mol_list: list, remove_Hs="c"): |
... | ... | |
124 | 126 |
exemplars = [] |
125 | 127 |
for i, mtx in enumerate(clust_affty_mtcs): |
126 | 128 |
pref = -1e6 * np.max(np.abs(mtx)) |
127 |
af = AffinityPropagation(affinity='precomputed', preference=pref, |
|
128 |
damping=0.95, max_iter=2000, |
|
129 |
random_state=None).fit(mtx) |
|
129 |
try: |
|
130 |
af = AffinityPropagation(affinity='precomputed', preference=pref, |
|
131 |
damping=0.95, max_iter=2000, |
|
132 |
random_state=None).fit(mtx) |
|
133 |
except UserWarning as w: |
|
134 |
logger.warning(str(w)) |
|
130 | 135 |
exemplars.append(clusters[i][af.cluster_centers_indices_[0]]) |
131 | 136 |
return exemplars |
132 | 137 |
|
Formats disponibles : Unified diff