def clr(args):
    p = OptionParser(clr.__doc__)
    p.set_bedpe()
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    bedpe, ref = args
    if bedpe.endswith(".bam"):
        bedpefile = bedpe.replace(".bam", ".bedpe")
        if need_update(bedpe, bedpefile):
            cmd = "bamToBed -bedpe -i {0}".format(bedpe)
            sh(cmd, outfile=bedpefile)
        bedpe = bedpefile

    filtered = bedpe + ".filtered"
    if need_update(bedpe, filtered):
        filter_bedpe(bedpe, filtered, ref, rc=opts.rc,
                     minlen=opts.minlen, maxlen=opts.maxlen)

    rmdup = filtered + ".sorted.rmdup"
    if need_update(filtered, rmdup):
        rmdup_bedpe(filtered, rmdup, dupwiggle=opts.dup)

    converted = rmdup + ".converted"
    if need_update(rmdup, converted):
        fp = open(rmdup)
        fw = open(converted, "w")
        for row in fp:
            r = BedpeLine(row)
            print >> fw, r.bedline
        fw.close()

    merged = converted + ".merge.bed"
    if need_update(converted, merged):
        mergeBed(converted)
Creates a new instance of this expando model.
dataset/ETHPy150Open tanghaibao/jcvi/formats/bed.py/clr--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/db/__init__.py/Expando.__init__