def generate_combined_fasta(self, genome_list, genome_dir):
fasta = []<EOL>for genome in genome_list:<EOL><INDENT>full_path = genome_dir + genome<EOL>handle = open(full_path, "<STR_LIT>")<EOL>print('<STR_LIT>', genome)<EOL>try:<EOL><INDENT>seq_record = SeqIO.read(handle, '<STR_LIT>')<EOL>org_accession = seq_record.name<EOL><DEDENT>except AssertionError as e:<EOL><INDENT>print(str(e), genome)<EOL><DEDENT>for feature in seq_record.features:<EOL><INDENT>if feature.type == '<STR_LIT>':<EOL><INDENT>try:                                  <EOL><INDENT>prot_accession = feature.qualifiers['<STR_LIT>'][<NUM_LIT:0>]<EOL>prot_translation = feature.qualifiers['<STR_LIT>'][<NUM_LIT:0>]<EOL>newfast = '<STR_LIT:>>' + org_accession + '<STR_LIT:U+002C>' + prot_accession +'<STR_LIT:\n>' + prot_translation + '<STR_LIT:\n>'<EOL>fasta.append(newfast)<EOL><DEDENT>except AttributeError as e:<EOL><INDENT>print("<STR_LIT>" % (org_accession, prot_accession))<EOL>print(str(e))<EOL><DEDENT>except KeyError as e:<EOL><INDENT>print("<STR_LIT>" % (org_accession, prot_accession))<EOL>print(str(e))<EOL><DEDENT><DEDENT><DEDENT>handle.close()<EOL>print("<STR_LIT>" % len(fasta))<EOL>set_fasta = set(fasta)<EOL>print("<STR_LIT>" % len(set_fasta))<EOL><DEDENT>faastring = "<STR_LIT>".join(set_fasta)<EOL>write_fasta = open('<STR_LIT>', '<STR_LIT:w>')<EOL>write_fasta.write(faastring)<EOL>write_fasta.close()<EOL>return set_fasta<EOL>
Generate a combined fasta using the genbank files.

            Args
                genome_list (list)
                genome_dir (string)