def single_file_cup(otu_filepath, metrics, outfilepath, r):
 calcs = []
 params = {'r': r}
 metrics_list = metrics
 try:
  metrics_list = metrics_list.split(',')
 except AttributeError:
  pass
 for metric in metrics_list:
  try:
   metric_f = get_cup_metric(metric)
  except AttributeError:
   stderr.write(('Could not find metric %s.\n Known metrics are: %s\n' % (metric, ', '.join(list_known_cup_metrics()))))
   exit(1)
  c = AlphaDiversityCalc(metric_f, params=params)
  calcs.append(c)
 all_calcs = AlphaDiversityCalcs(calcs)
 try:
  result = all_calcs(data_path=otu_filepath, result_path=outfilepath, log_path=None)
  if result:
   print all_calcs.formatResult(result)
 except IOError as e:
  stderr.write('Failed because of missing files.\n')
  stderr.write((str(e) + '\n'))
  exit(1)

def single_file_cup ( otu_filepath , metrics , outfilepath , r ) : calcs = [ ] params = { 'r' : r } metrics_list = metrics try : metrics_list = metrics_list . split ( ',' ) except AttributeError : pass for metric in metrics_list : try : metric_f = get_cup_metric ( metric ) except AttributeError : stderr . write ( ( 'Could not find metric %s.\n Known metrics are: %s\n' % ( metric , ', ' . join ( list_known_cup_metrics ( ) ) ) ) ) exit ( 1 ) c = AlphaDiversityCalc ( metric_f , params = params ) calcs . append ( c ) all_calcs = AlphaDiversityCalcs ( calcs ) try : result = all_calcs ( data_path = otu_filepath , result_path = outfilepath , log_path = None ) if result : print all_calcs . formatResult ( result ) except IOError as e : stderr . write ( 'Failed because of missing files.\n' ) stderr . write ( ( str ( e ) + '\n' ) ) exit ( 1 )
compute variations of the conditional uncovered probability .