Gains and losses of metabolic function inferred from a phylotranscriptomic analysis of algae