def query_links(abed, bbed):
    abedlinks = abed.links
    bbedlinks = bbed.links
    # Reverse complement bbedlinks
    bxbedlinks = bbedlinks[:]
    for (a, ai), (b, bi) in bbedlinks:
        ai = {"+": "-", "?": "-", "-": "+"}[ai]
        bi = {"+": "-", "?": "-", "-": "+"}[bi]
        bxbedlinks.append(((b, bi), (a, ai)))

    atotal = len(abedlinks)
    print >> sys.stderr, "Total links in {0}: {1}".\
                    format(abed.filename, atotal)
    recovered = set(abedlinks) & set(bxbedlinks)
    print >> sys.stderr, "Recovered {0}".\
                    format(percentage(len(recovered), atotal))
    print >> sys.stderr, set(abedlinks) - set(bxbedlinks)
dataset/ETHPy150Open tanghaibao/jcvi/projects/allmaps.py/query_links/original