Calculating functional diversity metrics using neighbor-joining trees