We regularly hear from users that are looking to calculate the level, or depth, of a GO term. However, we strongly recommend against this as there is no meaning behind it. GO terms do not occupy strict fixed levels in the hierarchy. Because GO is structured as a graph, terms would appear at different ‘levels’ if different paths were followed through the graph. This is especially true if one mixes the different relations used to connect terms. Below is an ancestor chart from QuickGO, where the term GO:0051348 negative regulation of transferase activity could be 3, 4, or 5 levels past the root terms.
A more informative metric would be the information content of the node based on annotations. See, for example, the work of Alterovitz et al..