def multiple_file_beta(input_path, output_dir, metrics, tree_path, rowids=None, full_tree=False):
 metrics_list = metrics
 try:
  metrics_list = metrics_list.split(',')
 except AttributeError:
  pass
 file_names = os.listdir(input_path)
 file_names = [fname for fname in file_names if (not fname.startswith('.'))]
 try:
  os.makedirs(output_dir)
 except OSError:
  pass
 for metric in metrics_list:
  try:
   metric_f = get_nonphylogenetic_metric(metric)
  except AttributeError:
   try:
    metric_f = get_phylogenetic_metric(metric)
    if (not tree_path):
     raise ValueError(('a tree file is required for ' + metric))
   except AttributeError:
    raise ValueError(('Could not find metric %s.\n\nKnown metrics are: %s\n' % (metric, ', '.join(list_known_metrics()))))
 for fname in file_names:
  single_file_beta(os.path.join(input_path, fname), metrics, tree_path, output_dir, rowids, full_tree)

def multiple_file_beta ( input_path , output_dir , metrics , tree_path , rowids = None , full_tree = False ) : metrics_list = metrics try : metrics_list = metrics_list . split ( ',' ) except AttributeError : pass file_names = os . listdir ( input_path ) file_names = [ fname for fname in file_names if ( not fname . startswith ( '.' ) ) ] try : os . makedirs ( output_dir ) except OSError : pass for metric in metrics_list : try : metric_f = get_nonphylogenetic_metric ( metric ) except AttributeError : try : metric_f = get_phylogenetic_metric ( metric ) if ( not tree_path ) : raise ValueError ( ( 'a tree file is required for ' + metric ) ) except AttributeError : raise ValueError ( ( 'Could not find metric %s.\n\nKnown metrics are: %s\n' % ( metric , ', ' . join ( list_known_metrics ( ) ) ) ) ) for fname in file_names : single_file_beta ( os . path . join ( input_path , fname ) , metrics , tree_path , output_dir , rowids , full_tree )
runs beta diversity for each input file in the input directory performs minimal error checking on input args .