def collapse(in_file):
keep = Counter()<EOL>with open_fastq(in_file) as handle:<EOL><INDENT>for line in handle:<EOL><INDENT>if line.startswith("<STR_LIT:@>"):<EOL><INDENT>if line.find("<STR_LIT>") > -<NUM_LIT:1>:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>return collapse_umi(in_file)<EOL><DEDENT>seq = handle.next().strip()<EOL>handle.next()<EOL>qual = handle.next().strip()<EOL>if seq in keep:<EOL><INDENT>keep[seq].update(qual)<EOL><DEDENT>else:<EOL><INDENT>keep[seq] = quality(qual)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>logger.info("<STR_LIT>" % len(keep))<EOL>return keep<EOL>
collapse identical sequences and keep Q