def fastqIteratorSimple(fn, verbose=False, allowNameMissmatch=False):
fh = fn<EOL>if type(fh).__name__ == "<STR_LIT:str>":<EOL><INDENT>fh = open(fh)<EOL><DEDENT>if verbose:<EOL><INDENT>try:<EOL><INDENT>totalLines = os.path.getsize(fh.name)<EOL>pind = ProgressIndicator(totalToDo=totalLines,<EOL>messagePrefix="<STR_LIT>",<EOL>messageSuffix="<STR_LIT>"<EOL>+ fh.name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>sys.stderr.write("<STR_LIT>" +<EOL>"<STR_LIT>")<EOL>verbose = False<EOL><DEDENT><DEDENT>while True:<EOL><INDENT>lines = []<EOL>gotLines = <NUM_LIT:0><EOL>while gotLines < <NUM_LIT:4>:<EOL><INDENT>l = fh.readline()<EOL>if verbose:<EOL><INDENT>pind.done = fh.tell()<EOL>pind.showProgress()<EOL><DEDENT>if l == "<STR_LIT>":<EOL><INDENT>if gotLines == <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>raise FastqFileFormatError("<STR_LIT>"<EOL>+ "<STR_LIT>")<EOL><DEDENT><DEDENT>l = l.strip()<EOL>if l == "<STR_LIT>":<EOL><INDENT>continue<EOL><DEDENT>lines.append(l)<EOL>gotLines += <NUM_LIT:1><EOL><DEDENT>if gotLines == <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>if lines[<NUM_LIT:0>][<NUM_LIT:1>:] != lines[<NUM_LIT:2>][<NUM_LIT:1>:] and not allowNameMissmatch:<EOL><INDENT>raise FastqFileFormatError("<STR_LIT>" +<EOL>str(lines[<NUM_LIT:0>][<NUM_LIT:1>:]) + "<STR_LIT>" +<EOL>str(lines[<NUM_LIT:2>][<NUM_LIT:1>:]))<EOL><DEDENT>name = lines[<NUM_LIT:0>][<NUM_LIT:1>:]<EOL>seq = lines[<NUM_LIT:1>]<EOL>qual = lines[<NUM_LIT:3>]<EOL>yield NGSRead(seq, name, qual)<EOL><DEDENT>
A generator function that yields FastqSequence objects read from a
fastq-format stream or filename. This is iterator requires that all
sequence and quality data is provided on a single line -- put another way,
it cannot parse fastq files with newline characters interspersed in the
sequence and/or quality strings. That's probably okay though, as fastq
files tend not to be formated like that (famous last words..).

:param fn: filename or stream to read data from.
:param allowNameMismatch:  don't throw error if name in sequence data
                           and quality data parts of a read don't match.
                           Newer version of CASVA seem to output data like
                           this, probably to save space.
:param verbose: if True, output additional status messages to stderr about
                progress.