def fasta_to_dict(fasta_filename): # not clear the use of biopython gains anything here with open(fasta_filename) as f: return {k: str(v.seq) for k,v in SeqIO.to_dict(SeqIO.parse(f,'fasta')).iteritems()}