def fastq_touchup_for_vsearch_merge(read, outfile, reverse=False):
counts = <NUM_LIT:0><EOL>with open(outfile, '<STR_LIT:w>') as out:<EOL><INDENT>if read.endswith("<STR_LIT>"):<EOL><INDENT>fr1 = gzip.open(read, '<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>fr1 = open(read, '<STR_LIT:rb>')<EOL><DEDENT>quarts = itertools.izip(*[iter(fr1)]*<NUM_LIT:4>)<EOL>writing = []<EOL>while <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>lines = quarts.next()<EOL><DEDENT>except StopIteration:<EOL><INDENT>break<EOL><DEDENT>if reverse:<EOL><INDENT>seq = lines[<NUM_LIT:1>].strip()[::-<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>seq = lines[<NUM_LIT:1>].strip()<EOL><DEDENT>writing.append("<STR_LIT>".join([<EOL>lines[<NUM_LIT:0>],<EOL>seq+"<STR_LIT:\n>",<EOL>lines[<NUM_LIT:2>],<EOL>"<STR_LIT:B>"*len(seq)<EOL>]))<EOL>counts += <NUM_LIT:1><EOL>if not counts % <NUM_LIT:1000>:<EOL><INDENT>out.write("<STR_LIT:\n>".join(writing)+"<STR_LIT:\n>")<EOL>writing = []<EOL><DEDENT><DEDENT>if writing:<EOL><INDENT>out.write("<STR_LIT:\n>".join(writing))<EOL><DEDENT><DEDENT>out.close()<EOL>fr1.close()<EOL>
option to change orientation of reads and sets Qscore to B