def make_unifrac_metric(weighted, metric, is_symmetric):
 def result(data, taxon_names, tree, sample_names, **kwargs):
  ' wraps the fast_unifrac fn to return just a matrix, in correct order\n\n            sample_names: list of unique strings\n        '
  envs = make_envs_dict(data, sample_names, taxon_names)
  unifrac_res = fast_unifrac(tree, envs, weighted=weighted, metric=metric, is_symmetric=is_symmetric, modes=['distance_matrix'], **kwargs)
  dist_mtx = _reorder_unifrac_res(unifrac_res['distance_matrix'], sample_names)
  return dist_mtx
 return result

def make_unifrac_metric ( weighted , metric , is_symmetric ) : def result ( data , taxon_names , tree , sample_names , ** kwargs ) : envs = make_envs_dict ( data , sample_names , taxon_names ) unifrac_res = fast_unifrac ( tree , envs , weighted = weighted , metric = metric , is_symmetric = is_symmetric , modes = [ 'distance_matrix' ] , ** kwargs ) dist_mtx = _reorder_unifrac_res ( unifrac_res [ 'distance_matrix' ] , sample_names ) return dist_mtx return result
make a unifrac-like metric .