INNER CODE UNIT · Python
__generate_edges
steineggerlab/Metabuli · util/gtdb_to_taxdump.py:101
def __generate_edges(self):
""" A static method generating the edges of the
graph "graph". Edges are represented as sets
with one (a loop back to the vertex) or two
vertices
"""
edges = []
for vertex in self.__graph_dict:
for neighbour in self.__graph_dict[vertex]:
if {neighbour, vertex} not in edges:
edges.append({vertex, neighbour})
return edges
def __str__(self):
res = "vertices: "
for k in self.__graph_dict.keys():
res += str(k) + " "
res += "\nvertex UIDs: "