def write_combined_fasta(fasta_name_to_sample_id, fasta_files, output_dir='.', counter=0):
 combined_file_out = open(join((output_dir + '/'), 'combined_seqs.fna'), 'w')
 for curr_fasta in fasta_files:
  for (label, seq) in parse_fasta(open(curr_fasta, 'U')):
   combined_file_out.write(('>%s_%d %s\n' % (fasta_name_to_sample_id[basename(curr_fasta)], counter, label)))
   combined_file_out.write(('%s\n' % seq))
   counter += 1

def write_combined_fasta ( fasta_name_to_sample_id , fasta_files , output_dir = '.' , counter = 0 ) : combined_file_out = open ( join ( ( output_dir + '/' ) , 'combined_seqs.fna' ) , 'w' ) for curr_fasta in fasta_files : for ( label , seq ) in parse_fasta ( open ( curr_fasta , 'U' ) ) : combined_file_out . write ( ( '>%s_%d %s\n' % ( fasta_name_to_sample_id [ basename ( curr_fasta ) ] , counter , label ) ) ) combined_file_out . write ( ( '%s\n' % seq ) ) counter += 1
writes combined .