ghost-tree
ghost-tree copied to clipboard
improve most_common_genus complexity (ghosttree.scaffold)
Suggestion from D.M.:
line 126, which determines most_common_genus is doing a list lookup for each name, so the runtime of it is O(N * M) where N is the number of entries in otu_genus_list
and M is the number of unique names in that list. This can be reduced to around O(N + M) by casting the list to a Counter, and then max'ing the items.