def scan(args):
    p = OptionParser(scan.__doc__)
    p.add_option("-n", "--min_size", dest="n", type="int", default=4,
            help="minimum number of anchors in a cluster [default: %default]")
    p.add_option("--liftover",
            help="Scan BLAST file to find extra anchors [default: %default]")
    p.set_stripnames()

    blast_file, anchor_file, dist, opts = add_options(p, args, dist=20)
    qbed, sbed, qorder, sorder, is_self = check_beds(blast_file, p, opts)

    filtered_blast = read_blast(blast_file, qorder, sorder, \
                                is_self=is_self, ostrip=False)

    fw = open(anchor_file, "w")
    logging.debug("Chaining distance = {0}".format(dist))

    clusters = batch_scan(filtered_blast, xdist=dist, ydist=dist, N=opts.n)
    for cluster in clusters:
        print >>fw, "###"
        for qi, si, score in cluster:
            query, subject = qbed[qi].accn, sbed[si].accn
            print >>fw, "\t".join((query, subject, str(int(score))))

    fw.close()
    summary([anchor_file])

    lo = opts.liftover
    if not lo:
        return anchor_file

    bedopts = ["--qbed=" + opts.qbed, "--sbed=" + opts.sbed]
    ostrip = [] if opts.strip_names else ["--no_strip_names"]
    newanchorfile = liftover([lo, anchor_file] + bedopts + ostrip)
    return newanchorfile
Returns the number of channels the actor is a member of.
dataset/ETHPy150Open tanghaibao/jcvi/compara/synteny.py/scan--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/bin/backfill_channel_count.py/ChannelCountBackfiller.get_channel_count