def __init__(self, filename, delimiter='<STR_LIT:>>', **kwrds):
super(FastaIterator, self).__init__(filename)<EOL>self.fasta_file = self.filename<EOL>self.fasta_index = False<EOL>self.delimiter = delimiter<EOL>self.delimiter_length = len(delimiter)<EOL>self.parse = kwrds.get('<STR_LIT>', None)<EOL>if self.parse:<EOL><INDENT>self.parse = re.compile(self.parse)<EOL><DEDENT>self.fasta_index = kwrds.get('<STR_LIT:index>', None)<EOL>if not self.fasta_index:<EOL><INDENT>if os.path.exists('<STR_LIT>' % (self.fasta_file.name, '<STR_LIT>')):<EOL><INDENT>self.fasta_index = '<STR_LIT>' % (self.fasta_file.name, '<STR_LIT>')<EOL><DEDENT>elif os.path.exists('<STR_LIT>' % (self.fasta_file.name, '<STR_LIT>')):<EOL><INDENT>self.fasta_index = '<STR_LIT>' % (self.fasta_file.name, '<STR_LIT>')<EOL><DEDENT>if self.fasta_index:<EOL><INDENT>self.open_fasta_index()<EOL><DEDENT>else:<EOL><INDENT>self.fasta_index = None<EOL><DEDENT><DEDENT>self.sequence_index = {}<EOL>self.row = None<EOL>
Optional argument: delimiter -- > default