def _create_clusters(seqL, bam_file, args):
clus_obj = []<EOL>cluster_file = op.join(args.out, "<STR_LIT>")<EOL>if not os.path.exists(op.join(args.out, '<STR_LIT>')):<EOL><INDENT>if not file_exists(cluster_file):<EOL><INDENT>logger.info("<STR_LIT>")<EOL>logger.info("<STR_LIT>")<EOL>bedtools = os.path.join(os.path.dirname(sys.executable), "<STR_LIT>")<EOL>bedtools = bedtools if os.path.exists(bedtools) else "<STR_LIT>"<EOL>parse_cmd = "<STR_LIT>"<EOL>cmd = "<STR_LIT>"<EOL>do.run(cmd.format(**locals()))<EOL><DEDENT>c = pybedtools.BedTool(cluster_file)<EOL>logger.info("<STR_LIT>")<EOL>clus_obj = detect_clusters(c, seqL, args.min_seqs, args.non_un_gl)<EOL>with open(op.join(args.out, '<STR_LIT>'), '<STR_LIT:wb>') as output:<EOL><INDENT>pickle.dump(clus_obj, output, pickle.HIGHEST_PROTOCOL)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>with open(op.join(args.out, '<STR_LIT>'), '<STR_LIT:rb>') as input:<EOL><INDENT>clus_obj = pickle.load(input)<EOL><DEDENT><DEDENT>logger.info("<STR_LIT>" % (len(clus_obj.clusid)))<EOL>return clus_obj<EOL>
Cluster sequences and
create metaclusters with multi-mappers.