fetch species absence/presence vector for each gene
This is easy. I have some code to do this (remember the "orthologues tree" theme). I used this presence/absence to use a different color for the absent tree paths (and leaves).
prune species tree or dim leaves with no genes
In this case we can leave them in the tree (using a faded-out color or something like this). If pruning the tree is better, we can use a combination of "get_all_leaves" with "subtree" to get the pruned tree.
schematically draw genes using different colors and directions
This is interesting. It was far more difficult with the previous code, but now that we have "tracks" we can create a new type "arrow" or something like that. It would be more difficult to align the arrows because each track is independent, but we may find a way of displaying this.
Input: set of gene names, species tree? Internally: