INNER CODE UNIT · Python
vertices
steineggerlab/Metabuli · util/gtdb_to_taxdump.py:74
def vertices(self):
""" returns the vertices of a graph """
return list(self.__graph_dict.keys())
def edges(self):
""" returns the edges of a graph """
return self.__generate_edges()
def add_vertex(self, vertex):
""" If the vertex "vertex" is not in
self.__graph_dict, a key "vertex" with an empty
list as a value is added to the dictionary.
Otherwise nothing has to be done.
"""
if vertex not in self.__graph_dict:
self.__graph_dict[vertex] = []
self.__graph_nodeIDs[vertex] = len(self.__graph_nodeIDs.keys())+1