def simsam_range_to_files(table, tree, simulated_sample_sizes, dissimilarities, output_dir, mapping_f=None, output_table_basename='table', output_map_basename='map'):
 create_dir(output_dir)
 for e in simsam_range(table, tree, simulated_sample_sizes, dissimilarities, mapping_f):
  output_table = e[0]
  output_mapping_lines = e[1]
  simulated_sample_size = e[2]
  dissimilarity = e[3]
  output_table_fp = join(output_dir, ('%s_n%d_d%r.biom' % (output_table_basename, simulated_sample_size, dissimilarity)))
  write_biom_table(output_table, output_table_fp)
  if (output_mapping_lines is not None):
   output_map_fp = join(output_dir, ('%s_n%d_d%r.txt' % (output_map_basename, simulated_sample_size, dissimilarity)))
   output_map_f = open(output_map_fp, 'w')
   output_map_f.write(''.join(output_mapping_lines))
   output_map_f.close()

def simsam_range_to_files ( table , tree , simulated_sample_sizes , dissimilarities , output_dir , mapping_f = None , output_table_basename = 'table' , output_map_basename = 'map' ) : create_dir ( output_dir ) for e in simsam_range ( table , tree , simulated_sample_sizes , dissimilarities , mapping_f ) : output_table = e [ 0 ] output_mapping_lines = e [ 1 ] simulated_sample_size = e [ 2 ] dissimilarity = e [ 3 ] output_table_fp = join ( output_dir , ( '%s_n%d_d%r.biom' % ( output_table_basename , simulated_sample_size , dissimilarity ) ) ) write_biom_table ( output_table , output_table_fp ) if ( output_mapping_lines is not None ) : output_map_fp = join ( output_dir , ( '%s_n%d_d%r.txt' % ( output_map_basename , simulated_sample_size , dissimilarity ) ) ) output_map_f = open ( output_map_fp , 'w' ) output_map_f . write ( '' . join ( output_mapping_lines ) ) output_map_f . close ( )
applies sim_otu_table over a range of parameters .