def abi_to_fasta(input, output):
direcs = [input, ]<EOL>zip_files = list_files(input, ['<STR_LIT>'])<EOL>if zip_files:<EOL><INDENT>direcs.extend(_process_zip_files(zip_files))<EOL><DEDENT>for d in direcs:<EOL><INDENT>files = list_files(d, ['<STR_LIT>', '<STR_LIT>'])<EOL>seqs = [SeqIO.read(open(f, '<STR_LIT:rb>'), '<STR_LIT>') for f in files]<EOL>fastas = ['<STR_LIT>'.format(s.id, str(s.seq)) for s in seqs]<EOL>ofile = os.path.basename(os.path.normpath(d)) + '<STR_LIT>'<EOL>opath = os.path.join(output, ofile)<EOL>open(opath, '<STR_LIT:w>').write('<STR_LIT:\n>'.join(fastas))<EOL><DEDENT>
Converts ABI or AB1 files to FASTA format.

Args:

     input (str): Path to a file or directory containing abi/ab1 files or
        zip archives of abi/ab1 files

    output (str): Path to a directory for the output FASTA files