def collapse_fastq(args):
try:<EOL><INDENT>umi_fn = args.fastq<EOL>if _is_umi(args.fastq):<EOL><INDENT>umis = collapse(args.fastq)<EOL>umi_fn = os.path.join(args.out, splitext_plus(os.path.basename(args.fastq))[<NUM_LIT:0>] + "<STR_LIT>")<EOL>write_output(umi_fn, umis, args.minimum)<EOL><DEDENT>seqs = collapse(umi_fn)<EOL>out_file = splitext_plus(os.path.basename(args.fastq))[<NUM_LIT:0>] + "<STR_LIT>"<EOL><DEDENT>except IOError as e:<EOL><INDENT>logger.error("<STR_LIT>".format(e.errno, e.strerror))<EOL>raise "<STR_LIT>"<EOL><DEDENT>out_file = os.path.join(args.out, out_file)<EOL>write_output(out_file, seqs, args.minimum)<EOL>return out_file<EOL>
collapse fasq files after adapter trimming