allpy
changeset 397:2ac62edd1c3e
align allpy_pdb.py with changes in graph.py
author | boris <bnagaev@gmail.com> |
---|---|
date | Thu, 03 Feb 2011 13:56:57 +0300 |
parents | 3a802644d798 |
children | 223df1ee4c21 |
files | allpy/allpy_pdb.py |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line diff
1.1 --- a/allpy/allpy_pdb.py Thu Feb 03 13:51:39 2011 +0300 1.2 +++ b/allpy/allpy_pdb.py Thu Feb 03 13:56:57 2011 +0300 1.3 @@ -183,8 +183,8 @@ 1.4 cost is calculated as 1 / (delta + 1) 1.5 delta in [0, +inf) => cost in (0, 1] 1.6 """ 1.7 - nodes = self.columns 1.8 - lines = {} 1.9 + vertices = self.columns 1.10 + edges = {} 1.11 for i, column1 in enumerate(self.columns): 1.12 for j, column2 in enumerate(self.columns): 1.13 if i < j: 1.14 @@ -202,15 +202,15 @@ 1.15 if len(distances) >= 2: 1.16 delta = max(distances) - min(distances) 1.17 if delta <= max_delta: 1.18 - line = Graph.line(column1, column2) 1.19 - lines[line] = 1.0 / (1.0 + delta) 1.20 - graph = Graph(nodes, lines) 1.21 - cliques = graph.fast_cliques(minsize=minsize) 1.22 + edge = Graph.edge(column1, column2) 1.23 + edges[edge] = 1.0 / (1.0 + delta) 1.24 + graph = Graph(vertices, edges) 1.25 + cliques = graph.cliques(minsize=minsize, timeout=timeout) 1.26 GCs = [] 1.27 for clique in cliques: 1.28 for GC in GCs: 1.29 - new_nodes = clique - GC 1.30 - if len(new_nodes) < ac_new_atoms * len(clique): 1.31 + new_vertices = clique - GC 1.32 + if len(new_vertices) < ac_new_atoms * len(clique): 1.33 break 1.34 else: 1.35 GCs.append(clique)