def show_summary(O, vertex_labels, out=None, prefix=""): from libtbx.utils import xlen, plural_s import sys if (out is None): out = sys.stdout if (vertex_labels is None): fmt = "%%0%dd" % len(str(max(0, O.n_vertices - 1))) vertex_labels = [fmt % i for i in range(O.n_vertices)] else: assert len(vertex_labels) == O.n_vertices print(prefix + "number of vertices:", O.n_vertices, file=out) print(prefix + "number of edges:", xlen(O.edge_list), file=out) if (O.find_cluster_loop_repeats is None): print(prefix + "find cluster loops: None", file=out) else: print(prefix+"find cluster loops: %d repeat%s" % \ plural_s(O.find_cluster_loop_repeats), file=out) cm = O.cluster_manager cm.show_summary(out=out, prefix=prefix) if (cm.fixed_hinges is not None): for i, j in cm.fixed_hinges: print(prefix + "tardy fixed hinge:", vertex_labels[i], file=out) print(prefix + " ", vertex_labels[j], file=out) return O
def show_summary(O, out=None, prefix=""): from libtbx.utils import xlen, plural_s import sys if (out is None): out = sys.stdout print >> out, prefix+"number of fixed vertex lists:", \ len(O.fixed_vertex_lists) print >> out, prefix+"number of fixed vertices:", \ sum([len(fixed_vertices) for fixed_vertices in O.fixed_vertex_lists]) print >> out, prefix + "number of clusters:", len(O.clusters) print >> out, prefix+"merge clusters with multiple connections: %d pass%s"\ % plural_s(O.merge_clusters_with_multiple_connections_passes, "es") print >> out, prefix + "number of hinge edges:", xlen(O.hinge_edges) print >> out, prefix + "number of loop edges:", xlen(O.loop_edges) print >> out, prefix+"number of loop edge bendings:", \ xlen(O.loop_edge_bendings) print >> out, prefix + "number of fixed hinges:", xlen(O.fixed_hinges) return O
def show_summary(O, out=None, prefix=""): from libtbx.utils import xlen, plural_s import sys if (out is None): out = sys.stdout print >> out, prefix+"number of fixed vertex lists:", \ len(O.fixed_vertex_lists) print >> out, prefix+"number of fixed vertices:", \ sum([len(fixed_vertices) for fixed_vertices in O.fixed_vertex_lists]) print >> out, prefix+"number of clusters:", len(O.clusters) print >> out, prefix+"merge clusters with multiple connections: %d pass%s"\ % plural_s(O.merge_clusters_with_multiple_connections_passes, "es") print >> out, prefix+"number of hinge edges:", xlen(O.hinge_edges) print >> out, prefix+"number of loop edges:", xlen(O.loop_edges) print >> out, prefix+"number of loop edge bendings:", \ xlen(O.loop_edge_bendings) print >> out, prefix+"number of fixed hinges:", xlen(O.fixed_hinges) return O
def show_summary(O, vertex_labels, out=None, prefix=""): from libtbx.utils import xlen, plural_s import sys if (out is None): out = sys.stdout if (vertex_labels is None): fmt = "%%0%dd" % len(str(max(0, O.n_vertices-1))) vertex_labels = [fmt % i for i in xrange(O.n_vertices)] else: assert len(vertex_labels) == O.n_vertices print >> out, prefix+"number of vertices:", O.n_vertices print >> out, prefix+"number of edges:", xlen(O.edge_list) if (O.find_cluster_loop_repeats is None): print >> out, prefix+"find cluster loops: None" else: print >> out, prefix+"find cluster loops: %d repeat%s" % \ plural_s(O.find_cluster_loop_repeats) cm = O.cluster_manager cm.show_summary(out=out, prefix=prefix) if (cm.fixed_hinges is not None): for i,j in cm.fixed_hinges: print >> out, prefix+"tardy fixed hinge:", vertex_labels[i] print >> out, prefix+" ", vertex_labels[j] return O