def parallel_pick_otus_trie_process_run_results_f(f):
 lines = list(f)
 basic_process_run_results_f([lines[1]])
 try:
  basic_process_run_results_f([lines[2]])
  basic_process_run_results_f([lines[3]])
 except IndexError:
  pass
 fields = lines[0].strip().split()
 infiles_list = fields[:(-1)]
 out_filepath = fields[(-1)]
 try:
  of = open(out_filepath, 'w')
 except IOError:
  raise IOError((("Poller can't open final output file: %s" % out_filepath) + '\nLeaving individual jobs output.\n Do you have write access?'))
 unique_otu_map = {}
 otu_id = 0
 for fp in infiles_list:
  for line in open(fp):
   fields = line.strip().split()
   of.write(' DCTB '.join(([('%d' % otu_id)] + fields[1:])))
   of.write('\n')
   otu_id += 1
 of.close()
 return True

def parallel_pick_otus_trie_process_run_results_f ( f ) : lines = list ( f ) basic_process_run_results_f ( [ lines [ 1 ] ] ) try : basic_process_run_results_f ( [ lines [ 2 ] ] ) basic_process_run_results_f ( [ lines [ 3 ] ] ) except IndexError : pass fields = lines [ 0 ] . strip ( ) . split ( ) infiles_list = fields [ : ( - 1 ) ] out_filepath = fields [ ( - 1 ) ] try : of = open ( out_filepath , 'w' ) except IOError : raise IOError ( ( ( "Poller can't open final output file: %s" % out_filepath ) + '\nLeaving individual jobs output.\n Do you have write access?' ) ) unique_otu_map = { } otu_id = 0 for fp in infiles_list : for line in open ( fp ) : fields = line . strip ( ) . split ( ) of . write ( ' DCTB ' . join ( ( [ ( '%d' % otu_id ) ] + fields [ 1 : ] ) ) ) of . write ( '\n' ) otu_id += 1 of . close ( ) return True
copy each list of infiles to each outfile and delete infiles f: file containing one set of mapping instructions per line example f: f1 .