I have a phylogenetic tree. At each node of the tree I have a list of genes that are important at this node. I also have the KOG function for each gene at each node. I have categorised each funciton into 4 major pathways and 1 unassigned category. I would like to know if there is an existing way to implement an enrichment analysis of these KOG terms for each node of the tree and/or for specific clades on the tree.
Preferably using python.